2019-08-13 12:14:02 +03:00
|
|
|
#!/usr/bin/zsh
|
|
|
|
INDEX="$HOME/vimwiki/index.md"
|
|
|
|
WIKIOPTS="[{'path': '$HOME/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}]"
|
|
|
|
VIMOPTS=(
|
2018-07-06 00:32:25 +03:00
|
|
|
'-c' 'set titlestring=vimwiki'
|
2019-08-13 12:14:02 +03:00
|
|
|
'-c' "let g:vimwiki_list = $WIKIOPTS"
|
2018-07-06 12:09:20 +03:00
|
|
|
'-c' 'packadd vimwiki'
|
2019-08-13 12:14:02 +03:00
|
|
|
'-c' "e $INDEX"
|
2018-07-06 00:32:25 +03:00
|
|
|
)
|
2019-08-13 12:14:02 +03:00
|
|
|
|
2018-06-29 16:58:43 +03:00
|
|
|
case $1 in
|
2018-07-06 00:32:25 +03:00
|
|
|
-g) vimbin=$(command -v gvim);;
|
2018-07-10 02:30:30 +03:00
|
|
|
-n) vimbin=$(command -v vim);;
|
2018-07-06 00:32:25 +03:00
|
|
|
*) vimbin=$(command -v tvim);;
|
2018-06-29 16:58:43 +03:00
|
|
|
esac
|
2019-08-13 12:14:02 +03:00
|
|
|
|
|
|
|
exec flock -w0 $INDEX $vimbin ${VIMOPTS[@]}
|