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