From 92257e7bd497b57a3224df03b10a40c04e45bf0d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 24 Dec 2020 23:04:42 +0200 Subject: Moved vim settings to the (almost) top, added some new mappings, added new plugins --- .vimrc | 169 ++++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 95 insertions(+), 74 deletions(-) diff --git a/.vimrc b/.vimrc index 8714c6d..fe2d120 100644 --- a/.vimrc +++ b/.vimrc @@ -25,81 +25,14 @@ Plug 'dense-analysis/ale' " Syntax checker via LSP Plug 'ryanoasis/vim-devicons' " Icons on stuff like NERDTree Plug 'honza/vim-snippets' " Ready snippets for some langauges Plug 'pseewald/vim-anyfold' " Better folding +Plug 'editorconfig/editorconfig-vim' " Support for EditorConfig +Plug 'tpope/vim-eunuch' " Easy UNIX shell commands +Plug 'mg979/vim-visual-multi' " Multiple line cursor (and other stuff) """""""""""""""""""""""""""""""" call plug#end() -""""""""""""""""""""""""""""""" -" Color scheme settings -""""""""""""""""""""""""""""""" - -colorscheme gruvbox -set background=dark " Setting dark mode -let g:gruvbox_contrast_dark='medium' - -""""""""""""""""""""""""""""""" -" NERDTree settings -""""""""""""""""""""""""""""""" - -let NERDTreeCustomOpenArgs={'file':{'where': 't'}} " Open file in new tab, doesn't work only for double-click -let NERDTreeShowHidden=1 -" Toggle NERDTree with Tab -nmap :NERDTreeToggle - -""""""""""""""""""""""""""""""" -" Undotree settings -""""""""""""""""""""""""""""""" - -" Toggle undotree with F5 -nmap :UndotreeToggle - -if !exists('g:undotree_WindowLayout') - let g:undotree_WindowLayout = 2 -endif - -" e.g. using 'd' instead of 'days' to save some space. -if !exists('g:undotree_ShortIndicators') - let g:undotree_ShortIndicators = 1 -endif - -" if set, let undotree window get focus after being opened, otherwise -" focus will stay in current window. -if !exists('g:undotree_SetFocusWhenToggle') - let g:undotree_SetFocusWhenToggle = 1 -endif - -" tree node shape. -if !exists('g:undotree_TreeNodeShape') - let g:undotree_TreeNodeShape = '*' -endif - -if !exists('g:undotree_DiffCommand') - let g:undotree_DiffCommand = "diff" -endif - -""""""""""""""""""""""""""""""" -" Syntastic settings -""""""""""""""""""""""""""""""" - -set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} -set statusline+=%* - -let g:syntastic_always_populate_loc_list=1 -let g:syntastic_auto_loc_list=1 -let g:syntastic_check_on_open=1 -let g:syntastic_check_on_wq=0 - -""""""""""""""""""""""""""""""" -" Vim-anyfold settings -""""""""""""""""""""""""""""""" - -filetype plugin indent on -syntax on -autocmd Filetype * AnyFoldActivate " activate for all filetypes -set foldlevel=99 " Open all folds by default - """"""""""""""""""""""""""""""" " Vim settings """"""""""""""""""""""""""""""" @@ -126,22 +59,36 @@ vmap "+yi vmap "+c vmap c"+p imap "+pa -map ggVG +map ggVG imap ui +nmap u imap i "imap An impossible dream imap :wa + +" Use Ctrl + hjkl for navigation in insert mode +inoremap +inoremap +inoremap +inoremap + +" Cyrilic (Bulgarian yawerty layout) support +ca в w +ca ва wa +ca ь x +ca ьа xa " The following work the same as usual (as :x and :xa), but can also close running jobs (e.g. terminal windows) ca x w q! ca xa wa qa! +" Open a terminal vim tab with tt and open a blank tab with te ca tt tab ter ca te tabe -" Go between tabs with Ctrl+k (tab to the right) and Ctrl+j (tab to the left) -nnoremap :tabn -nnoremap :tabp +" Go between tabs with Ctrl+l (tab to the right) and Ctrl+h (tab to the left) +nnoremap :tabn +nnoremap :tabp set number " Show line numbers to the left @@ -195,6 +142,79 @@ endfunction tmap :call EnterNormalMode() + +""""""""""""""""""""""""""""""" +" Color scheme settings +""""""""""""""""""""""""""""""" + +colorscheme gruvbox +set background=dark " Setting dark mode +let g:gruvbox_contrast_dark='medium' + +""""""""""""""""""""""""""""""" +" NERDTree settings +""""""""""""""""""""""""""""""" + +let NERDTreeCustomOpenArgs={'file':{'where': 't'}} " Open file in new tab, doesn't work only for double-click +let NERDTreeShowHidden=1 +" Toggle NERDTree with Tab +nmap :NERDTreeToggle +let NERDTreeIgnore=['\.swp$', '\~$'] " Ignore file, ending with .swp and ~ + +""""""""""""""""""""""""""""""" +" Undotree settings +""""""""""""""""""""""""""""""" + +" Toggle undotree with F5 +nmap :UndotreeToggle + +if !exists('g:undotree_WindowLayout') + let g:undotree_WindowLayout = 2 +endif + +" e.g. using 'd' instead of 'days' to save some space. +if !exists('g:undotree_ShortIndicators') + let g:undotree_ShortIndicators = 1 +endif + +" if set, let undotree window get focus after being opened, otherwise +" focus will stay in current window. +if !exists('g:undotree_SetFocusWhenToggle') + let g:undotree_SetFocusWhenToggle = 1 +endif + +" tree node shape. +if !exists('g:undotree_TreeNodeShape') + let g:undotree_TreeNodeShape = '*' +endif + +if !exists('g:undotree_DiffCommand') + let g:undotree_DiffCommand = "diff" +endif + +""""""""""""""""""""""""""""""" +" Syntastic settings +""""""""""""""""""""""""""""""" + +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%* + +let g:syntastic_always_populate_loc_list=1 +let g:syntastic_auto_loc_list=1 +let g:syntastic_check_on_open=1 +let g:syntastic_check_on_wq=0 + +""""""""""""""""""""""""""""""" +" Vim-anyfold settings +""""""""""""""""""""""""""""""" + +filetype plugin indent on +syntax on +autocmd Filetype * AnyFoldActivate " activate for all filetypes +set foldlevel=99 " Open all folds by default + + """"""""""""""""""""""""""""""" " Lighline settings """"""""""""""""""""""""""""""" @@ -474,3 +494,4 @@ nnoremap k :CocPrev " Resume latest coc list. nnoremap p :CocListResume + -- cgit v1.2.3