From c326a04f708ff406eed736d374183a9054365d5d Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 14 Sep 2018 16:37:14 +0100 Subject: [PATCH] Don't use normal mode mappings in vimscript --- autoload/do.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/do.vim b/autoload/do.vim index 5cbcc64..aaaaedd 100644 --- a/autoload/do.vim +++ b/autoload/do.vim @@ -59,14 +59,14 @@ endfunction function! do#rename_include_guard(old) " Prompt for new guard name let l:new = input('Rename include guard: ', a:old) - " Set a mark to jump back to - normal mr + " Get the current position + let l:pos = getpos('.') " Replace the old guard name with the new one exec '%s/\(#ifndef\|#define\|#endif\s\+\/\/\)\s\+\zs'.a:old.'/'.l:new.'/g' " Stop highlighting search results nohlsearch - " Jump back to the set mark - normal 'r + " Jump back to the start position + call setpos('.', l:pos) endfunction " Setup and start a debugging command.