aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-11 15:04:38 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-11 15:04:38 +1200
commitfc6e46ce8dd7c5ae924237a67af9c9fa958a6e86 (patch)
treecc0b6971970e620dfe57ff46a23e0830349b6675
parentAdd visual mode mapping for spellfiles (diff)
downloaddotfiles-fc6e46ce8dd7c5ae924237a67af9c9fa958a6e86.tar.gz
dotfiles-fc6e46ce8dd7c5ae924237a67af9c9fa958a6e86.zip
Correct usage of :normal in mappings
-rw-r--r--vim/vimrc10
1 files changed, 5 insertions, 5 deletions
diff --git a/vim/vimrc b/vim/vimrc
index ff8a0d6b..1ba3805e 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1111,7 +1111,7 @@ nnoremap <C-L>
" directly for this, but it didn't work; maybe i_CTRL-O doesn't respect
" mappings, but I couldn't find any documentation about this.
"
-inoremap <C-L> <C-O>:normal "\<C-L>"<CR>
+inoremap <C-L> <C-O>:execute "normal \<C-L>"<CR>
" We use :vnoremap here rather than :xnoremap and thereby make the mapping
" apply to select mode as well, because CTRL-L doesn't reflect a printable
@@ -1403,10 +1403,10 @@ xnoremap <Leader>X
\ :SqueezeRepeatBlanks<CR>
"" Leader,= runs the whole buffer through =, preserving position
nnoremap <Leader>=
- \ :<C-U>KeepPosition normal! 1G=G<CR>
+ \ :<C-U>KeepPosition execute 'normal! 1G=G'<CR>
"" Leader,+ runs the whole buffer through gq, preserving position
nnoremap <Leader>+
- \ :<C-U>KeepPosition normal! 1GgqG<CR>
+ \ :<C-U>KeepPosition execute 'normal! 1GgqG'<CR>
" This group defines a few :onoremap commands to make my own text objects.
" I should probably make some more of these, as they've proven to be
@@ -1414,10 +1414,10 @@ nnoremap <Leader>+
"" Leader,_ uses last changed or yanked text as an object
onoremap <Leader>_
- \ :<C-U>normal! `[v`]<CR>
+ \ :<C-U>execute 'normal! `[v`]'<CR>
"" Leader,% uses entire buffer as an object
onoremap <Leader>%
- \ :<C-U>normal! 1GVG<CR>
+ \ :<C-U>execute 'normal! 1GVG'<CR>
" This group defines some useful motions.