From 6ea45e425be52b92006e97e2caf315036542856d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 24 Feb 2023 22:39:05 +0200 Subject: [.vimrc] Huge overhaul, separating contents into different files --- .vim/startup/mappings.vim | 71 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .vim/startup/mappings.vim (limited to '.vim/startup/mappings.vim') diff --git a/.vim/startup/mappings.vim b/.vim/startup/mappings.vim new file mode 100644 index 0000000..4aec7f1 --- /dev/null +++ b/.vim/startup/mappings.vim @@ -0,0 +1,71 @@ +" Don't get into insert mode after adding a line with o/O +nnoremap o o +nnoremap O O + +" Ctrl-Backspace deletes the previous word in insert mode. +inoremap +inoremap + +" Ctrl+s; Ctrl+c, Ctrl+v, Ctrl+x; Ctrl+z, Ctrl+r; Ctrl+a bindings that work on GUI applications +" Partly taken from: https://gist.github.com/jshih/3423345 +imap :wa +nmap :w +"imap An impossible dream +vmap "+yi +vmap c"+p +imap "+pa +vmap "+c +imap ui +imap i +map ggVG + +" Show all buffers and be able to just type in the number of the buffer +map :set nomore:ls:set more:b + +" Move a line up and down with Alt+k and Alt-j +execute "set =\ej" +nnoremap :m+1 +execute "set =\ek" +nnoremap :m-2 + +" Make session file +nnoremap :mksession! .vim-session +" Show who edited the current line from git history +nnoremap :call gitblame#echo() +" Open lazygit in a new tab with = +nnoremap = :tab ter ++close lazygit + +" Cyrillic (Bulgarian yawerty layout) support +ca в w +ca ва wa +ca ь x +ca ьа xa + +" Make x and xa just save and quit without saving. This allows for closing all tabs and terminals. +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 + +" Omni completion {{{ + " Omni completion supports C, HTML, CSS, JavaScript, PHP, Python, Ruby, SQL, XML + set omnifunc=syntaxcomplete#Complete " Completion for all supported languages + + " Do omni completion from Ctrl+Space + inoremap + + " Thanks to: https://vim.fandom.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE + " set completeopt=longest,menuone + " [ The following are disabled, because they conflict with delimitMate's autobracket feature ] + " inoremap pumvisible() ? "\" : "\u\" + " inoremap pumvisible() ? '' : '=pumvisible() ? "\Down>" : ""' + + " "Disables" arrow navigation in completion menu + inoremap pumvisible() ? '' : '' + inoremap pumvisible() ? '' : '' + + " Pressing tab goes from top to bottom + let g:SuperTabContextDefaultCompletionType = "" +" }}} -- cgit v1.2.3