vim-obsession icon indicating copy to clipboard operation
vim-obsession copied to clipboard

ProTip: start vim with obsession

Open sunaku opened this issue 11 years ago • 2 comments

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:

sunaku avatar Sep 06 '13 17:09 sunaku

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

dhruvasagar avatar May 13 '14 06:05 dhruvasagar

@sunaku This is exactly what I was looking for, thank you.

lfv89 avatar Sep 10 '14 04:09 lfv89