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