nvim: Enter notes dir when calling zettel index

When switching the current buffer to the Zettelkasten index page
(`<leader>ni`), we now also switch the working directory to the
corresponding notes directory.
This commit is contained in:
Marty Oehme 2024-02-05 14:55:09 +01:00
parent 20b9d432ac
commit 22b70a0639
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
3 changed files with 20 additions and 13 deletions

View file

@ -7,20 +7,14 @@ exist() { type "$1" >/dev/null 2>&1; }
# Avoid aliases which I did not create -- unalias EVERYTHING
unalias -a
# v shorthand for neovim
if exist nvim; then
alias v="nvim"
alias vim="nvim"
alias vs="nvim -c 'ScratchPad'" # open an empty 'scratchpad' which simply disappears after use
alias vw="nvim -c \"lua require 'zettelkasten'.index_open()\"" # open to personal wiki
elif exist vim; then
alias v="vim"
else
alias v="vi"
alias vim="vi"
if alias v >/dev/null 2>&1; then
if exist vim; then
alias v="vim"
else
alias v="vi"
alias vim="vi"
fi
fi
# open notes with my vim zettelkasten plugin
alias vn='v +"lua require \"zettelkasten\".index_open()"'
# exit shell mimicks vim
alias :q="exit"