Wed, 06 Feb 2019 21:07:01 -0600
add pear-tree
631
8e07c29f2672
fix viewdoc abbrevs and cabbrevs in general
Meredith Howard <mhoward@roomag.org>
parents:
619
diff
changeset
|
1 | func! vimrc#CommandAlias(abbrev, expand) abort |
632
9a87ce42aa3c
getcmdpos is cursor position in expr mode here, wont work
Meredith Howard <mhoward@roomag.org>
parents:
631
diff
changeset
|
2 | execute printf('cnoreabbrev <expr> %s (getcmdtype()==":" && getcmdline()=="%s") ? "%s" : "%s"', a:abbrev, a:abbrev, a:expand, a:abbrev) |
631
8e07c29f2672
fix viewdoc abbrevs and cabbrevs in general
Meredith Howard <mhoward@roomag.org>
parents:
619
diff
changeset
|
3 | endfunc |
470 | 4 | |
580 | 5 | func! vimrc#AutoFmtToggle() abort |
641 | 6 | if &formatoptions =~# 'a' |
640
f8985ae54969
avoid abbreviated options
Meredith Howard <mhoward@roomag.org>
parents:
632
diff
changeset
|
7 | setl formatoptions-=a | echo '-a' |
470 | 8 | else |
640
f8985ae54969
avoid abbreviated options
Meredith Howard <mhoward@roomag.org>
parents:
632
diff
changeset
|
9 | setl formatoptions+=a | echo '+a' |
470 | 10 | endif |
580 | 11 | endfunc |
470 | 12 | |
586 | 13 | func! vimrc#Ltag(term) abort |
14 | exe "ltag " . a:term | |
15 | lopen | |
16 | endfunc | |
17 | ||
470 | 18 | " Make paths when writing, as necessary |
580 | 19 | func! vimrc#MkNonExDir(file, buf) abort |
470 | 20 | if empty(getbufvar(a:buf, '&buftype')) && a:file!~#'\v^\w+\:\/' |
21 | let dir=fnamemodify(a:file, ':h') | |
22 | if !isdirectory(dir) | |
23 | call mkdir(dir, 'p') | |
24 | endif | |
25 | endif | |
580 | 26 | endfunc |
470 | 27 | |
583 | 28 | func! vimrc#AutoSessionConfig() abort |
29 | if strlen(v:servername) > 0 && match(v:servername, 'VIM') == -1 | |
619 | 30 | exec 'UniteSessionLoad ' . tolower(v:servername) |
583 | 31 | endif |
32 | endfunc |