how to move the cursor after the abbrev?
function to remove a space after typing ctor:
function! Eatchar(pat) let c = nr2char(getchar(0))
return (c=~ a:pat)?'':c
endfunction
prototype of the class
autocmd FileType cpp :iabbrev ctor class Noname {<CR>private:<CR><CR>public:<CR>Noname();<CR>~Noname(); <esc>5kb<esc>:.,+5s/Noname/<c-r>=Eatchar('\s')<cr>
input: ctor
output:
class Noname {
private:
public:
Noname();
~Noname();
};
in comand-line: prompt to enter a new class name.
After entering a new name,
I would like to move to line #3 (after private:)