CtrlP extension to manage Vim sessions.
Improve Vim session experience:
- Fuzzy search sessions
- Create sessions tracking Git branches
- One configurable location for storing all session files.
- Fast context switching
To get the most value out of this plugin, you need these plugins to be installed:
This assumes you are using Vundle.
Adapt for your plugin manager of choice. Put this into your .vimrc
.
Plugin 'okcompute/vim-ctrlp-session'
Create a session with name. Session will be automatically tracked.
Like :Session but use current repository name and branch to create the
name. i.e. (repository@branch
.)
If the vim-ctrlp-session.session-prefix
(respectively
vim-ctrlp-session.session-suffix
) git configuration are set, its value is
automatically prefixed (respectively suffixed) to the repository
name.
This is useful when you have several checkouts of the same repository (with the same name) at different location and you want to be able to distinguish those.
Requires [Tpope/vim-fugitive] (https://github.com/tpope/vim-fugitive)
Load session with {name}.
Delete sessio with {name}.
Stop tracking current active session and close all buffers.
List all available sessions.
Launch CtrlP prompt for fuzzy searching available sessions.
Requires [Kien/ctrlp.vim] (https://github.com/kien/ctrlp.vim)
Once inside CtrlP prompt:
Delete the session under cursor.
This plugin implementation was inspired by :
-
[tpope/vim-obsession] (https://github.com/tpope/vim-obsession)
Helped me better understand how to correctly manage sessions.
-
[Manual-colmenero/vim-simple-session] (https://github.com/Manuel-colmenero/vim-simple-session)
This plugin was the initiator. I was a user and liked the idea. But it was buggy. I tried to debug it but the process of creating a new plugin was too appealing.
Copyright © Pascal Lalancette. Distributed under the same terms as Vim itself. See :help license.