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