From 66aca50c97bc38f3115f6999412c0f9cde698ebe Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Mon, 21 Sep 2020 22:54:55 -0600 Subject: [PATCH] only load general bindings once --- vim/rc.vim | 91 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/vim/rc.vim b/vim/rc.vim index 5502ddf..cf86e87 100644 --- a/vim/rc.vim +++ b/vim/rc.vim @@ -24,46 +24,51 @@ source $VIM_DIR/abbreviations.vim source $VIM_DIR/window_pane_navigation.vim source $VIM_DIR/my_colors.vim -" to execute macro on q -nnoremap @q - -" Q to replace current line/selection with bash execution -vnoremap Q !$SHELL -nnoremap Q !!$SHELL - -" \d to insert formatted date before/after cursor -nnoremap di :let @d = system("date '+%A, %B %d, %Y'")id -nnoremap da :let @d = system("date '+%A, %B %d, %Y'")a d - -" \c \v to copy/paste from xclip -" @TODO: learn how to freaking compile vim with x11 compatibility so these -" aren't necessary :) -vnoremap c :w !xclip -nnoremap v o!!xclip -o - -" \b for git blame -nnoremap b :set termwinsize=15*0:execute "terminal git blame -L " .eval(line(".")-5) . ",+10 %":set termwinsize& - -" \s previous selection command -nnoremap sq :'<,'> -nnoremap sc :'<,'>w !xclip - -" \q for `q:` -nnoremap q q: - -" \t for rerun last 'test' command: -nnoremap t q:?test - -" \f for fold -nnoremap f z -nnoremap f z - -" append current line to the line below -nnoremap j ddpkJ - -" - to move the current line one below where it is -nnoremap - :m +1 -nnoremap _ :m -2 - -" - (insert mode) set current word to upper-case -inoremap viwUea +augroup general_bindings +" {{{ + " to execute macro on q + nnoremap @q + + " Q to replace current line/selection with bash execution + vnoremap Q !$SHELL + nnoremap Q !!$SHELL + + " \d to insert formatted date before/after cursor + nnoremap di :let @d = system("date '+%A, %B %d, %Y'")id + nnoremap da :let @d = system("date '+%A, %B %d, %Y'")a d + + " \c \v to copy/paste from xclip + " @TODO: learn how to freaking compile vim with x11 compatibility so these + " aren't necessary :) + vnoremap c :w !xclip + nnoremap v o!!xclip -o + + " \b for git blame + nnoremap b :set termwinsize=15*0:execute "terminal git blame -L " .eval(line(".")-5) . ",+10 %":set termwinsize& + + " \s previous selection command + nnoremap sq :'<,'> + nnoremap sc :'<,'>w !xclip + + " \q for `q:` + nnoremap q q: + + " \t for rerun last 'test' command: + nnoremap t q:?test + + " \f for fold + nnoremap f z + nnoremap f z + + " append current line to the line below + nnoremap j ddpkJ + + " - to move the current line one below where it is + nnoremap - :m +1 + nnoremap _ :m -2 + + " - (insert mode) set current word to upper-case + inoremap viwUea + +" }}} +augroup end