-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·236 lines (191 loc) · 6.42 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
set nocompatible " improved !
let g:python3_host_prog = '/usr/bin/python3.9'
"
" Vim-Plug {{{1
" Auto install plug if it's not present
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.local/share/nvim/plugged')
" Plug 'arcticicestudio/nord-vim'
Plug 'matael/nord-vim'
let g:nord_comment_brightness = 18
let g:nord_uniform_status_lines = 1
let g:nord_italic_comments = 1
let g:nord_italic = 1
let g:nord_underline = 1
let g:nord_cursor_line_number_background = 1
Plug 'vim-airline/vim-airline' | Plug 'vim-airline/vim-airline-themes'
let g:airline_theme = 'nord'
let g:airline#extensions#tabline#enabled = 1
Plug 'ctrlpvim/ctrlp.vim'
let g:ctrlp_cmd = 'CtrlPMixed'
Plug 'tpope/vim-dispatch'
Plug 'rhysd/unite.vim'
Plug 'matze/vim-move'
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeTabsToggle'}
Plug 'Xuyuanp/nerdtree-git-plugin', {'on': 'NERDTreeTabsToggle'}
Plug 'jistr/vim-nerdtree-tabs', {'on': 'NERDTreeTabsToggle'}
Plug 'matael/tagbar', {'on': 'TagbarToggle'}
Plug 'mbbill/undotree', {'on': 'UndotreeToggle'}
Plug 'bronson/vim-trailing-whitespace'
Plug 'tpope/vim-surround'
Plug 'Raimondi/delimitMate'
Plug 'tomtom/tcomment_vim'
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'Matael/vim-template'
Plug 'junegunn/goyo.vim', {'for': ['tex', 'rst', 'markdown', 'latex']}
let g:goyo_width = 90
Plug 'rhysd/vim-grammarous', {'for': ['tex', 'rst', 'markdown', 'latex']}
let g:grammarous#use_vim_spelllang = 1
let g:grammarous#show_first_error = 1
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
let g:ycm_global_ycm_extra_conf = '~/useful/dotfiles/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf = 0
Plug 'tpope/vim-fugitive'
Plug 'mhinz/vim-signify'
let g:signify_vcs_list = ['git']
Plug 'Konfekt/FastFold' | Plug 'tmhedberg/SimpylFold'
Plug 'djoshea/vim-matlab-fold', {'for': 'matlab'}
Plug 'Matael/tex-conceal.vim', {'for': ['tex', 'latex']}
set conceallevel=2
let g:tex_conceal="abdgm"
Plug 'matze/vim-tex-fold', {'for': ['tex', 'latex']}
let g:tex_fold_additional_envs = ['tikzpicture', 'tabular']
Plug 'holomorph/vim-freefem', {'for': ['edp']}
Plug 'sirtaj/vim-openscad', {'for': ['scad']}
Plug 'sheerun/vim-polyglot'
Plug 'nvie/vim-flake8', {'for': 'python', 'on': 'Flake8'}
Plug 'kkoomen/vim-doge', {'for': ['python', 'cpp']}
let g:doge_doc_standard_python = 'numpy'
let g:doge_mapping_comment_jump_forward = '<C-s>'
let g:doge_mapping_comment_jump_backward = '<Shift><C-s>'
Plug 'jupyter-vim/jupyter-vim'
let g:jupyter_mapkeys = 0
Plug 'luishdez/vim-less', {'for': ['less']}
" vim-tweaks
Plug 'Matael/vim-tweaks'
call plug#end()
" }}}
" GENERAL {{{1
let mapleader = "<space>" " leader
let maplocalleader = "!" " leader
set fillchars=vert:│ " that's a vertical box-drawing character
set ts=2 " tabs
set sw=2 " tabs
set noet
set autoindent " indentation
set smartindent " .... intelligente
set textwidth=90 " 90chars width
set laststatus=2
set foldmethod=marker
set foldcolumn=3
set nohlsearch
set splitbelow
set splitright
set timeout timeoutlen=1000 ttimeoutlen=100
set nu " general numbering
set undofile
set undodir=~/.vim/undodir
set mouse=
set nojoinspaces
set encoding=utf-8
set spelllang=en_gb
autocmd InsertEnter * :set number
autocmd InsertLeave * :set relativenumber
aug QFClose
au!
au WinEnter * if winnr('$') == 1 && getbufvar(winbufnr(winnr()), "&buftype") == "quickfix"|q|endif
aug END
" Binding file extensions and types {{{1
au BufNewFile,BufRead *.ino setf arduino
au BufNewFile,BufRead *.tex set ft=tex
" MAPPINGS {{{1
" awesome leader trick
map <space> <leader>
" never show help. never, ever.
nnoremap <F1> <nop>
inoremap <F1> <nop>
vnoremap <F1> <nop>
nnoremap Q <nop>
nnoremap K <nop>
vnoremap Q <nop>
vnoremap K <nop>
" invert lines
noremap <Leader>i ddp
" Remap hj to esc
inoremap hj <Esc>
" NERDTree
inoremap <F3> <Esc>:NERDTreeTabsToggle<cr>
nnoremap <F3> :NERDTreeTabsToggle<cr>
inoremap <F5> <Esc>:UndotreeToggle<cr>
nnoremap <F5> :UndotreeToggle<cr>
inoremap <F7> <Esc>:w<cr>:make<cr><cr>
nnoremap <F7> :w<cr>:make<cr><cr>
nnoremap <F9> :YcmCompleter FixIt<CR>
nnoremap <F8> <Plug>(grammarous-fixit)<CR>
inoremap <F10> <Esc>:TagbarToggle<cr>
nnoremap <F10> :TagbarToggle<cr>
vnoremap <F9> :'<,'>normal :YcmCompleter FixIt<CR>
" Fix whitespaces
"" entire file
noremap <leader>W :FixWhitespace<cr>
"" current line
noremap <leader>w V:FixWhitespace<cr>
" ultisnips
" let g:UltiSnipsExpandTrigger="<C-j>"
let g:UltiSnipsExpandTrigger="<C-z>"
let g:UltiSnipsJumpForwardTrigger="<C-s>"
" jupyter-vim
" Change to directory of current file
nnoremap <buffer> <silent> <localleader>h :JupyterCd %:p:h<CR>
" Send a selection of lines
nnoremap <buffer> <silent> <localleader>; :JupyterSendCell<CR>
nnoremap <buffer> <silent> <localleader>, :JupyterSendRange<CR>
vmap <buffer> <silent> <localleader>: <Plug>JupyterRunVisual
" Arrow keys {{{1
" Don't move around with arrows
noremap <up> <nop>
noremap <down> <nop>
noremap <left> <nop>
noremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap <silent><C-k> <C-w>k
nnoremap <silent><C-j> <C-w>j
nnoremap <silent><C-l> <C-w>l
nnoremap <silent><C-h> <C-w>h
inoremap <silent><Left> <Esc>:bp<CR>
inoremap <silent><Right> <Esc>:bn<CR>
nnoremap <silent><Left> :bp<CR>
nnoremap <silent><Right> :bn<CR>
inoremap <silent><Up> <Esc>gT
inoremap <silent><Down> <Esc>gt
nnoremap <silent><Up> gT
nnoremap <silent><Down> gt
" Colors {{{1
" set termguicolors
colorscheme nord
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
set background=dark
hi Error guifg=#ffffcd guibg=#ff0000 guisp=#306b8f gui=NONE ctermfg=230 ctermbg=196 cterm=NONE
hi Todo guifg=#ffffcd guibg=#00a2ff guisp=#306b8f gui=NONE ctermfg=230 ctermbg=38 cterm=NONE
hi! link Folded Operator
hi! link FoldColumn Operator
hi! link Conceal texString
augroup vimrc_todo
au!
au Syntax * syn match MyTodo /\v<(FIXME|fixme|FixMe|Fixme|NOTE|TODO|Todo|todo):?/
\ containedin=.*Comment,vimCommentTitle
au Syntax * syn match MyFlag /\v<(DEBUG|Debug|debug|important|IMPORTANT|Important):?/
\ containedin=.*Comment,vimCommentTitle
augroup END
hi def link MyTodo Todo
hi def link MyFlag Error
function! SynGroup()
let l:s = synID(line('.'), col('.'), 1)
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
endfun