vxfold.vim


Ⅰ. 插件描述

Fold cycling similar to emacs org-mode (using TAB key)

Ⅱ. 基本信息

创建日期:  2010-03-02
使用用户:  1
Github星:  1
插件作者:  Marko Mahnič

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

This script implements a fold-cycling functionality similar to
the one in emacs org-mode.

Subfolds are open/closed each time TAB or Shift-TAB is pressed.
TAB operates on the lines below a heading that is in the current line.
Shift-TAB operates on the whole buffer.

After each press a step in the following cycle will be performed:
   1. fold closed
   2. show direct subheadings
   3. show structure below heading + first line of text
   4. unfold all

   NOTES: It is possible to skip step 2 and/or 3, but the per-buffer
   configuration is still missing (I think emacs-org uses only 1-2-4). In step
   2 the text under the current heading may be visible; this is because of
   the way folding is implemented in Vim.

Fold cycling will work in buffers that are folded in the following way:
  * headings have folding levels 1-9
  * text has a folding level higher than 9

This means that the script can work with TVO (vimscript#517) without
changing the folding mode. To enable fold cycling in TVO mode:

  :VxFoldTvo

For other modes the foldmethod has to be changed. Foldmethods are
provided for viki (vimscript#861) and vimwiki (vimscript#2226).

  :VxFoldViki
  :VxFoldVimWiki

The later commands will also work on any buffer that has the headings defined
with a number of characters at the beginning of line (viki='*', vimwiki='=').

If a file uses '#' characters to mark headings with levels, it is also possible
to use fold cycling in it like this:

  :call vxfold#SetFold_OrgBolCount('#')
  :VxFoldTvo

The display of the folded text can be changed with

  :call vxfold#SetFoldTextFirstLine()

which is the default for VxFoldVimWiki and VxFoldViki.

Please report bugs/suggestions on the Vim/Wiki (link top right).

添加新评论