Sort vim plugin loading
This commit is contained in:
parent
2c374249d4
commit
36c202f48a
6 changed files with 10 additions and 8 deletions
|
|
@ -1,20 +0,0 @@
|
|||
" PROSE: function to automatically enables markdown plugins for md & txt files
|
||||
function! Prose()
|
||||
call plug#load('vim-pencil')
|
||||
call plug#load('goyo.vim')
|
||||
call plug#load('limelight.vim')
|
||||
call pencil#init()
|
||||
" PLUGIN: vim-textobj-sentence
|
||||
" enable extended sentence textobject use on md and plaintext files
|
||||
call textobj#sentence#init()
|
||||
" hide the markdown cruft
|
||||
setlocal conceallevel=2
|
||||
setlocal foldlevel=2
|
||||
endfunction
|
||||
" enable syntax highlighting for codeblocks WITHIN markdown
|
||||
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'javascipt', 'go']
|
||||
|
||||
" call the prose function defined above for any md files
|
||||
au FileType pandoc,markdown,md,mkd call Prose()
|
||||
" or invoke it manually by writing :Prose
|
||||
command! -nargs=0 Prose call Prose()
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
" set up fzf-bibtex
|
||||
let g:fzf_bibtex_cache = '~/.cache/'
|
||||
let g:fzf_bibtex_sources = g:pandoc#biblio#bibs
|
||||
|
||||
" prepare bibtex_ls function to look for bib files in cwd/parent/subdirs,
|
||||
" attach the standard bibtex source file
|
||||
" return the command with standard cache directory filled
|
||||
function! s:bibtex_ls(...)
|
||||
let bibfiles = (
|
||||
\ globpath('.', '*.bib', v:true, v:true) +
|
||||
\ globpath('..', '*.bib', v:true, v:true) +
|
||||
\ globpath('*/', '*.bib', v:true, v:true)
|
||||
\ )
|
||||
let bibfiles = join(bibfiles, ' ')
|
||||
let source_cmd = 'bibtex-ls -cache ' . g:fzf_bibtex_cache . ' ' .bibfiles . ' ' . join(g:fzf_bibtex_sources)
|
||||
return source_cmd
|
||||
endfunction
|
||||
|
||||
" insert citation from normal mode at cursor (with brackets)
|
||||
function! s:bibtex_cite_sink(lines)
|
||||
let r=system("bibtex-cite ", a:lines)
|
||||
execute ':normal! i[' . r . ']'
|
||||
endfunction
|
||||
command! -bang -nargs=* CiteRef call fzf#run(fzf#wrap({
|
||||
\ 'source': <sid>bibtex_ls(<q-args>),
|
||||
\ 'sink*': function('<sid>bibtex_cite_sink'),
|
||||
\ 'up': '25%',
|
||||
\ 'options': '--ansi --multi --prompt "Cite> "'
|
||||
\ }))
|
||||
" insert citation from insert mode at cursor (no brackets inserted)
|
||||
function! s:bibtex_cite_sink_insert(lines)
|
||||
let r=system("bibtex-cite ", a:lines)
|
||||
execute ':normal! i' . r
|
||||
call feedkeys('a', 'n')
|
||||
endfunction
|
||||
" insert markdown formatted reference
|
||||
function! s:bibtex_markdown_sink(lines)
|
||||
let r=system("bibtex-markdown -cache " . g:fzf_bibtex_cache . ' ' . join(g:fzf_bibtex_sources), a:lines)
|
||||
echo join(a:lines, '; ')
|
||||
execute ':normal! i' . r
|
||||
endfunction
|
||||
command! -bang -nargs=* CiteMarkdown call fzf#run(fzf#wrap({
|
||||
\ 'source': <sid>bibtex_ls(),
|
||||
\ 'sink*': function('<sid>bibtex_markdown_sink'),
|
||||
\ 'up': '25%',
|
||||
\ 'options': '--ansi --multi --prompt "Markdown> "'
|
||||
\ }))
|
||||
|
|
@ -20,7 +20,7 @@ let g:pandoc#biblio#use_preview=1
|
|||
let g:pandoc#completion#bib#mode='citeproc'
|
||||
let g:pandoc#folding#fold_yaml=1
|
||||
let g:pandoc#folding#fastfolds=1
|
||||
" let g:pandoc#folding#level=2
|
||||
" let g:pandoc#folding#level=1
|
||||
let g:pandoc#spell#default_langs=["en_us", "de_de"]
|
||||
let g:pandoc#hypertext#ausosave_on_edit_open_link=1
|
||||
let g:pandoc#hypertext#create_if_no_alternates_exists=1
|
||||
Loading…
Add table
Add a link
Reference in a new issue