Edit pandoc academia settings

This commit is contained in:
Marty Oehme 2019-11-04 19:26:36 +01:00
parent 8ffa12744c
commit e8e8290426

View file

@ -87,7 +87,7 @@ Plug 'rhysd/vim-grammarous', { 'for': ['markdown', 'txt'], 'on': 'Goyo' } " inte
" RMarkdown & LaTeX workflow
Plug 'vim-pandoc/vim-pandoc-syntax'
Plug 'vim-pandoc/vim-pandoc'
Plug 'vim-pandoc/vim-rmarkdown'
" Plug 'vim-pandoc/vim-rmarkdown'
" Note-Taking Workflow
Plug 'lervag/wiki.vim'
@ -103,6 +103,12 @@ augroup load_ide_features
\| autocmd! load_ide_features
autocmd InsertEnter * call deoplete#enable()
autocmd InsertEnter * call echodoc#enable()
" Add pandoc citations to deoplete automatic completions
autocmd InsertEnter * call deoplete#custom#var('omni', 'input_patterns', {
\ 'pandoc': '@'
\})
augroup END
" Design
@ -162,25 +168,46 @@ endfunction
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'javascipt', 'go']
" call the prose function defined above for any md files
autocmd FileType pandoc,markdown,txt,rmarkdown call Prose()
autocmd FileType pandoc,markdown,txt,rmarkdown call Prose()
" or invoke it manually by writing :Prose
command! -nargs=0 Prose call Prose()
" PLUGIN: vim-pandoc
let g:pandoc#modules#enabled=["metadata", "toc", "hypertext", "command"]
let g:pandoc#command#prefer_pdf=1
let g:pandoc#biblio#bibs=["~/Nextcloud/Library/academia/academia.bib"]
let g:pandoc#completion#bib#mode='citeproc'
" handle markdown files with pandoc (and pandoc syntax!)
let g:pandoc#filetypes#pandoc_markdown = 1
" disable all default keymaps
let g:pandoc#keyboard#use_default_mappings=0
let g:pandoc#folding#level=2
let g:pandoc#hypertext#use_default_mappings=0
" if there's a pdf and an html or similar, open the pdf
let g:pandoc#command#prefer_pdf=1
" look for bibtex files w/ same name as edited one, then .bib in current dir, yaml frontmatter, and finally the globally set bibs file
let g:pandoc#biblio#sources="bcyg"
" the globally set bibs file
let g:pandoc#biblio#bibs=["~/Nextcloud/Library/academia/academia.bib"]
let g:pandoc#biblio#use_bibtool=1
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#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
" configuration for vim-pandoc and vim-rmarkdown
let g:pandoc#syntax#conceal#use = 1
let g:pandoc#syntax#conceal#urls = 1
"
" follow and open links with pandoc
" open a file with either local means, or let the system decide
nnoremap <silent> gX :<C-u>call pandoc#hypertext#OpenSystem()<cr>
nnoremap <silent> gx :<C-u>call pandoc#hypertext#OpenLocal()<cr>
" open a link in the editor (this buffer, or split)
nnoremap <silent> gf :<C-u>call pandoc#hypertext#OpenLink( g:pandoc#hypertext#edit_open_cmd )<cr>
nnoremap <silent> <CR> :<C-u>call pandoc#hypertext#OpenLink( g:pandoc#hypertext#edit_open_cmd )<cr>
nnoremap <silent> gF :<C-u>call pandoc#hypertext#OpenLink( g:pandoc#hypertext#split_open_cmd )<cr>
nnoremap <silent> gF :<C-u>call pandoc#hypertext#OpenLink( g:pandoc#hypertext#split_open_cmd )<cr>
" go back a link
nnoremap <silent> gb :<C-u>call pandoc#hypertext#BackFromLink()<cr>
nnoremap <silent> <BS> :<C-u>call pandoc#hypertext#BackFromLink()<cr>
" PLUGIN: wiki.vim
if $WIKIROOT ==? ""
@ -603,8 +630,8 @@ let g:nv_fzf_binds = [
" installed (it is a bit more brittle)
" autocmd FileType rmd noremap <F10> :!echo<space>"require(rmarkdown);<space>render('<c-r>%')"<space>\|<space>R<space>--vanilla<enter>
" Compile with rmarkdown
autocmd FileType markdown,rmarkdown noremap <leader>c :RMarkdown pdf<cr>
autocmd FileType markdown,rmarkdown noremap <leader>C :RMarkdown! pdf<cr>
" autocmd FileType markdown,rmarkdown noremap <leader>c :RMarkdown pdf<cr>
" autocmd FileType markdown,rmarkdown noremap <leader>C :RMarkdown! pdf<cr>
function! SearchWiki()
let l:curpath=getcwd()