From 9ac6a6ad117aebe67c596e0686dfb19954a3758b Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Tue, 30 Nov 2021 22:47:56 -0800 Subject: [PATCH] Make vim better for markdown editing - Make vim-pandoc handle following md links wiki-style - Bring back concealing of formatting --- .vim/ftplugin/pandoc.vim | 7 ++++--- .vimrc | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.vim/ftplugin/pandoc.vim b/.vim/ftplugin/pandoc.vim index b3875e9..6fe6a28 100644 --- a/.vim/ftplugin/pandoc.vim +++ b/.vim/ftplugin/pandoc.vim @@ -1,5 +1,6 @@ -" Stop excessive concealing of markdown formatting markers -:set conceallevel=0 - " Remove the gutter that shows markdown nesting level by default :set foldcolumn=0 + +" Auto chdir to where the pandoc file is opened so pandoc calls and +" markdown hypertext links work dir-relative. +:lchdir %:p:h diff --git a/.vimrc b/.vimrc index ca81e11..eb82248 100644 --- a/.vimrc +++ b/.vimrc @@ -90,6 +90,13 @@ let g:pandoc#syntax#codeblocks#embeds#langs = ["python", "bash=sh", "sh"] let g:pandoc#syntax#conceal#blacklist = ["ellipses", "quotes"] let g:pandoc#syntax#conceal#urls = 1 +" Create the file if you follow an orphaned link +let g:pandoc#hypertext#create_if_no_alternates_exists = 1 + +" Make link follows split horizontally since most of my terms are tall +" Also work around a netrw bug that opens every no-modify +let g:pandoc#hypertext#split_open_cmd = "botright split +set\\ modifiable" + " Unfold everything by default set foldlevel=99