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'
 11Plug 'majutsushi/tagbar'
 12Plug 'kien/rainbow_parentheses.vim'
 13
 14" go
 15Plug 'fatih/vim-go' " Amazing combination of features.
 16Plug 'godoctor/godoctor.vim' " Some refactoring tools
 17
 18" rust
 19"" will need to install https://github.com/racer-rust/racer
 20Plug 'racer-rust/vim-racer'
 21Plug 'rust-lang/rust.vim'
 22set hidden
 23let g:racer_cmd = "/home/user/.cargo/bin/racer"
 24let g:racer_experimental_completer = 1
 25
 26
 27" javascript
 28Plug 'jelera/vim-javascript-syntax'
 29
 30" python
 31Plug 'davidhalter/jedi-vim'
 32Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
 33
 34Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
 35Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
 36
 37" colors
 38Plug 'tomasr/molokai'
 39Plug 'srcery-colors/srcery-vim'
 40Plug 'rakr/vim-one'
 41Plug 'morhetz/gruvbox'
 42
 43call plug#end()
 44
 45" setup
 46
 47" visual
 48syntax on
 49set ruler
 50set number
 51set title
 52set titlestring=nvim-%F
 53set t_Co=256
 54set cursorline
 55" colorscheme one
 56" set background=dark
 57
 58"Credit joshdick
 59"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
 60"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
 61"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
 62if (empty($TMUX))
 63  if (has("nvim"))
 64  "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
 65  let $NVIM_TUI_ENABLE_TRUE_COLOR=1
 66  endif
 67  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
 68  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
 69  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
 70  if (has("termguicolors"))
 71    set termguicolors
 72  endif
 73endif
 74
 75set background=dark " for the dark version
 76" set background=light " for the light version
 77" colorscheme one
 78colorscheme molokai
 79
 80if $COLORTERM == 'gnome-terminal'
 81  set term=gnome-256color
 82else
 83  if $TERM == 'xterm'
 84    set term=xterm-256color
 85  endif
 86endif
 87
 88set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
 89
 90" rainbow parentheses
 91let g:rbpt_colorpairs = [
 92    \ ['brown',       'RoyalBlue3'],
 93    \ ['Darkblue',    'SeaGreen3'],
 94    \ ['darkgray',    'DarkOrchid3'],
 95    \ ['darkgreen',   'firebrick3'],
 96    \ ['darkcyan',    'RoyalBlue3'],
 97    \ ['darkred',     'SeaGreen3'],
 98    \ ['darkmagenta', 'DarkOrchid3'],
 99    \ ['brown',       'firebrick3'],
100    \ ['gray',        'RoyalBlue3'],
101    \ ['black',       'SeaGreen3'],
102    \ ['darkmagenta', 'DarkOrchid3'],
103    \ ['Darkblue',    'firebrick3'],
104    \ ['darkgreen',   'RoyalBlue3'],
105    \ ['darkcyan',    'SeaGreen3'],
106    \ ['darkred',     'DarkOrchid3'],
107    \ ['red',         'firebrick3'],
108    \ ]
109let g:rbt_max = 16
110let g:rbpt_loadcmd_toggle = 0
111au VimEnter * RainbowParenthesesToggle
112au Syntax * RainbowParenthesesLoadRound
113au Syntax * RainbowParenthesesLoadSquare
114au Syntax * RainbowParenthesesLoadBraces
115
116" go
117let g:go_auto_sameids = 1
118
119" vim-airline
120"" let g:airline_theme = 'powerlineish'
121let g:airline_theme='one'
122let g:airline#extensions#syntastic#enabled = 1
123let g:airline#extensions#branch#enabled = 1
124let g:airline#extensions#tabline#enabled = 1
125let g:airline#extensions#tabline#buffer_nr_show = 1
126let g:airline#extensions#tagbar#enabled = 1
127let g:airline_skip_empty_sections = 1
128
129" abbreviations
130cnoreabbrev W! w!
131cnoreabbrev Q! q!
132cnoreabbrev Qall! qall!
133cnoreabbrev Wq wq
134cnoreabbrev Wa wa
135cnoreabbrev wQ wq
136cnoreabbrev WQ wq
137cnoreabbrev W w
138cnoreabbrev Q q
139cnoreabbrev Qall qall
140
141let g:deoplete#enable_at_startup = 1
142let g:srcery_italic = 1
143
144" NERDTree
145let NERDTreeShowHidden=1
146autocmd vimenter * NERDTree
147map <C-n> :NERDTreeToggle<CR>
148
149" NERDCommenter
150let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
151let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
152let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
153
154"" Switching windows
155noremap <C-j> <C-w>j
156noremap <C-k> <C-w>k
157noremap <C-l> <C-w>l
158noremap <C-h> <C-w>h
159
160" scroll
161set scrolloff=5               " keep at least 5 lines above/below
162set sidescrolloff=5           " keep at least 5 lines left/right
163
164
165" syntastic
166let g:syntastic_always_populate_loc_list=1
167let g:syntastic_error_symbol='✗'
168let g:syntastic_warning_symbol='⚠'
169let g:syntastic_style_error_symbol = '✗'
170let g:syntastic_style_warning_symbol = '⚠'
171let g:syntastic_auto_loc_list=1
172let g:syntastic_aggregate_errors = 1
173
174"" go config
175
176function! s:build_go_files()
177  let l:file = expand('%')
178  if l:file =~# '^\f\+\.go$'
179    call go#cmd#Build(0)
180  endif
181endfunction
182
183
184let g:go_list_type = "quickfix"
185let g:go_fmt_command = "goimports"
186let g:go_fmt_fail_silently = 1
187let g:syntastic_go_checkers = ['golint', 'govet']
188let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
189
190let g:go_highlight_types = 1
191let g:go_highlight_fields = 1
192let g:go_highlight_functions = 1
193let g:go_highlight_methods = 1
194let g:go_highlight_operators = 1
195let g:go_highlight_build_constraints = 1
196let g:go_highlight_structs = 1
197let g:go_highlight_generate_tags = 1
198let g:go_highlight_space_tab_error = 0
199let g:go_highlight_array_whitespace_error = 0
200let g:go_highlight_trailing_whitespace_error = 0
201let g:go_highlight_extra_types = 1
202
203"" esc mapping
204inoremap jk <ESC>
205tnoremap jk <C-\><C-n>