From fd3e34596a1eb142ad52f9687ec2d0e30a651619 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Fri, 7 Apr 2023 22:21:22 +0200 Subject: [PATCH] Update markdown (wiki) config --- .vimrc | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/.vimrc b/.vimrc index 9829610..cc96792 100644 --- a/.vimrc +++ b/.vimrc @@ -78,7 +78,7 @@ nn s= =| " Equalize splits " Open nn sb :Lex| " File tree nn t :term| " Open terminal -nn o :!xdg-open http://localhost:8080/%:r.html & +nn o :!xdg-open http://localhost:8080/%:t:r.html & " Remaps ino jj | " Normal now nn | " Hard mode @@ -100,6 +100,19 @@ nn so :so % " Plugins """"""""" +" Plug setup {{{ + +" Plugin build helpers {{{ +function! BuildComposer(info) + if a:info.status != 'unchanged' || a:info.force + if has('nvim') + !cargo build --release --locked + else + !cargo build --release --locked --no-default-features --features json-rpc + endif + endif +endfunction +" }}} call plug#begin() " Coc @@ -118,7 +131,7 @@ Plug 'peitalin/vim-jsx-typescript', { 'for': ['typescript.tsx'] } Plug 'evanleck/vim-svelte', {'branch': 'main'} " JSON with comments Plug 'neoclide/jsonc.vim' -" LaTeX & markdown +" LaTeX Plug 'lervag/vimtex' " Wiki Plug 'lervag/wiki.vim' @@ -126,6 +139,8 @@ Plug 'hektor/taskwiki' " Markdown Plug 'vim-pandoc/vim-pandoc' Plug 'vim-pandoc/vim-pandoc-syntax' +Plug 'ferrine/md-img-paste.vim' +Plug 'euclio/vim-markdown-composer', { 'do': function('BuildComposer') } " TidalCycles Plug 'supercollider/scvim' Plug 'tidalcycles/vim-tidal' @@ -283,6 +298,14 @@ let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"] " }}} +" `euclio/vim-markdown-composer` {{{ + +let g:markdown_composer_custom_css = ['file:///home/h/.wiki/pandoc.css'] +let g:markdown_composer_external_renderer='pandoc -f markdown+latex_macros-yaml_metadata_block -t html5 --mathjax --bibliograph /home/h/.wiki/references.bib --citeproc --lua-filter=/home/h/.wiki/lua-filters/diagram-generator/diagram-generator.lua --lua-filter=/home/h/.wiki/filters/html-links.lua --lua-filter=/home/h/.wiki/filters/tikz.lua' +let g:markdown_composer_autostart = 0 + +" }}} + " `lervag/wiki.vim` {{{ " Only load wiki.vim for wiki directory @@ -296,12 +319,12 @@ let g:wiki_completion_case_sensitive=0 " Mappings " Remap p -augroup filetype_pandoc - autocmd! - au BufRead,BufNewFile /home/h/.wiki/*.md nn p :WikiFzfPages - au BufRead,BufNewFile /home/h/.wiki/*.md nnoremap sv empty(g:wiki#link#get()) ? ':vsw' : '(wiki-link-follow-vsplit)' - au BufRead,BufNewFile /home/h/.wiki/*.md nnoremap ss empty(g:wiki#link#get()) ? ':spw' : '(wiki-link-follow-split)' -augroup END +" augroup filetype_pandoc +" autocmd! +" au BufRead,BufNewFile /home/h/.wiki/*.md nn p :WikiFzfPages +" au BufRead,BufNewFile /home/h/.wiki/*.md nnoremap sv empty(g:wiki#link#get()) ? ':vsw' : '(wiki-link-follow-vsplit)' +" au BufRead,BufNewFile /home/h/.wiki/*.md nnoremap ss empty(g:wiki#link#get()) ? ':spw' : '(wiki-link-follow-split)' +" augroup END " If we are on a wiki link