-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
346 lines (296 loc) · 9.3 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
" set nocompatible
" filetype off
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim-plug bootstrap
call plug#begin('~/.config/nvim/plugged')
if !has('nvim')
Plug 'tpope/vim-sensible'
endif
""""""""""""""""""""""""""""
" theme
" Plug 'overcache/NeoSolarized'
" Plug 'romainl/flattened'
" Plug 'altercation/vim-colors-solarized'
Plug 'ishan9299/nvim-solarized-lua'
""""""""""""""""""""""""""""
" misc
Plug 'tpope/vim-dispatch'
Plug 'radenling/vim-dispatch-neovim'
Plug 'tpope/vim-dotenv'
Plug 'tpope/vim-obsession'
" Plug 'neomake/neomake'
Plug 'bfredl/nvim-miniyank'
" Plug 'romainl/vim-cool'
" Plug 'tmux-plugins/vim-tmux'
" Plug 'linktohack/vim-gfortran-compiler'
" Plug 'vhdirk/vim-cmake'
" Plug 'jalcine/cmake.vim' does not work
" Plug 'romainl/vim-qlist'
" Plug 'igankevich/mesonic'
"""""""""""""""""""""""""""""
" file system
" Plug 'ctrlpvim/ctrlp.vim'
" Plug 'FelikZ/ctrlp-py-matcher'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'justinmk/vim-dirvish'
" Plug 'tpope/vim-vinegar'
"""""""""""""""""""""""""""""
" commentaries
Plug 'tomtom/tcomment_vim'
" Plug 'tpope/vim-commentary'
"""""""""""""""""""""""""""""
" status line
Plug 'vim-airline/vim-airline' | Plug 'vim-airline/vim-airline-themes'
"""""""""""""""""""""""""""""
" snippets
" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'honza/vim-snippets'
"""""""""""""""""""""""""""""
" syntax
" " Plug 'dense-analysis/ale'
" " Plug 'hdima/python-syntax'
" " Plug 'gu-fan/riv.vim'
" Plug 'chase/vim-ansible-yaml'
" Plug 'vimjas/vim-python-pep8-indent'
" Plug 'honza/dockerfile.vim'
" Plug 'martinda/Jenkinsfile-vim-syntax'
" Plug 'cespare/vim-toml'
Plug 'sheerun/vim-polyglot'
Plug 'linkinpark342/xonsh-vim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
"""""""""""""""""""""""""""""
" editing
Plug 'wellle/targets.vim'
Plug 'tpope/vim-sleuth'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
" Plug 'justinmk/vim-sneak'
" Plug 'matze/vim-moveovercache
" Plug 'osyo-manga/vim-over'
" Plug 'LaTeX-Box-Team/LaTeX-Box'
"""""""""""""""""""""""""""""
" grepping
Plug 'mhinz/vim-grepper'
" Plug 'mileszs/ack.vim'
" Plug 'ervandew/ag'
"""""""""""""""""""""""""""""
" completion
" Plug 'ycm-core/YouCompleteMe'
" Plug 'rdnetto/YCM-Generator'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Plug 'stsewd/sphinx.nvim', { 'do': ':UpdateRemotePlugins' }
"""""""""""""""""""""""""""""
" code navigation
Plug 'majutsushi/tagbar'
Plug 'ludovicchabant/vim-gutentags'
" Plug 'bronson/vim-trailing-whitespace'
Plug 'MarcWeber/vim-addon-local-vimrc'
"""""""""""""""""""""""""""""
" testing
Plug 'vim-test/vim-test'
Plug '5long/pytest-vim-compiler'
call plug#end()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CoC.nvim
source ~/dotfiles/vimrc-coc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"colorscheme
if has("termguicolors")
set termguicolors
endif
colorscheme solarized
let g:solarized_italics = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Highlight the screen line of the cursor
set cursorline
set number
set hlsearch " switch on highlighting the last used search pattern.
" set ignorecase
" Use <C-L> to clear the highlighting of :set hlsearch.
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
endif
" Don't use Ex mode, use Q for formatting
map Q gq
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" python used
" let g:python_host_prog=0
" let g:python3_host_prog="/home/antoine.dechaume/.conda/envs/vim/bin/python"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" do not use history when leavy buffer
set hidden
" leader q to quit without saving
noremap <leader>q :quit<CR>
vnoremap <leader>q <C-C>:quit<CR>
inoremap <leader>q <Esc>:quit<CR>
" leader w to delete buffer
noremap <leader>w :bdelete<CR>
vnoremap <leader>w <C-C>:bdelete<CR>
inoremap <leader>w <Esc>:bdelete<CR>
" leader s to save
noremap <leader>s :update<CR>
vnoremap <leader>s <C-C>:update<CR>
inoremap <leader>s <Esc>:update<CR>
" inoremap jk <Esc>
" no arrow keys
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" line motion
" nnoremap <C-j> :m .+1<CR>==
" nnoremap <C-k> :m .-2<CR>==
" inoremap <C-j> <Esc>:m .+1<CR>==gi
" inoremap <C-k> <Esc>:m .-2<CR>==gi
" vnoremap <C-j> :m '>+1<CR>gv=gv
" vnoremap <C-k> :m '<-2<CR>gv=gv
" Source the vimrc file after saving it
au bufwritepost .vimrc source $MYVIMRC
" no automatic backup and no swapfile
set nobackup
set nowritebackup
set noswapfile
" exit insert mode
inoremap <C-c> <Esc>
" indentation
" set smartindent
set completeopt=menuone,longest,preview
" use OS clipboard
set clipboard^=unnamedplus
" set foldmethod=indent
set wildignore+=*.o,*.so,*.pyc,tags
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.tox/*
" center current line on screen
set scrolloff=1000
if exists('&inccommand')
set inccommand=split
endif
" no double space after . when reformating
set nojoinspaces
" autocmd FileType python setlocal textwidth=0
autocmd FileType python setlocal fo-=t
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" nvim
if has('nvim')
tnoremap <Esc> <C-\><C-n>
tnoremap <A-h> <C-\><C-n><C-w>h
tnoremap <A-j> <C-\><C-n><C-w>j
tnoremap <A-k> <C-\><C-n><C-w>k
tnoremap <A-l> <C-\><C-n><C-w>l
nnoremap <A-h> <C-w>h
nnoremap <A-j> <C-w>j
nnoremap <A-k> <C-w>k
nnoremap <A-l> <C-w>l
set guicursor=
" let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Grepper
nnoremap <leader>g :Grepper<cr>
nmap gs <plug>(GrepperOperator)
xmap gs <plug>(GrepperOperator)
let g:grepper = {}
" let g:grepper.prompt_mapping_tool = '<leader>g'
let g:grepper.tools = ['rg', 'grep', 'git']
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" fzf
nmap <leader>b :Buffer<CR>
nmap <leader>f :Files<CR>
" nmap <leader>g :GFiles<CR>
nmap <leader>t :Tags<CR>
nmap <leader>h :History<CR>
nmap <leader>c :Commands<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim-move
let g:move_key_modifier = 'C'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim-airline
let g:airline_left_sep = ''
let g:airline_right_sep = ''
" let g:airline_linecolumn_prefix = '¶ '
let g:airline#extensions#branch#symbol = '⎇ '
" let g:airline#extensions#paste#symbol = 'ρ'
" let g:airline#extensions#paste#symbol = 'Þ'
let g:airline#extensions#paste#symbol = '∥'
" let g:airline#extensions#whitespace#symbol = 'Ξ'
let g:airline#extensions#tabline#enabled = 1
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim-sneak
" map f <Plug>Sneak_f
" map F <Plug>Sneak_F
" map t <Plug>Sneak_t
" map T <Plug>Sneak_T
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" latex box
let g:LatexBox_quickfix = 2
let g:LatexBox_show_warnings = 0
let g:LatexBox_build_dir = './build'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ctags
set tags=./.tags;
nmap <F8> :TagbarToggle<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" gutentags
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" neomake
let g:neomake_open_list = 2
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" riv
set nofoldenable
let g:riv_disable_folding = 1
let g:riv_fold_auto_update = 0
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" dispatch
" nnoremap <leader>b :Dispatch<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" nvim-miniyank
map p <Plug>(miniyank-autoput)
map P <Plug>(miniyank-autoPut)
map <leader>p <Plug>(miniyank-cycle)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" coc-snippet.nvim
" inoremap <silent><expr> <TAB>
" \ pumvisible() ? coc#_select_confirm() :
" \ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
" \ <SID>check_back_space() ? "\<TAB>" :
" \ coc#refresh()
"
" function! s:check_back_space() abort
" let col = col('.') - 1
" return !col || getline('.')[col - 1] =~# '\s'
" endfunction
"
" let g:coc_snippet_next = '<tab>'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:sphinx_html_output_dirs = [
\ '_build/html', 'build/html',
\ 'doc',
\]
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" treesitter
lua << EOF
require'nvim-treesitter.configs'.setup {
-- Modules and its options go here
highlight = { enable = true },
incremental_selection = { enable = true },
textobjects = { enable = true },
}
EOF
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim-test
nmap <silent> <leader>Tn :TestNearest<CR>
nmap <silent> <leader>Tf :TestFile<CR>
nmap <silent> <leader>Ts :TestSuite<CR>
nmap <silent> <leader>Tl :TestLast<CR>
nmap <silent> <leader>Tv :TestVisit<CR>
let test#strategy = "neovim"