experimental dokuwiki vim

This commit is contained in:
Q
2023-12-22 20:37:23 +02:00
parent 5001e1c314
commit 62cdc7bd62
3 changed files with 99 additions and 0 deletions

31
vim/vimdw Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
function helpexit() {
cat <<EOF
Edit a file with dokuwiki syntax.
In insert mode:
Ctrl-w h1-6: ====== headings ======
Ctrl-w bb/ii/uu: **bold** //italic// __underline__
Ctrl-w dd: <del>deleted</del>
Ctrl-w l: [[URL|Title]]
Ctrl-w f: ((footnote))
Ctrl-w i/im: {{ wiki:image.png?width }} (can be url)
Ctrl-w -: * unordered
Ctrl-w 1: - ordered list
Ctrl-w , and .: de-indent and indent
Ctrl-w c: <code bash file.sh>\n</code>
normal mode:
Space toggles <todo>
EOF
exit
}
[[ -z "$1" ]] && helpexit
[[ "$1" = "-h" ]] && helpexit
case $OSTYPE in
darwin*) LIB=$( dirname $( realpath $0 ) )/dokuwiki.vim ;;
*) LIB=$( dirname $( readlink -f $0 ) )/dokuwiki.vim ;;
esac
vim -S "$LIB" "$@"