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