zk: Only create aliases if local wiki found
Local wiki requires the '$WIKIROOT' env var to be set, pointing to the root of the (zk) wiki. So we only create associated aliases if the wiki actually exists on a machine.
This commit is contained in:
parent
5ab95c724f
commit
44cd4481a2
1 changed files with 10 additions and 7 deletions
|
|
@ -9,11 +9,14 @@ n() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# open notes with my vim zettelkasten plugin
|
# We have a local wiki
|
||||||
# TODO better implementation conditional on zk.nvim & zettelkasten existing
|
if [ -n "${WIKIROOT}" ]; then
|
||||||
# nvim +'lua pcall(require "zk.commands"') --headless +qa 2>&1 or similar to check - but slow
|
# open notes with my vim zettelkasten plugin
|
||||||
if command -v nvim >/dev/null 2>&1; then
|
# TODO better implementation conditional on zk.nvim & zettelkasten existing
|
||||||
|
# nvim +'lua pcall(require "zk.commands"') --headless +qa 2>&1 or similar to check - but slow
|
||||||
|
if command -v nvim >/dev/null 2>&1; then
|
||||||
alias ni='nvim +"lua require \"zk.commands\".get(\"ZkCd\")()" +"edit $WIKIROOT/index.md"'
|
alias ni='nvim +"lua require \"zk.commands\".get(\"ZkCd\")()" +"edit $WIKIROOT/index.md"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
alias ncd='pushd $WIKIROOT'
|
alias ncd='pushd $WIKIROOT'
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue