NrrwRgn


Ⅰ. 插件描述

A Narrow Region Plugin for vim (like Emacs Narrow Region)

Ⅱ. 基本信息

创建日期:  2010-04-28
使用用户:  454
Github星:  522
插件作者:  Christian Brabandt

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# NrrwRgn plugin Say Thanks!

A Vim plugin for focussing on a selected region

This plugin is inspired by the Narrowing feature of Emacs and means to focus on a selected region while making the rest inaccessible. You simply select the region, call :NR and the selected part will open in a new split window while the rest of the buffer will be protected. Once you are finished, simply write the narrowed window (:w) and all the changes will be moved back to the original buffer.

See also the following screencast, that shows several features available:
screencast of the plugin

Installation

Use the plugin manager of your choice. Or download the [stable][] version of the plugin, edit it with Vim (vim NrrwRgn-XXX.vmb) and simply source it (:so %). Restart and take a look at the help (:h NrrwRgn.txt)

Usage

Once installed, take a look at the help at :h NarrowRegion.

Here is a short overview of the functionality provided by the plugin:

Ex commands:

:NR  - Open the selected region in a new narrowed window
:NW  - Open the current visual window in a new narrowed window
:WR  - (In the narrowed window) write the changes back to the original buffer.
:NRV - Open the narrowed window for the region that was last visually selected.
:NUD - (In a unified diff) open the selected diff in 2 Narrowed windows
:NRP - Mark a region for a Multi narrowed window
:NRM - Create a new Multi narrowed window (after :NRP) - experimental!
:NRS - Enable Syncing the buffer content back (default on)
:NRN - Disable Syncing the buffer content back
:NRL - Reselect the last selected region and open it again in a narrowed window

You can append ! to most commands to open the narrowed part in the current window instead of a new window. In the case of :WR, appending ! closes the narrowed window in addition to writing to the original buffer.

Visual mode commands:

<Leader>nr         - Open the current visual selection in a new narrowed window

Scripting Functions:

nrrwrgn#NrrwRgnStatus()   - Return a dict with all the status information for the current window

Attention

:NRM is currently experimental

Similar Work

Andreas Politz' narrow_region<br/>
Kana Natsunos narrow<br/>
Jonas Kramers narrow<br/>
Marcin Szamotulskis ViewPort<br/>

License & Copyright

© 2009-2014 by Christian Brabandt. The Vim License applies. See :h license

NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK

添加新评论