arnaucube
arnaucube/configsPublic Self-hosted repository
configs/init.vim
init.vimRaw
  1call plug#begin(expand('~/.config/nvim/plugged'))
  2
  3Plug 'scrooloose/nerdtree'
  4Plug 'jistr/vim-nerdtree-tabs'
  5Plug 'vim-airline/vim-airline'
  6Plug 'vim-airline/vim-airline-themes'
  7Plug 'airblade/vim-gitgutter'
  8Plug 'Raimondi/delimitMate'
  9Plug 'scrooloose/syntastic'
 10Plug 'scrooloose/nerdcommenter'
 11
 12" go
 13Plug 'fatih/vim-go' " Amazing combination of features.
 14Plug 'godoctor/godoctor.vim' " Some refactoring tools
 15
 16" rust
 17"" will need to install https://github.com/racer-rust/racer
 18Plug 'racer-rust/vim-racer'
 19Plug 'rust-lang/rust.vim'
 20set hidden
 21let g:racer_cmd = "/home/user/.cargo/bin/racer"
 22let g:racer_experimental_completer = 1
 23
 24
 25" javascript
 26Plug 'jelera/vim-javascript-syntax'
 27
 28" python
 29Plug 'davidhalter/jedi-vim'
 30Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
 31
 32Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
 33Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
 34
 35" colors
 36Plug 'tomasr/molokai'
 37Plug 'srcery-colors/srcery-vim'
 38Plug 'rakr/vim-one'
 39Plug 'morhetz/gruvbox'
 40
 41call plug#end()
 42
 43" setup
 44
 45" visual
 46syntax on
 47set ruler
 48set number
 49set title
 50set titlestring=nvim-%F
 51set t_Co=256
 52set cursorline
 53" colorscheme one
 54" set background=dark
 55
 56"Credit joshdick
 57"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
 58"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
 59"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
 60if (empty($TMUX))
 61  if (has("nvim"))
 62  "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
 63  let $NVIM_TUI_ENABLE_TRUE_COLOR=1
 64  endif
 65  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
 66  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
 67  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
 68  if (has("termguicolors"))
 69    set termguicolors
 70  endif
 71endif
 72
 73set background=dark " for the dark version
 74" set background=light " for the light version
 75" colorscheme one
 76colorscheme molokai
 77
 78if $COLORTERM == 'gnome-terminal'
 79  set term=gnome-256color
 80else
 81  if $TERM == 'xterm'
 82    set term=xterm-256color
 83  endif
 84endif
 85
 86set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
 87
 88" go
 89let g:go_auto_sameids = 1
 90
 91" vim-airline
 92"" let g:airline_theme = 'powerlineish'
 93let g:airline_theme='one'
 94let g:airline#extensions#syntastic#enabled = 1
 95let g:airline#extensions#branch#enabled = 1
 96let g:airline#extensions#tabline#enabled = 1
 97let g:airline#extensions#tagbar#enabled = 1
 98let g:airline_skip_empty_sections = 1
 99
100" abbreviations
101cnoreabbrev W! w!
102cnoreabbrev Q! q!
103cnoreabbrev Qall! qall!
104cnoreabbrev Wq wq
105cnoreabbrev Wa wa
106cnoreabbrev wQ wq
107cnoreabbrev WQ wq
108cnoreabbrev W w
109cnoreabbrev Q q
110cnoreabbrev Qall qall
111
112let g:deoplete#enable_at_startup = 1
113let g:srcery_italic = 1
114
115" NERDTree
116let NERDTreeShowHidden=1
117autocmd vimenter * NERDTree
118map <C-n> :NERDTreeToggle<CR>
119
120" NERDCommenter
121let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
122let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
123let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
124
125"" Switching windows
126noremap <C-j> <C-w>j
127noremap <C-k> <C-w>k
128noremap <C-l> <C-w>l
129noremap <C-h> <C-w>h
130
131
132" syntastic
133let g:syntastic_always_populate_loc_list=1
134let g:syntastic_error_symbol='✗'
135let g:syntastic_warning_symbol='⚠'
136let g:syntastic_style_error_symbol = '✗'
137let g:syntastic_style_warning_symbol = '⚠'
138let g:syntastic_auto_loc_list=1
139let g:syntastic_aggregate_errors = 1
140
141"" go config
142
143function! s:build_go_files()
144  let l:file = expand('%')
145  if l:file =~# '^\f\+\.go$'
146    call go#cmd#Build(0)
147  endif
148endfunction
149
150
151let g:go_list_type = "quickfix"
152let g:go_fmt_command = "goimports"
153let g:go_fmt_fail_silently = 1
154let g:syntastic_go_checkers = ['golint', 'govet']
155let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
156
157let g:go_highlight_types = 1
158let g:go_highlight_fields = 1
159let g:go_highlight_functions = 1
160let g:go_highlight_methods = 1
161let g:go_highlight_operators = 1
162let g:go_highlight_build_constraints = 1
163let g:go_highlight_structs = 1
164let g:go_highlight_generate_tags = 1
165let g:go_highlight_space_tab_error = 0
166let g:go_highlight_array_whitespace_error = 0
167let g:go_highlight_trailing_whitespace_error = 0
168let g:go_highlight_extra_types = 1
169
170"" esc mapping
171inoremap jk <ESC>