summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vimrc169
1 files changed, 95 insertions, 74 deletions
diff --git a/.vimrc b/.vimrc
index 8714c6d..fe2d120 100644
--- a/.vimrc
+++ b/.vimrc
@@ -25,82 +25,15 @@ 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 <Tab> :NERDTreeToggle<CR>
-
-"""""""""""""""""""""""""""""""
-" Undotree settings
-"""""""""""""""""""""""""""""""
-
-" Toggle undotree with F5
-nmap <F5> :UndotreeToggle<CR>
-
-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 <C-c> "+yi<Esc>
vmap <C-x> "+c<Esc>
vmap <C-v> c<ESC>"+p<Esc>
imap <C-v> <ESC>"+pa
-map <C-a> ggVG
+map <C-a> ggVG
imap <C-z> <ESC>ui
+nmap <C-z> u
imap <C-r> <ESC><C-r>i
"imap <C-S-z> <C-r> An impossible dream
imap <C-s> <ESC>:w<CR>a
+
+" Use Ctrl + hjkl for navigation in insert mode
+inoremap <C-h> <Left>
+inoremap <C-j> <Down>
+inoremap <C-k> <Up>
+inoremap <C-l> <Right>
+
+" 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 <bar> q!
ca xa wa <bar> 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 <C-k> :tabn<CR>
-nnoremap <C-j> :tabp<CR>
+" Go between tabs with Ctrl+l (tab to the right) and Ctrl+h (tab to the left)
+nnoremap <C-l> :tabn<CR>
+nnoremap <C-h> :tabp<CR>
set number " Show line numbers to the left
@@ -195,6 +142,79 @@ endfunction
tmap <silent> <ScrollWheelUp> <c-w>:call EnterNormalMode()<CR>
+
+"""""""""""""""""""""""""""""""
+" 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 <Tab> :NERDTreeToggle<CR>
+let NERDTreeIgnore=['\.swp$', '\~$'] " Ignore file, ending with .swp and ~
+
+"""""""""""""""""""""""""""""""
+" Undotree settings
+"""""""""""""""""""""""""""""""
+
+" Toggle undotree with F5
+nmap <F5> :UndotreeToggle<CR>
+
+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 <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
+