arnaucube
arnaucube/configsPublic Self-hosted repository
configs/init.vim
init.vimRaw
  1source ~/.vimrc
  2
  3call plug#begin(expand('~/.config/nvim/plugged'))
  4
  5nnoremap <Space> <nop>
  6let mapleader = "\<Space>"
  7let g:mapleader = "\<Space>"
  8let maplocalleader =  "\<Space>"
  9
 10" nerdtree
 11Plug 'scrooloose/nerdtree'
 12Plug 'jistr/vim-nerdtree-tabs'
 13Plug 'scrooloose/nerdcommenter'
 14
 15" vim-airline
 16Plug 'vim-airline/vim-airline'
 17Plug 'vim-airline/vim-airline-themes'
 18
 19" vim-ripgrep
 20Plug 'jremmen/vim-ripgrep'
 21
 22Plug 'airblade/vim-gitgutter'
 23Plug 'Raimondi/delimitMate'
 24Plug 'majutsushi/tagbar'
 25
 26" rainbow parentheses
 27Plug 'luochen1990/rainbow'
 28
 29" go
 30Plug 'fatih/vim-go' " Amazing combination of features.
 31Plug 'godoctor/godoctor.vim' " Some refactoring tools
 32
 33" rust
 34Plug 'rust-lang/rust.vim'
 35" set hidden
 36let g:rustfmt_fail_silently = 0
 37let g:rustfmt_autosave = 1
 38
 39" javascript
 40Plug 'jelera/vim-javascript-syntax'
 41
 42" python
 43Plug 'davidhalter/jedi-vim'
 44Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
 45
 46" solidity
 47Plug 'tomlion/vim-solidity'
 48" circom
 49Plug 'iden3/vim-circom-syntax'
 50
 51" deoplete
 52Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
 53Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
 54" neosnippet with deoplete
 55Plug 'Shougo/neosnippet.vim'
 56Plug 'Shougo/neosnippet-snippets'
 57
 58" automatically adjust shiftwidth and expand tab based on current file
 59Plug 'tpope/vim-sleuth'
 60
 61let g:deoplete#enable_at_startup = 1
 62" Plugin deoplete neosnippet key-mappings.
 63" Note: It must be "imap" and "smap".  It uses <Plug> mappings.
 64imap <C-k>     <Plug>(neosnippet_expand_or_jump)
 65smap <C-k>     <Plug>(neosnippet_expand_or_jump)
 66xmap <C-k>     <Plug>(neosnippet_expand_target)
 67
 68
 69" errors
 70Plug 'Valloric/ListToggle'
 71Plug 'autozimu/LanguageClient-neovim', {
 72    \ 'branch': 'next',
 73    \ 'do': 'bash install.sh',
 74    \ }
 75
 76" focus mode
 77Plug 'junegunn/goyo.vim'
 78
 79" colors
 80Plug 'tomasr/molokai'
 81Plug 'srcery-colors/srcery-vim'
 82Plug 'rakr/vim-one'
 83Plug 'morhetz/gruvbox'
 84Plug 'NLKNguyen/papercolor-theme'
 85let g:srcery_italic = 1
 86
 87call plug#end()
 88
 89
 90"Credit joshdick
 91"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
 92"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
 93"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
 94if (empty($TMUX))
 95  if (has("nvim"))
 96  "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
 97  let $NVIM_TUI_ENABLE_TRUE_COLOR=1
 98  endif
 99  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
100  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
101  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
102  if (has("termguicolors"))
103    set termguicolors
104  endif
105endif
106
107if $COLORTERM == 'gnome-terminal'
108  set term=gnome-256color
109else
110  if $TERM == 'xterm'
111    set term=xterm-256color
112  endif
113endif
114
115set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
116
117
118" NERDTree
119let NERDTreeShowHidden=1
120autocmd vimenter * NERDTree
121map <C-n> :NERDTreeToggle<CR>
122" NERDCommenter
123let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
124let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
125let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
126
127
128" go
129let g:go_auto_sameids = 1
130
131"" go config
132function! s:build_go_files()
133  let l:file = expand('%')
134  if l:file =~# '^\f\+\.go$'
135    call go#cmd#Build(0)
136  endif
137endfunction
138
139
140let g:go_list_type = "quickfix"
141let g:go_fmt_command = "goimports"
142let g:go_fmt_fail_silently = 1
143let g:go_highlight_types = 1
144let g:go_highlight_fields = 1
145let g:go_highlight_functions = 1
146let g:go_highlight_methods = 1
147let g:go_highlight_operators = 1
148let g:go_highlight_build_constraints = 1
149let g:go_highlight_structs = 1
150let g:go_highlight_generate_tags = 1
151let g:go_highlight_space_tab_error = 0
152let g:go_highlight_array_whitespace_error = 0
153let g:go_highlight_trailing_whitespace_error = 0
154let g:go_highlight_extra_types = 1
155
156
157" vim-airline
158"" let g:airline_theme = 'powerlineish'
159let g:airline_theme='one'
160" let g:airline#extensions#syntastic#enabled = 1
161let g:airline#extensions#branch#enabled = 1
162let g:airline#extensions#tabline#enabled = 1
163let g:airline#extensions#tabline#buffer_nr_show = 1
164let g:airline#extensions#tagbar#enabled = 1
165let g:airline_skip_empty_sections = 1
166
167
168" errors
169"" for go needs gopls installed (comes with vim-go pluggin)
170"" for rust needs https://github.com/rust-lang/rls installed
171let g:lt_location_list_toggle_map = '<leader>l'
172let g:lt_quickfix_list_toggle_map = '<leader>s'
173let g:LanguageClient_serverCommands = {
174    \ 'go': ['~/go/bin/gopls'],
175    \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
176    \ }
177let g:LanguageClient_diagnosticsList = "Quickfix"
178let g:LanguageClient_diagnosticsEnable = 1
179
180" rainbowparentheses
181let g:rainbow_active = 1
182
183"" circom syntax
184au BufRead,BufNewFile *.circom set filetype=circom
185au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
186
187" for file watching
188set backupcopy=yes
189
190" shortcut for theme change
191nnoremap <F9> :colorscheme molokai \| set background=dark<CR>
192nnoremap <F10> :colorscheme PaperColor \| set background=light<CR>
193
194colorscheme molokai