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" LaTeX support. It needs latexmk & zathura
55Plug 'lervag/vimtex'
56
57"
58" " deoplete
59" Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
60" Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
61" " neosnippet with deoplete
62" Plug 'Shougo/neosnippet.vim'
63" Plug 'Shougo/neosnippet-snippets'
64
65" automatically adjust shiftwidth and expand tab based on current file
66Plug 'tpope/vim-sleuth'
67
68" let g:deoplete#enable_at_startup = 1
69" Plugin deoplete neosnippet key-mappings.
70" Note: It must be "imap" and "smap". It uses <Plug> mappings.
71imap <C-k> <Plug>(neosnippet_expand_or_jump)
72smap <C-k> <Plug>(neosnippet_expand_or_jump)
73xmap <C-k> <Plug>(neosnippet_expand_target)
74
75
76" errors
77Plug 'Valloric/ListToggle'
78Plug 'autozimu/LanguageClient-neovim', {
79 \ 'branch': 'next',
80 \ 'do': 'bash install.sh',
81 \ }
82
83" focus mode
84Plug 'junegunn/goyo.vim'
85
86" vimwiki
87Plug 'vimwiki/vimwiki'
88" vim calendar
89Plug 'mattn/calendar-vim'
90
91" colors
92Plug 'tomasr/molokai'
93Plug 'srcery-colors/srcery-vim'
94Plug 'rakr/vim-one'
95Plug 'morhetz/gruvbox'
96
97call plug#end()
98
99" next 3 lines are needed for vimwiki
100set nocompatible
101filetype plugin on
102syntax on
103" vimwiki with markdown
104let g:vimwiki_list = [{'path': '~/vimwiki/',
105 \ 'syntax': 'markdown', 'ext': '.md'}]
106" prevent vimwiki of setting conceallevel=2:
107let g:vimwiki_conceallevel=0
108
109let $NVIM_TUI_ENABLE_TRUE_COLOR=1
110set termguicolors
111
112if $COLORTERM == 'gnome-terminal'
113 set term=gnome-256color
114else
115 if $TERM == 'xterm'
116 set term=xterm-256color
117 endif
118endif
119
120set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
121
122
123" NERDTree
124let NERDTreeShowHidden=1
125autocmd vimenter * NERDTree
126map <C-n> :NERDTreeToggle<CR>
127" NERDCommenter
128let g:NERDSpaceDelims = 1 " Add spaces after comment delimiters by default
129let g:NERDDefaultAlign = 'left' " Align line-wise comment delimiters flush left instead of following code indentation
130let g:NERDCommentEmptyLines = 1 " Allow commenting and inverting empty lines (useful when commenting a region)
131
132
133"" go config
134function! s:build_go_files()
135 let l:file = expand('%')
136 if l:file =~# '^\f\+\.go$'
137 call go#cmd#Build(0)
138 endif
139endfunction
140
141
142let g:go_list_type = "quickfix"
143let g:go_fmt_command = "goimports"
144let g:go_fmt_fail_silently = 1
145let g:go_highlight_types = 1
146let g:go_highlight_fields = 1
147let g:go_highlight_functions = 1
148let g:go_highlight_methods = 1
149let g:go_highlight_operators = 1
150let g:go_highlight_build_constraints = 1
151let g:go_highlight_structs = 1
152let g:go_highlight_generate_tags = 1
153let g:go_highlight_space_tab_error = 0
154let g:go_highlight_array_whitespace_error = 0
155let g:go_highlight_trailing_whitespace_error = 0
156let g:go_highlight_extra_types = 1
157
158
159" vim-airline
160"" let g:airline_theme = 'powerlineish'
161let g:airline_theme='one'
162" let g:airline#extensions#syntastic#enabled = 1
163let g:airline#extensions#branch#enabled = 1
164let g:airline#extensions#tabline#enabled = 1
165let g:airline#extensions#tabline#buffer_nr_show = 1
166let g:airline#extensions#tagbar#enabled = 1
167let g:airline_skip_empty_sections = 1
168
169
170" errors
171"" for go needs gopls installed (comes with vim-go pluggin)
172"" for rust needs https://github.com/rust-lang/rls installed
173let g:lt_location_list_toggle_map = '<leader>l'
174let g:lt_quickfix_list_toggle_map = '<leader>s'
175let g:LanguageClient_serverCommands = {
176 \ 'go': ['~/go/bin/gopls'],
177 \ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
178 \ }
179let g:LanguageClient_diagnosticsList = "Quickfix"
180let g:LanguageClient_diagnosticsEnable = 1
181
182" language server key bindings
183nnoremap <F6> :call LanguageClient_contextMenu()<CR>
184" Specific mappings of LanguageClient each action separately
185nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
186nnoremap <silent> KK :call LanguageClient#textDocument_hover()<CR>
187nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
188nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
189
190noremap <silent> <C-c> :cn<CR>
191
192" rainbowparentheses
193let g:rainbow_active = 1
194
195"" circom syntax
196au BufRead,BufNewFile *.circom set filetype=circom
197au BufRead,BufNewFile *.circuit set filetype=go-snark-circuit
198
199"" LaTeX vimtex config:
200" Important: This config needs latexmk & zathura to be installed.
201"
202" This is necessary for VimTeX to load properly. The "indent" is optional.
203" Note that most plugin managers will do this automatically.
204filetype plugin indent on
205" This enables Vim's and neovim's syntax-related features. Without this, some
206" VimTeX features will not work (see ":help vimtex-requirements" for more
207" info).
208syntax enable
209" Viewer options: One may configure the viewer either by specifying a built-in
210" viewer method:
211let g:vimtex_view_method = 'zathura'
212
213"" sage syntax
214augroup filetypedetect
215 au! BufRead,BufNewFile *.sage,*.spyx,*.pyx setfiletype python
216augroup END
217
218" for file watching
219set backupcopy=yes
220
221" copy&paste from system clipboard
222vnoremap <leader>y "+y
223vnoremap <leader>p "+p
224
225" shortcut for theme change
226nnoremap <F9> :colorscheme gruvbox \| set background=dark \| highlight normal ctermbg=0 guibg=#000000 <CR>
227nnoremap <F10> :colorscheme gruvbox \| set background=light<CR>
228
229" colorscheme
230let g:gruvbox_contrast_dark = 'hard'
231let g:gruvbox_contrast_light = 'hard'
232let g:srcery_italic = 1
233
234set colorcolumn=100
235" set textwidth=80
236
237set background=dark
238
239" colorscheme molokai
240colorscheme gruvbox
241
242highlight normal ctermbg=0 guibg=#000000