diff options
author | Max Christian Pohle | 2017-08-20 14:09:25 +0200 |
---|---|---|
committer | Max Christian Pohle | 2017-08-20 14:09:25 +0200 |
commit | faa32035b41f6d6016ddf22cf71e47336be42090 (patch) | |
tree | 8c797293d38b94e0580d5c3dbe3a40d42d47c6ea /vimrc-full | |
parent | 7c85511b5182c166236d8502596fc07072cb5b2a (diff) | |
download | vim-faa32035b41f6d6016ddf22cf71e47336be42090.tar.bz2 vim-faa32035b41f6d6016ddf22cf71e47336be42090.zip |
huge refactoring
Diffstat (limited to 'vimrc-full')
-rw-r--r-- | vimrc-full | 206 |
1 files changed, 86 insertions, 120 deletions
@@ -128,7 +128,7 @@ if has("gui_running") | |||
128 | set guioptions+=m | " remove menu | 128 | set guioptions+=m | " remove menu |
129 | set guioptions-=e | " do not display tabs | 129 | set guioptions-=e | " do not display tabs |
130 | set guioptions-=L | " do not show left scrollbar | 130 | set guioptions-=L | " do not show left scrollbar |
131 | set guioptions-=r | " do not show right scrollbar | 131 | set guioptions+=r | " do not show right scrollbar |
132 | set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) | 132 | set winaltkeys=menu | " behave like other windows: ALT-key can be used to open the menu (and cannot be :remaped) |
133 | " set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END | 133 | " set selectmode=mouse,key,cmd | " enters vim's select mode when pressing shift-left or shift-END |
134 | " set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text | 134 | " set keymodel=startsel,stopsel | " makes shift-left, shift-right available for selecting text |
@@ -136,7 +136,7 @@ if has("gui_running") | |||
136 | 136 | ||
137 | " its possible to define alternative fonts (order matters) | 137 | " its possible to define alternative fonts (order matters) |
138 | set guifont= | 138 | set guifont= |
139 | set guifont+=Droid\ Sans\ Mono\ for\ Powerline | 139 | set guifont+=Droid\ Sans\ Mono\ for\ Powerline\ 10 |
140 | set guifont+=Source\ Code\ Pro\ for\ Powerline\ SemiBold\ 10 | 140 | set guifont+=Source\ Code\ Pro\ for\ Powerline\ SemiBold\ 10 |
141 | set guifont+=Dejavu\ Sans\ Mono\ for\ Powerline\ Semibold | 141 | set guifont+=Dejavu\ Sans\ Mono\ for\ Powerline\ Semibold |
142 | set guifont+=Meslo\ LG\ M\ for\ Powerline\ 10 | 142 | set guifont+=Meslo\ LG\ M\ for\ Powerline\ 10 |
@@ -182,8 +182,6 @@ set nowrap | " but do not (by default) wrap long lines around | |||
182 | set number | " turn line numbers on/off (performance decreases when they are shown) | 182 | set number | " turn line numbers on/off (performance decreases when they are shown) |
183 | set pumheight=8 | " Determines the maximum number of items to show in the popup menu for | 183 | set pumheight=8 | " Determines the maximum number of items to show in the popup menu for |
184 | set path+=** | " allow recursive searches for files | 184 | set path+=** | " allow recursive searches for files |
185 | " set restorescreen | " restores the console after exiting vim | ||
186 | " set shada+=n~/.vim/shada | " shada file to use | ||
187 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge | 185 | set scrolljump=5 | " how many lines get scrolled into view when cursor reaches the screens edge |
188 | set scrolloff=3 | " keeps cursor centered | 186 | set scrolloff=3 | " keeps cursor centered |
189 | set splitbelow | " open new windows below the current one (i find that more intuitive) | 187 | set splitbelow | " open new windows below the current one (i find that more intuitive) |
@@ -208,20 +206,13 @@ set equalalways | " do not evenly size windows when opening new or | |||
208 | set nocursorline | " turn visual cursor line off (improves performance) | 206 | set nocursorline | " turn visual cursor line off (improves performance) |
209 | "======================================================================================================================= | 207 | "======================================================================================================================= |
210 | 208 | ||
211 | if has('autocmd') | ||
212 | " autocmd VimEnter * let &t_EI .= "\<Esc>[0 q" | ||
213 | " autocmd VimEnter * let &t_SI = "\<Esc>]12;green\x7" | ||
214 | autocmd VimLeave * silent !echo -ne "\033]112\007" | ||
215 | endif | ||
216 | |||
217 | |||
218 | |||
219 | " NEOVIM_incompatible: | 209 | " NEOVIM_incompatible: |
220 | " | 210 | " |
221 | if has('nvim') " Neovim? | 211 | if has('nvim') " Neovim? |
222 | autocmd TermOpen term://* set nobuflisted | 212 | autocmd TermOpen term://* set nobuflisted |
223 | " use default ESC key to leave insert mode in the internal terminal emulator | 213 | " use default ESC key to leave insert mode in the internal terminal emulator |
224 | tnoremap <Esc> <C-\><C-n> | 214 | tnoremap <Esc> <C-\><C-n> |
215 | " set shada+=n~/.vim/shada | " shada file to use | ||
225 | else " default Vim? | 216 | else " default Vim? |
226 | autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") | 217 | autocmd VimLeave * call system("echo -n $'" . escape(getreg(), "'") . "' | xsel -ib") |
227 | 218 | ||
@@ -230,6 +221,7 @@ else " default Vim? | |||
230 | set ttyfast | " improves speed for terminal vim (incomp. with nvim) | 221 | set ttyfast | " improves speed for terminal vim (incomp. with nvim) |
231 | set nottybuiltin | " use external termcaps | 222 | set nottybuiltin | " use external termcaps |
232 | " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incomp. with nvim | 223 | " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incomp. with nvim |
224 | set restorescreen | " restores the console after exiting vim (intentionally not in nvim) | ||
233 | " | 225 | " |
234 | let g:loaded_ruby_provider = 1 " disable ruby support | 226 | let g:loaded_ruby_provider = 1 " disable ruby support |
235 | let g:loaded_python_provider = 1 " disable pthon3 | 227 | let g:loaded_python_provider = 1 " disable pthon3 |
@@ -245,18 +237,6 @@ if has("autocmd") | |||
245 | " set default completion function in case YouCompleteMe cannot help | 237 | " set default completion function in case YouCompleteMe cannot help |
246 | set omnifunc=syntaxcomplete#Complete | 238 | set omnifunc=syntaxcomplete#Complete |
247 | 239 | ||
248 | " automatically reload this file when it gets edited | ||
249 | if !exists("*OnConfigChange") | ||
250 | function OnConfigChange() | ||
251 | autocmd! |" Remove all vimrc autocommands | ||
252 | source $MYVIMRC | ||
253 | exec lightline#colorscheme() | ||
254 | exec lightline#update() | ||
255 | " AirlineRefresh | ||
256 | endfunction | ||
257 | autocmd BufWritePost $MYVIMRC call OnConfigChange() | ||
258 | endif | ||
259 | |||
260 | augroup set_window_title " { | 240 | augroup set_window_title " { |
261 | " autocmd BufWinEnter quickfix setl statusline=%t | 241 | " autocmd BufWinEnter quickfix setl statusline=%t |
262 | " autocmd BufEnter * let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" | 242 | " autocmd BufEnter * let &titlestring = hostname() . "[vim(" . expand("%:t") . ")]" |
@@ -275,6 +255,35 @@ if has("autocmd") | |||
275 | endif | 255 | endif |
276 | augroup END | 256 | augroup END |
277 | 257 | ||
258 | augroup ChangeIcon | ||
259 | "if filereadable("/usr/bin/xseticon") | ||
260 | "if filereadable("~/.vim/nvim.png") | ||
261 | " autocmd VimEnter * silent :execute "!xseticon -id $WINDOWID ~/.vim/nvim.png" | ||
262 | " autocmd VimLeave * silent :execute "!xseticon -id $WINDOWID /usr/share/icons/gnome/32x32/apps/xfce-terminal.png" | ||
263 | "endif | ||
264 | "endif | ||
265 | augroup END | ||
266 | |||
267 | " Fix terminal title ================================================================================================= | ||
268 | " autocmd VimEnter * let &t_EI .= "\<Esc>[0 q" | ||
269 | " autocmd VimEnter * let &t_SI = "\<Esc>]12;green\x7" | ||
270 | autocmd VimLeave * silent !echo -ne "\033]112\007" | ||
271 | |||
272 | " highlight word under the cursor ==================================================================================== | ||
273 | let w:m1 = 0 | ||
274 | function! HighlightWordUnderCursor() | ||
275 | if(exists('w:m1') && w:m1 > 0) | ||
276 | silent! call matchdelete(w:m1) | ||
277 | let w:m1 = 0 | ||
278 | endif | ||
279 | let l:currentword = escape(expand('<cword>'), '.') | ||
280 | if(strlen(l:currentword) > 0) | ||
281 | let w:m1=100 | ||
282 | silent! call matchadd('BoldItalic', '\<'.l:currentword.'\>', -1, w:m1) | ||
283 | endif | ||
284 | endfunction | ||
285 | autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor() | ||
286 | |||
278 | " hitting K over a keyword shows a help in a buffer. | 287 | " hitting K over a keyword shows a help in a buffer. |
279 | " Here we define the commands used to look those keywords up | 288 | " Here we define the commands used to look those keywords up |
280 | " as per file type... | 289 | " as per file type... |
@@ -292,6 +301,7 @@ if has("autocmd") | |||
292 | " Alt-Up : Move cursor up one tag | 301 | " Alt-Up : Move cursor up one tag |
293 | " Alt-Down: Move cursor down one tag | 302 | " Alt-Down: Move cursor down one tag |
294 | " leader-=: tidies currently selected tag and subtags and sorts attributes by name (alphabetically) | 303 | " leader-=: tidies currently selected tag and subtags and sorts attributes by name (alphabetically) |
304 | autocmd Filetype html,markdown,xml iabbrev </ </<C-X><C-O> | ||
295 | autocmd Filetype html,htmldjango,xml | 305 | autocmd Filetype html,htmldjango,xml |
296 | \ :nnoremap | 306 | \ :nnoremap |
297 | \ <M-Down> | 307 | \ <M-Down> |
@@ -304,15 +314,6 @@ if has("autocmd") | |||
304 | \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat= | 314 | \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat= |
305 | augroup END | 315 | augroup END |
306 | 316 | ||
307 | augroup ChangeIcon | ||
308 | "if filereadable("/usr/bin/xseticon") | ||
309 | "if filereadable("~/.vim/nvim.png") | ||
310 | " autocmd VimEnter * silent :execute "!xseticon -id $WINDOWID ~/.vim/nvim.png" | ||
311 | " autocmd VimLeave * silent :execute "!xseticon -id $WINDOWID /usr/share/icons/gnome/32x32/apps/xfce-terminal.png" | ||
312 | "endif | ||
313 | "endif | ||
314 | augroup END | ||
315 | |||
316 | " autocmd BufNewFile set nobuflisted | 317 | " autocmd BufNewFile set nobuflisted |
317 | " use the shada/viminfo file to return the cursor to where it was... | 318 | " use the shada/viminfo file to return the cursor to where it was... |
318 | function! ReturnCursor() | 319 | function! ReturnCursor() |
@@ -347,23 +348,13 @@ if has("autocmd") | |||
347 | endif | 348 | endif |
348 | endfunction | 349 | endfunction |
349 | 350 | ||
351 | nmap <script> <silent> <F2> :call QFixToggle(0)<CR> | ||
350 | nmap <script> <silent> <F3> :call ToggleQuickFix()<CR> | 352 | nmap <script> <silent> <F3> :call ToggleQuickFix()<CR> |
351 | nmap <script> <silent> <F4> :call QFixToggle(0)<CR> | ||
352 | augroup END | 353 | augroup END |
353 | 354 | ||
354 | |||
355 | augroup extra_whitespace " { | ||
356 | highlight ExtraWhitespace ctermbg=red ctermfg=white guibg=red | ||
357 | " autocmd BufEnter * syn match ExtraWhitespace /\s\+$/ | ||
358 | " autocmd BufEnter * match ExtraWhitespace /\s\+$/ | ||
359 | augroup END "} | ||
360 | |||
361 | augroup CurrentFileName | 355 | augroup CurrentFileName |
362 | highlight CurrentFileName ctermbg=yellow guibg=yellow | ||
363 | |||
364 | |||
365 | " highlight the current files name inside the document... | 356 | " highlight the current files name inside the document... |
366 | let @g = ":exe ':match CurrentFileName /'.escape(expand('%:t'), '.').'/'" | 357 | let @g = ":exe ':match IncSearch /'.escape(expand('%:t'), '.').'/'" |
367 | " put the current files name after the cursor... | 358 | " put the current files name after the cursor... |
368 | let @f = ":exe ':normal a'.expand('%:t')" | 359 | let @f = ":exe ':normal a'.expand('%:t')" |
369 | 360 | ||
@@ -372,8 +363,6 @@ if has("autocmd") | |||
372 | 363 | ||
373 | let @l = ":let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}|:SignifyRefresh" | 364 | let @l = ":let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}|:SignifyRefresh" |
374 | 365 | ||
375 | |||
376 | |||
377 | if has('menu') | 366 | if has('menu') |
378 | source $VIMRUNTIME/menu.vim | 367 | source $VIMRUNTIME/menu.vim |
379 | set wildmenu | 368 | set wildmenu |
@@ -395,7 +384,7 @@ if has("autocmd") | |||
395 | 384 | ||
396 | menu &Verify.&Textwidth\ and\ white\ space | 385 | menu &Verify.&Textwidth\ and\ white\ space |
397 | \ :execute ':match ColorColumn /\%>'.&textwidth.'v./'<CR> | 386 | \ :execute ':match ColorColumn /\%>'.&textwidth.'v./'<CR> |
398 | \ :2match ExtraWhitespace /\s\+$/<CR> | 387 | \ :2match IncSearch /\s\+$/<CR> |
399 | 388 | ||
400 | menu &Verify.Highlight\ current\ file\ name | 389 | menu &Verify.Highlight\ current\ file\ name |
401 | \ :execute ':match ColorColumn /'.escape(expand('%:t'), '.').'/'<CR> | 390 | \ :execute ':match ColorColumn /'.escape(expand('%:t'), '.').'/'<CR> |
@@ -410,9 +399,12 @@ if has("autocmd") | |||
410 | menu &Window.Scratch | 399 | menu &Window.Scratch |
411 | \ :Scratch<CR> | 400 | \ :Scratch<CR> |
412 | 401 | ||
413 | menu &Go.file\ under\ the\ cursor<Tab>:gf | 402 | menu &Find.file\ under\ the\ cursor<Tab>:gf |
414 | \ gf | 403 | \ gf |
415 | 404 | ||
405 | |||
406 | " menu &Find.Open\ search\ results\ in\ location\ list<Tab>:gf | ||
407 | " \ :vimgrep /<C-R>\//g % | copen | ||
416 | endif | 408 | endif |
417 | 409 | ||
418 | 410 | ||
@@ -475,36 +467,23 @@ endif | |||
475 | 467 | ||
476 | 468 | ||
477 | 469 | ||
470 | " ====================================================================================================================== | ||
478 | " START: LOADING PLUGINS | 471 | " START: LOADING PLUGINS |
479 | " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ | 472 | " ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ |
480 | call plug#begin() | 473 | call plug#begin() |
474 | " Colorschemes: | ||
475 | Plug 'chriskempson/base16-vim' | " not just one high quality color scheme (all named base16-*) | ||
481 | 476 | ||
482 | Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' | 477 | Plug 'mhinz/vim-signify' | " uses the sign column to indicate added, modified and removed lines |
483 | Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin | 478 | Plug 'tpope/vim-fugitive' | " the most complete GIT integration plugin |
484 | Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= | 479 | Plug 'godlygeek/tabular' | " align code on a sign, like :Tab/= |
485 | Plug 'mhinz/vim-signify' | " uses the sign column to indicate added, modified and removed lines | 480 | Plug 'tpope/vim-surround' | " plugin makes cs"' inside a line replace " with ' |
486 | let g:signify_vcs_list = [ 'git' ] | " use signify only with git (improves speed when loading buffers, see :h signify) | 481 | let g:signify_vcs_list = [ 'git' ] | " use signify only with git (improves speed when loading buffers, see :h signify) |
487 | let g:signify_cursorhold_insert = 1 | 482 | let g:signify_cursorhold_insert = 1 |
488 | let g:signify_cursorhold_normal = 1 | 483 | let g:signify_cursorhold_normal = 1 |
489 | let g:signify_update_on_bufenter = 0 | 484 | let g:signify_update_on_bufenter = 0 |
490 | let g:signify_update_on_focusgained = 1 | 485 | let g:signify_update_on_focusgained = 1 |
491 | 486 | ||
492 | " TESTING: | " plugins which I am currently trying... | ||
493 | " Plug 'rkitover/vimpager' | ||
494 | " found this command instead (use as PAGER): | ||
495 | " man -P 'nvim -R -u NORC -c":%!col -b" -c":set buftype=nowrite filetype=man" -' ls | ||
496 | " | ||
497 | " Plug 'Shougo/neocomplete.vim' | " alternative to YouCompleteMe in some cases | ||
498 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | ||
499 | |||
500 | " Colorschemes: | ||
501 | Plug 'chriskempson/base16-vim' | " not just one high quality color scheme (all named base16-*) | ||
502 | " Plug 'ryanoasis/vim-devicons' | " eye candy icons | ||
503 | |||
504 | " SCRATCH: | " Unobtrusive scratch window | ||
505 | Plug 'mtth/scratch.vim' | ||
506 | nnoremap <F2> :ScratchPreview<CR> | ||
507 | |||
508 | " BUFEXPLORER: | " a buffer to list all buffers has the advantage, that default /-searches work in there | 487 | " BUFEXPLORER: | " a buffer to list all buffers has the advantage, that default /-searches work in there |
509 | Plug 'jlanzarotta/bufexplorer' | 488 | Plug 'jlanzarotta/bufexplorer' |
510 | nnoremap <F12> :ToggleBufExplorer<CR> | 489 | nnoremap <F12> :ToggleBufExplorer<CR> |
@@ -519,24 +498,23 @@ let NERDTreeMinimalUI = 1 | |||
519 | let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) | 498 | let NERDTreeShowBookmarks = 1 | " show bookmarks by default (when opening for the first time) |
520 | let NERDTreeWinSize = 40 | 499 | let NERDTreeWinSize = 40 |
521 | 500 | ||
522 | |||
523 | " depending on if NERDTree has the focus: | 501 | " depending on if NERDTree has the focus: |
524 | nnoremap <expr> | 502 | nnoremap <expr> |
525 | \ <leader><leader> | 503 | \ <leader><leader> |
526 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose<CR>' : ':NERDTreeFind<CR>' | 504 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? ':NERDTreeClose<CR>' : ':NERDTreeFind<CR>' |
527 | nnoremap <expr> | 505 | nnoremap <expr> |
528 | \ <Tab> | 506 | \ <Tab> |
529 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bn<CR>' | 507 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bn<CR>' |
530 | nnoremap <expr> | 508 | nnoremap <expr> |
531 | \ <S-Tab> | 509 | \ <S-Tab> |
532 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bp<CR>' | 510 | \ bufwinnr("%")==g:NERDTree.GetWinNum() ? '<C-W><C-W>' : ':bp<CR>' |
533 | " close NERDTree if it is the last remaining window (taken from the official documentation) | 511 | " close NERDTree if it is the last remaining window (taken from the official documentation) |
534 | " autocmd bufenter * | 512 | " autocmd bufenter * |
535 | " \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | 513 | " \ if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif |
536 | " | 514 | " |
537 | 515 | ||
538 | " Additional: ========================================. | 516 | " Additional: ========================================. |
539 | Plug 'sheerun/vim-polyglot' " better syntax highlighting/indentation for multiple languages | 517 | Plug 'sheerun/vim-polyglot' " better syntax highlighting/indentation for multiple languages |
540 | let g:javascript_conceal_function = "ƒ" | 518 | let g:javascript_conceal_function = "ƒ" |
541 | let g:javascript_conceal_null = "ø" | 519 | let g:javascript_conceal_null = "ø" |
542 | let g:javascript_conceal_this = "@" | 520 | let g:javascript_conceal_this = "@" |
@@ -548,20 +526,19 @@ let g:javascript_conceal_static = "•" | |||
548 | let g:javascript_conceal_super = "Ω" | 526 | let g:javascript_conceal_super = "Ω" |
549 | let g:javascript_conceal_arrow_function = "⇒" | 527 | let g:javascript_conceal_arrow_function = "⇒" |
550 | 528 | ||
551 | Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more | 529 | Plug 'majutsushi/tagbar' " superseeds taglist-plus, which isn't maintained any more |
552 | let g:tagbar_autoclose = 0 | 530 | let g:tagbar_autoclose = 0 |
553 | let g:tagbar_autofocus = 1 | 531 | let g:tagbar_autofocus = 1 |
554 | let g:tagbar_autoshowtag = 0 | 532 | let g:tagbar_autoshowtag = 0 |
555 | let g:tagbar_compact = 1 | 533 | let g:tagbar_compact = 1 |
556 | let g:tagbar_indent = 0 | 534 | let g:tagbar_indent = 0 |
557 | let g:tagbar_foldlevel = 99 | 535 | let g:tagbar_foldlevel = 99 |
558 | nnoremap <leader>l :TagbarToggle<CR>| " bind TagBar to Hotkey Ctrl+L | 536 | |
559 | nnoremap <F9> :TagbarToggle<CR>| " also bind TagBar to Hotkey F9 | 537 | nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to hotkey F9 |
560 | 538 | ||
561 | 539 | ||
562 | " AIRLINE: a fancy status line ========================================================================================= | 540 | " LIGHTLINE: a fancy status line ======================================================================================= |
563 | set laststatus=2 | " required by AirLine, without status line does not appear until a window split | 541 | set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split |
564 | set background=light | ||
565 | 542 | ||
566 | Plug 'itchyny/lightline.vim' | 543 | Plug 'itchyny/lightline.vim' |
567 | Plug 'taohex/lightline-buffer' | 544 | Plug 'taohex/lightline-buffer' |
@@ -685,12 +662,6 @@ if has("python") | |||
685 | "let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \ | 662 | "let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'| " \ |
686 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary | 663 | "let g:UltiSnipsListSnippets = '<leader><leader>'| " YouCompleteMe includes those, so this isn't necessary |
687 | 664 | ||
688 | " Plug 'rhysd/vim-clang-format' | ||
689 | Plug 'kana/vim-operator-user' " dependency, which allows overriding the = operator for indentation | ||
690 | autocmd FileType c,cpp,objc map <buffer> = :pyf /usr/share/clang/clang-format.py<CR> | ||
691 | " let g:clang_format#detect_style_file = 1 | ||
692 | " autocmd FileType c,cpp,objc map <buffer> = <Plug>(operator-clang-format) | ||
693 | |||
694 | " JEDI: ============================================================================================================== | 665 | " JEDI: ============================================================================================================== |
695 | Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures | 666 | Plug 'davidhalter/jedi-vim' " jedi gets used to display python function signatures |
696 | let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe | 667 | let g:jedi#completions_enabled = 0 " we do not need completions, because we have YouCompleteMe |
@@ -703,6 +674,22 @@ if has("python") | |||
703 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' | 674 | " let g:syntastic_python_flake8_args='--ignore=F821,E302,E501,E241,E301' |
704 | endif | 675 | endif |
705 | 676 | ||
677 | "======================================================================================================================= | ||
678 | " TESTING: | " plugins which I am currently trying... | ||
679 | "======================================================================================================================= | ||
680 | " Plug 'rhysd/vim-clang-format' | unnecessary, because we can just :pyf /usr/share/clang/clang-format.py | ||
681 | Plug 'kana/vim-operator-user' " dependency, which allows overriding the = operator for indentation | ||
682 | autocmd FileType c,cpp,objc map <buffer> = :pyf /usr/share/clang/clang-format.py<CR> | ||
683 | " let g:clang_format#detect_style_file = 1 | ||
684 | " autocmd FileType c,cpp,objc map <buffer> = <Plug>(operator-clang-format) | ||
685 | |||
686 | " Plug 'tpope/vim-characterize' | " normal mode: make ga show character names of Unicode chars (ga shows hex and dec values) | ||
687 | " Plug 'rkitover/vimpager' | ||
688 | " found this command instead (use as PAGER): | ||
689 | " man -P 'nvim -R -u NORC -c":%!col -b" -c":set buftype=nowrite filetype=man" -' ls | ||
690 | |||
691 | |||
692 | "======================================================================================================================= | ||
706 | call plug#end() | " all plugins are getting loaded on this line, don't remove! | 693 | call plug#end() | " all plugins are getting loaded on this line, don't remove! |
707 | " ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ | 694 | " ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |
708 | " END: LOADING PLUGINS | 695 | " END: LOADING PLUGINS |
@@ -724,16 +711,17 @@ let g:netrw_winsize = 20 | " window size in percent | |||
724 | 711 | ||
725 | " ====================================================================================================================== | 712 | " ====================================================================================================================== |
726 | " COLORSCHEME: | 713 | " COLORSCHEME: |
727 | " uses the default terminal background color as background (allows transparency) | 714 | " ====================================================================================================================== |
715 | |||
728 | function! ExtendColorTheme() | 716 | function! ExtendColorTheme() |
729 | " let g:colors_name="" | ||
730 | " set background=light | ||
731 | filetype on | 717 | filetype on |
732 | filetype plugin on | 718 | filetype plugin on |
733 | filetype indent on | 719 | filetype indent on |
734 | 720 | ||
735 | syntax on | " enable syntax highlighting | 721 | syntax on | " enable syntax highlighting |
736 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) | 722 | syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) |
723 | |||
724 | " use the default terminal background color as background (allows transparency) | ||
737 | " highlight Normal ctermbg=NONE ctermfg=black | 725 | " highlight Normal ctermbg=NONE ctermfg=black |
738 | 726 | ||
739 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE | 727 | highlight! CursorLineNr cterm=inverse | " ctermbg=black ctermfg=NONE |
@@ -754,10 +742,16 @@ function! ExtendColorTheme() | |||
754 | highlight! TabLineSel ctermbg=blue ctermfg=black | 742 | highlight! TabLineSel ctermbg=blue ctermfg=black |
755 | highlight! link TabLineFill LineNr | 743 | highlight! link TabLineFill LineNr |
756 | highlight! Search ctermbg=12 ctermfg=0 | 744 | highlight! Search ctermbg=12 ctermfg=0 |
745 | |||
746 | " generic, which should exist but don't | ||
747 | highlight! Bold cterm=bold gui=bold | ||
757 | highlight! Italic cterm=italic gui=italic | 748 | highlight! Italic cterm=italic gui=italic |
749 | highlight! Underline cterm=underline gui=underline | ||
750 | highlight! BoldItalic cterm=Bold,Italic gui=Bold,Italic | ||
758 | endfunction | 751 | endfunction |
759 | autocmd! ColorScheme * call ExtendColorTheme() | 752 | autocmd! ColorScheme * call ExtendColorTheme() |
760 | 753 | ||
754 | set background=dark | " critical: should be set by the colorscheme, but often is not or gets used by it | ||
761 | 755 | ||
762 | if filereadable(expand("~/.config/base16-shell/colortest")) | 756 | if filereadable(expand("~/.config/base16-shell/colortest")) |
763 | let g:base16_shell_path="~/.config/base16-shell/scripts" | 757 | let g:base16_shell_path="~/.config/base16-shell/scripts" |
@@ -772,37 +766,9 @@ endif | |||
772 | 766 | ||
773 | 767 | ||
774 | " ====================================================================================================================== | 768 | " ====================================================================================================================== |
775 | let w:m1 = 0 | 769 | " TESTING: |
776 | highlight! BoldItalic cterm=Bold,Italic gui=Bold,Italic | 770 | " ====================================================================================================================== |
777 | function! HighlightWordUnderCursor() | ||
778 | if(exists('w:m1') && w:m1 > 0) | ||
779 | silent! call matchdelete(w:m1) | ||
780 | let w:m1 = 0 | ||
781 | endif | ||
782 | let l:currentword = escape(expand('<cword>'), '.') | ||
783 | if(strlen(l:currentword) > 0) | ||
784 | let w:m1=100 | ||
785 | silent! call matchadd('BoldItalic', '\<'.l:currentword.'\>', -1, w:m1) | ||
786 | endif | ||
787 | endfunction | ||
788 | autocmd! CursorHold,CursorHoldI * call HighlightWordUnderCursor() | ||
789 | |||
790 | |||
791 | " avoids openin an empty buffer when restoring bufferlist from viminfo... | 771 | " avoids openin an empty buffer when restoring bufferlist from viminfo... |
792 | " if argc() == 0 | 772 | " if argc() == 0 |
793 | " autocmd VimEnter * nested :silent bun | 773 | " autocmd VimEnter * nested :silent bun |
794 | " endif | 774 | " endif |
795 | " au BufNewFile,BufRead,BufEnter *.cpp,*.hpp set omnifunc=omni#cpp#complete#Main | ||
796 | " Enable omni completion. | ||
797 | " autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS | ||
798 | " autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags | ||
799 | " auto complete closing tag name when entering </-[space] | ||
800 | " autocmd Filetype html,markdown,xml iabbrev </ </<C-X><C-O> | ||
801 | " autocmd FileType python setlocal omnifunc=jedi#completions | ||
802 | " following autocommands are there to call neovim functions... | ||
803 | " autocmd FileType python setlocal omnifunc=pythoncomplete#Complete | ||
804 | " autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS | ||
805 | " autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags | ||
806 | " | ||
807 | " | ||
808 | " set termguicolors | ||