vim-obsession
vim-obsession copied to clipboard
ProTip: start vim with obsession
Hello,
I'd like to share the following sh(1) function that I wrote to "alias" vim so that it starts with obsession, unless there are any arguments provided to vim (in the case of editing a particular file). Just add it to your .profile
or .bashrc
or .zshrc
to use it.
function vim() {
if test $# -gt 0; then
env vim "$@"
elif test -f Session.vim; then
env vim -S
else
env vim -c Obsession
fi
}
Thanks so much for creating vim obsession! :love_letter:
This is neat and I used it for a while, then I created a plugin for vim to do this instead and a little more to enable easy switching between vim sessions cleanly. Checkout https://github.com/dhruvasagar/vim-prosession
@sunaku This is exactly what I was looking for, thank you.