" utilities.vim — small editing and config helpers if get(g:, 'chopsticks_enable_reindent_file', 0) if g:chopsticks_space_keymaps nnoremap c= gg=G`` else nnoremap F gg=G`` endif endif if g:chopsticks_space_keymaps vnoremap = = else vnoremap F = nnoremap wa :wa endif if !g:chopsticks_space_keymaps nnoremap = :exe "resize " . (winheight(0) * 3/2) nnoremap - :exe "resize " . (winheight(0) * 2/3) endif if g:chopsticks_space_keymaps nnoremap else nnoremap endif if g:chopsticks_space_keymaps nnoremap cW :%s/\s\+$//:let @/='' vnoremap cW :s/\s\+$//:let @/=''gv else nnoremap W :%s/\s\+$//:let @/='' vnoremap W :s/\s\+$//:let @/=''gv endif if g:chopsticks_space_keymaps nnoremap fv :edit $MYVIMRC nnoremap fV :unlet! g:chopsticks_loaded:execute 'source ' . fnameescape($MYVIMRC):echo "vimrc reloaded" else nnoremap ev :edit $MYVIMRC nnoremap sv :unlet! g:chopsticks_loaded:execute 'source ' . fnameescape($MYVIMRC):echo "vimrc reloaded" endif if g:chopsticks_space_keymaps nnoremap sr :%s/\<\>//g vnoremap sr :s///g else nnoremap * :%s/\<\>//g vnoremap * :s///g endif if has('clipboard') if g:chopsticks_space_keymaps nnoremap fp :let @+ = expand("%:p"):echo "Copied: " . expand("%:p") nnoremap fn :let @+ = expand("%:t"):echo "Copied: " . expand("%:t") else nnoremap cp :let @+ = expand("%:p"):echo "Copied: " . expand("%:p") nnoremap cf :let @+ = expand("%:t"):echo "Copied: " . expand("%:t") endif endif if get(g:, 'chopsticks_enable_sudo_save_bang', 0) cnoremap w!! w !sudo tee > /dev/null % endif