vim-stay


Ⅰ. 插件描述

Make Vim persist editing state without fuss

Ⅱ. 基本信息

创建日期:  2015-01-29
使用用户:  50
Github星:  126
插件作者:  Martin Kopischke

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Project status
Current release
Open issues
License
Build Status

Stay at my cursor, boy!

vim-stay adds automated view session creation and restoration whenever editing a buffer, across Vim sessions and window life cycles. It also alleviates Vim's tendency to lose view state when cycling through buffers (via argdo, bufdo et al.). It is smart about which buffers should be persisted and which should not, making the procedure painless and invisible.

If you have wished Vim would be smarter about keeping your editing state, vim-stay is for you.

Installation

  1. The old way: download and source the vimball from the releases page, then run :helptags {dir} on your runtimepath/doc directory. Updating the plug-in via :GetLatestVimScripts is supported. Or,
  2. The plug-in manager way: using a git-based plug-in manager (Pathogen, Vundle, NeoBundle, Vim-Plug etc.), simply add zhimsel/vim-stay to the list of plug-ins, source that and issue your manager's install command. Or,
  3. The Vim package way (requires Vim 7.4 with patch 1384): create a pack/vim-stay/start/ directory in your 'packagepath' and clone this repository into it. Run :helptags {dir} on the doc directory of the created repo. Run :runtime plugin/stay.vim to load vim-stay (or restart Vim).

Usage

Recommended: set viewoptions=cursor,folds,slash,unix (but at the very least do set viewoptions-=options). Edit as usual. See the documentation for more.

Rationale

Keeping editing session state should be a given in an editor; unluckily, Vim's solution for this, view sessions, are not easily automated without encountering painful bumps. As the one plug-in available that aimed to fix this, Zhou Yi Chao’s restore_view.vim, limited itself to Vim editing sessions, didn’t play well with other position setting plug-ins like vim-fetch and as there were some issues with its heuristics, vim-stay was born.

License

vim-stay is licensed under the terms of the MIT license according to the accompanying license file.

添加新评论