Ⅰ. 插件描述
This plugin prevents gvim closed with :q , :qa and etc command.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'taka-vagyok/prevent-win-closed-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'taka-vagyok/prevent-win-closed-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'taka-vagyok/prevent-win-closed-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/taka-vagyok/prevent-win-closed.vim
Ⅳ. 文档说明
prevent-win-closed.vim
About
When they close file with :q or :qa, tha last gvim window is closed.
This plugin can prevent such a case in command mode.
This function is disabled as defalut. Please enable this plugin by :PreventWinClosedEnable or set g:prevent_win_closed_enable = 1 in vim config file(e.g. ~/.vimrc), then the last gvim window will not close with q, qa or qaw.
Why is the function diabled as default?
If you set default editor as gvim, you may open many window with many gvim process. In case, I wolud like not to close one window. so just type :PreventWinClosedEnable in one window, you can prevent the all gvim window closed.
Requirements
- Vim
Recommends (To install and manage):
Quick Start
To use this pluging, all you have to do is install and type :PreventWinClosedEnable.
Install
- Install NeoBundle plugin to vim
- Add followings in vim config file.
NeoBundle "taka-vagyok/prevent-win-closed.vim"3. Launch vim and exec following command
:NeoBundleInstall4. Restart gvim ### Disable/Enable plugin by command Disable to prevent this last window closed. :PreventWinClosedDiable Enable to prevent this last window closed. :PreventWinClosedEnable ## Configure (Optional) Two option value are predefined. Add following values into vim config file. If set g:prevent_win_closed_enable = 1, this plugin get enable. (Default: 0) let g:prevent_win_closed_enable = 1 If set g:prevent_win_closed_quit_enable = 1, Prevent gvim closed as quit/quitall/qall commands, too. (Default: 0) let g:prevent_win_closed_quit_enable = 1 ## Uninstall 1. Remove follwings in vim config file.:
NeoBundle "taka-vagyok/prevent-win-closed.vim"2. Launch vim and exec following command
:NeoBundleClean## Caveat ### Override some command by cavvend This plugin override q, qa, aq, waq, wqa, quit, qall and quitall. If you customized those command, this plugin may affect your customize.