-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutilis.vim
47 lines (40 loc) · 1.33 KB
/
utilis.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
" Make files starting with # executable.
function! s:auto_chmod()
let first_line = getline(1)
if first_line =~ '^#!'
silent !chmod +x %
endif
endfunction
" Zotero vim integration
function! ZoteroCite()
" The citation format to use is determined either via a magic comment
" containing cayw=format on the first line, or via the filetype.
"
" LaTeX citation format cheatsheet:
"
" latex = natbib (citep is parenthetical, citet is textual, and there
" are other variations for omitting parts of the citation (e.g.
" citeyearpar is only the year in parens, for when the text already
" contains the author's name)
"
" biblatex = biblatex (cite, parencite, autocite etc.)
let matches = matchlist(getline(1), 'cayw=\(\S\+\)')
if len(matches) > 1
let format = matches[1]
else
let format = &filetype =~ '.*tex' ? 'biblatex' : 'pandoc'
endif
let api_call = 'http://localhost:23119/better-bibtex/cayw?format='.format.'&brackets=1'
let ref = system('curl -s '.shellescape(api_call))
return ref
endfunction
source ~/.cache/calendar.vim/credentials.vim
augroup remember_folds
autocmd!
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent! loadview
augroup END
" readonly options
" cnoremap sw!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
let g:suda_smart_edit = 1
" vim:fdm=marker