diff --git a/vim/vimrc b/vim/vimrc index b16c19c5..5809516c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -302,6 +302,7 @@ set noshowmatch " HTML brackets set matchpairs+=<:> +set noerrorbells set visualbell set t_vb= @@ -309,7 +310,7 @@ set t_vb= set esckeys set timeout -set timeoutlen=1000 ttimeoutlen=0 +set timeoutlen=500 ttimeoutlen=0 " Mode switch fix? " https://powerline.readthedocs.org/en/latest/tipstricks.html#vim @@ -432,9 +433,6 @@ set magic " Autocmd {{{1 -" Remove trailing whitespaces on save -autocmd BufWritePre * :%s/\s\+$//e - augroup VimReload autocmd! autocmd BufWritePost $MYVIMRC nested source $MYVIMRC @@ -449,6 +447,9 @@ augroup MatchWitespace autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@ j nnoremap k nnoremap l +" Repeat latest f, t, F or T [count] times +noremap ; +" Repeat last command on next match +noremap ; :normal n. +" ; ? nnoremap Q :normal n. + " Edit in the same directory as the current file cnoremap %% =fnameescape(expand('%:h')).'/' + +" Open .vimrc in a new split +nnoremap rc :e $MYVIMRC + " Edit in window -map ew :e %% +noremap ew :e %% " Edit in split -map es :sp %% +noremap es :sp %% " Edit in vertical split -map ev :vsp %% +noremap ev :vsp %% " Edit in tab -map et :tabe %% +noremap et :tabe %% " Quicker quit -noremap q :q +noremap q :q " Save a file -noremap w :w -" Save as root (,W) -noremap W :w !sudo tee % > /dev/null +noremap w :w +" Save as root +noremap W :w !sudo tee % > /dev/null -" Clear highlighted search results -map :noh +" Visually select the whole buffer +noremap a ggVG -" Git shortcuts -map b :Gblame -map l :!clear && git log -p % -map d :!clear && git diff % +" Clear highlighted search results +noremap :noh -" Repeat last command on next match -" ; ? nnoremap Q :normal n. +" Remove trailing whitespaces (see TrimWhitespace()) +" noremap :%s/\s\+$//e " Sort css properties -nnoremap S ?{jV/^\s*\}?$k:sort:noh +nnoremap S ?{jV/^\s*\}?$k:sort:noh -" Open .vimrc in a new split -nnoremap rc :e $MYVIMRC +" Git shortcuts +noremap b :Gblame +noremap l :!clear && git log -p % +noremap d :!clear && git diff % " Runtime {{{1