Wed, 23 Aug 2017 01:18:37 -0400
getcmdpos is cursor position in expr mode here, wont work
.vim/autoload/vimrc.vim | file | annotate | diff | comparison | revisions |
--- a/.vim/autoload/vimrc.vim +++ b/.vim/autoload/vimrc.vim @@ -1,5 +1,5 @@ func! vimrc#CommandAlias(abbrev, expand) abort - execute printf('cnoreabbrev <expr> %s (getcmdtype()==":" && getcmdpos()==1) ? "%s" : "%s"', a:abbrev, a:expand, a:abbrev) + execute printf('cnoreabbrev <expr> %s (getcmdtype()==":" && getcmdline()=="%s") ? "%s" : "%s"', a:abbrev, a:abbrev, a:expand, a:abbrev) endfunc func! vimrc#AutoFmtToggle() abort