From fc6e46ce8dd7c5ae924237a67af9c9fa958a6e86 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 11 Jun 2019 15:04:38 +1200 Subject: Correct usage of :normal in mappings --- vim/vimrc | 10 +++++----- 1 file 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 " 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 :normal "\" +inoremap :execute "normal \" " 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 X \ :SqueezeRepeatBlanks "" Leader,= runs the whole buffer through =, preserving position nnoremap = - \ :KeepPosition normal! 1G=G + \ :KeepPosition execute 'normal! 1G=G' "" Leader,+ runs the whole buffer through gq, preserving position nnoremap + - \ :KeepPosition normal! 1GgqG + \ :KeepPosition execute 'normal! 1GgqG' " 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,_ uses last changed or yanked text as an object onoremap _ - \ :normal! `[v`] + \ :execute 'normal! `[v`]' "" Leader,% uses entire buffer as an object onoremap % - \ :normal! 1GVG + \ :execute 'normal! 1GVG' " This group defines some useful motions. -- cgit v1.2.3