.vim/autoload/vimrc.vim

changeset 641
60b56bbfc143
parent 640
f8985ae54969
child 725
6ff8e3f73482
equal deleted inserted replaced
640:f8985ae54969 641:60b56bbfc143
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

mercurial