From 6298daeca261a0ce1aa86b3f84a7f738bd47a517 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 12 Jun 2019 14:18:46 +0200 Subject: [PATCH] Add configurable wiki root directory Can be set through environment variable WIKIROOT. By default points to ~/Nextcloud/Notes/ but is kept configurable for each computer. Will be picked up by vim wiki plugin to enable wiki functionality for the respective directory. --- .config/nvim/init.vim | 6 +++++- .config/shell/rc.d/set-wiki-root.sh | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .config/shell/rc.d/set-wiki-root.sh diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index bd6f27d..7c8073d 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -153,7 +153,11 @@ autocmd FileType markdown,txt call Prose() command! -nargs=0 Prose call Prose() " PLUGIN: wiki.vim -let g:wiki_root = '~/Nextcloud/Notes/' +if $WIKIROOT ==? "" + let g:wiki_root = '~/Nextcloud/Notes/' +else + let g:wiki_root = $WIKIROOT +endif " filetypes to automatically enable the plugin for, seems to take file endings " rather than vim ft let g:wiki_filetypes = ['md', 'mkd', 'markdown', 'wiki'] diff --git a/.config/shell/rc.d/set-wiki-root.sh b/.config/shell/rc.d/set-wiki-root.sh new file mode 100644 index 0000000..3e9d535 --- /dev/null +++ b/.config/shell/rc.d/set-wiki-root.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# set wiki root to nextcloud notes folder, +# will be picked up by vim wiki plugin as root +export WIKIROOT='~/Nextcloud/Notes/'