Ⅰ. 插件描述
implementation of mkview without requiring a view fileⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/mkview-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/mkview-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/mkview-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/mkview.vim
Ⅳ. 文档说明
This module provides functions which emulate the |mkview| function of vim
without requiring the creation of |view-file|s. This is useful when you
have an explorer type window with some arbitrary level of folding which
needs to be remembered. This module is therefore of interest to script
writers and not to the casual vim user.
Synopsis:
- let viewInfo = MkView()
This returns a formatted string viewInfo (see file for the format) which
contains the minimal information needed to
. Restore manually folds. Restore manually opened and closed folds.
(this is the behavior of |mkview| when 'viewoptions' contains
"folds".
. Restore the cursor row and column position.
The file is allowed to have arbitrarily nested folds.
If there is prior information about the folds, then the following
variants described below can be used.
- let viewInfo = MkViewNoFolds()
When it is known that there are no folds in the file, then use this
function. It will contain just the information needed to restore the
cursor row and column positions.
- let viewInfo = MkViewNoNestedFolds()
When it is known apriori that there are no folds with |foldlevel|
greater than 1, i.e, there are no nested folds, then use this function
which takes advantage of the fact to be faster than MkView(). Nested
folds, if they exist will be silently ignored if this function is used.
- call LoadView(viewInfo)
This function restores the fold state of the file as described in
MkView(). It eliminates the folds already in the file before restoring
the original fold state so that additional nestedness is not introduced.