1 func! vimrc#CommandAlias(abbrev, expand) abort |
1 func! vimrc#CommandAlias(abbrev, expand) abort |
2 execute printf('cnoreabbrev <expr> %s (getcmdtype()==":" && getcmdline()=="%s") ? "%s" : "%s"', a:abbrev, a:abbrev, a:expand, a:abbrev) |
2 execute printf('cnoreabbrev <expr> %s (getcmdtype()==":" && getcmdline()=="%s") ? "%s" : "%s"', a:abbrev, a:abbrev, a:expand, a:abbrev) |
3 endfunc |
3 endfunc |
4 |
4 |
5 func! vimrc#AutoFmtToggle() abort |
5 func! vimrc#AutoFmtToggle() abort |
6 if &formatoptions =~ 'a' |
6 if &formatoptions =~# 'a' |
7 setl formatoptions-=a | echo '-a' |
7 setl formatoptions-=a | echo '-a' |
8 else |
8 else |
9 setl formatoptions+=a | echo '+a' |
9 setl formatoptions+=a | echo '+a' |
10 endif |
10 endif |
11 endfunc |
11 endfunc |