confirm_quit.vim


Ⅰ. 插件描述

Ask for confirmation before quitting Vim

Ⅱ. 基本信息

创建日期:  2015-06-26
使用用户:  5
Github星:  6
插件作者:  Martin Tournoij

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'carpetsmoker/confirm-quit-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'carpetsmoker/confirm-quit-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'carpetsmoker/confirm-quit-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/confirm-quit

Ⅳ. 文档说明

This project is considered stable

Ask for confirmation before quitting Vim.

I originally wrote this as [an answer on vi Stack
Exchange](http://vi.stackexchange.com/a/3712/51).

The idea is based on the ["ConfirmQuit"
script](http://www.vim.org/scripts/script.php?script_id=1072).

To use it you'll need to remap keys that "quit" Vim as there's no other way to
prevent Vim from quitting. This plugin comes with the following mappings by
default:

cnoremap <silent> q<CR>  :call confirm_quit#confirm(0, 'last')<CR>
cnoremap <silent> wq<CR> :call confirm_quit#confirm(1, 'last')<CR>
cnoremap <silent> x<CR>  :call confirm_quit#confirm(1, 'last')<CR>
nnoremap <silent> ZZ     :call confirm_quit#confirm(1, 'last')<CR>

See :help confirm-quit for the full documentation.

添加新评论