mhinz / vim-startify

:link: The fancy start screen for Vim.
MIT License
5.3k stars 186 forks source link

Feature Request: Session lock files are displayed in the list #361

Closed talha131 closed 5 years ago

talha131 commented 5 years ago

Thanks a for creating and maintaining this plugin. It has been very useful.

I mainly use it to display my sessions at launch time. I have noticed if a session is open in another instance, then startify displays it as .lock in the list. For example,

   [e]  <empty buffer>

   Sessions

   [0]  bmtool.vim
   [1]  connect.vim
   [2]  default.vim
   [3]  dotfiles.vim
   [4]  jump-viewer-mac.vim
   [5]  jvm-logs.vim
   [6]  lms-admin.vim
   [7]  lms-client.vim
   [8]  neuron-frontend.vim
   [9]  neuron-frontend.vim.lock
   [10] neuron.vim
   [11] tiddly-wiki-scripts.vim

Notice the .lock file at number 9. It affects the musle memory. I know my dotfiles session is at 3. So I could quickly launch the Vim and then press 3 to get into dotfiles session. But the presence of lock files affects the order.

Is it possible to have following features

  1. Not show .lock files in the list?
  2. Sessions that are already opnened are displayed with a * or "already open" in front of their names
mhinz commented 5 years ago

Where are these lock files coming from? That's not a Startify thing.

  1. g:startify_skiplist exists, but doesn't work on the session list. IMHO, the session dir should only contain session files. Can't do much about third-party code creating files there.
  2. "Sessions" are not a real thing in Vim. It's more like creating a snapshot and restoring it later. But the last sourced session is saved in an internal Vim variable: :echo v:this_session. So, indicating this should be easy.
talha131 commented 5 years ago

Thank you @mhinz. I looked into my plugins and discovered that vim-session plugin creates lock files.

I will probably remove it and use Startify to manage my sessions.