Ⅰ. 插件描述
CtrlP extension to manage Vim sessionsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'okcompute/vim-ctrlp-session'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'okcompute/vim-ctrlp-session'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'okcompute/vim-ctrlp-session'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/okcompute/vim-ctrlp-session
Ⅳ. 文档说明
vim-ctrlp-session
CtrlP extension to manage Vim sessions.
Features
Improve Vim session experience:
- Fuzzy search sessions
- Create sessions tracking Git branches
- One configurable location for storing all session files.
- Fast context switching
Requirements
To get the most value out of this plugin, you need these plugins to be
installed:
Installation
This assumes you are using Vundle.
Adapt for your plugin manager of choice. Put this into your .vimrc.
Plugin 'okcompute/vim-ctrlp-session'
Usage
:Session {name}
Create a session with name. Session will be automatically tracked.
:SGit
Like :Session but use current repository name and branch to create the
- i.e. (
repository@branch.)
If the vim-ctrlp-session.session-prefix (respectivelyvim-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)
:SLoad {name}
Load session with {name}.
:SDelete {name}
Delete sessio with {name}.
:SQuit
Stop tracking current active session and close all buffers.
:SList
List all available sessions.
:CtrlPSession
Launch CtrlP prompt for fuzzy searching available sessions.
Requires [Kien/ctrlp.vim] (https://github.com/kien/ctrlp.vim)
CtrlP specific mappings
Once inside CtrlP prompt:
<c-x>
Delete the session under cursor.
Credits
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
- I tried to debug it but the process of creating a new plugin was too
appealing.
- I tried to debug it but the process of creating a new plugin was too
License
Copyright © Pascal Lalancette. Distributed under the same terms as Vim itself. See :help license.