getcmdpos is cursor position in expr mode here, wont work

Wed, 23 Aug 2017 01:18:37 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 23 Aug 2017 01:18:37 -0400
changeset 632
9a87ce42aa3c
parent 631
8e07c29f2672
child 633
9308569cd9ba

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

mercurial