chore(zsh): Added a session restore to vim when used without arguments

This commit is contained in:
Afonso Franco 2024-06-08 18:10:53 +01:00
parent e933102ad8
commit 1868a7156c
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4

View file

@ -2,7 +2,18 @@
alias ls="eza --icons -l --sort type" alias ls="eza --icons -l --sort type"
alias vim="nvim --listen /tmp/nvim.pipe" function vim {
if [[ -z "$@" ]]; then
if [[ -f "./.session.vim" ]]; then
nvim -S .session.vim --listen /tmp/nvim.pipe -c 'lua vim.g.savesession = true'
else
nvim --listen /tmp/nvim.pipe -c 'lua vim.g.savesession = true'
fi
else
nvim --listen /tmp/nvim.pipe "$@"
fi
}
alias lg="lazygit" alias lg="lazygit"
alias calcurse-caldav='CALCURSE_CALDAV_PASSWORD=$(keyring get caldav afonso) calcurse-caldav' alias calcurse-caldav='CALCURSE_CALDAV_PASSWORD=$(keyring get caldav afonso) calcurse-caldav'