GitHub - chrisbra/NrrwRgn: A Narrow Region Plugin for vim (like Emacs Narrow Reg...
source link: https://github.com/chrisbra/NrrwRgn
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
NrrwRgn plugin
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:
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
Kana Natsunos narrow
Jonas Kramers narrow
Marcin Szamotulskis ViewPort
License & Copyright
© 2009-2014 by Christian Brabandt. The Vim License applies. See :h license
NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK
Recommend
-
264
Unicode plugin A Vim plugin for handling unicode and digraphs characters This plugin aims to make the handling of unicode and digraphs chars in Vim easier. It serves 3 purposes: Complete Cha...
-
82
Recover.vim adds a diff option when Vim finds a swap file When you open a file in Vim but it was already open in another instance or not closed properly in a past edit, Vim will warn you, but it won't show you what the difference is betw...
-
120
Introduction This plugin is used for handling column separated data with Vim. Usually those files are called csv files and use the ',' as delimiter, though sometimes they use e.g. the '|' or ';' as delimiter and there also exists fixedwi...
-
136
EnhancedDiff plugin A Vim plugin for creating better diffs (sometimes) This plugin allows you to make use of the Patience diff algorithm for generating diffs to use with Vim. This needs the git command l...
-
101
GitHub is where people build software. More than 27 million people use GitHub to discover, fork, and contribute to over 80 million projects.
-
84
README *CheckAttach.txt* Check attachments when using mutt Author: Christian Brabandt <[email protected]> Version: 0.17 Thu, 15 Jan 2015 21:01:19 +0100 Copyright: (c) 2009-2013 by Christian...
-
68
README *SudoEdit.txt* Edit Files using Sudo/su Author: Christian Brabandt <[email protected]> Version: Vers 0.21 Thu, 15 Jan 2015 20:57:15 +0100 Cop...
-
78
README.md Colorizer A plugin to color colornames and codes
-
39
README.md Changes plugin A Vim plugin for displaying changes in a buffer This plugin was written to help visualize wh...
-
13
In 1956, a group of scientists led by John McCarthy, a young assistant-professor of mathematics, gathered at the Dartmouth College, NH, for an ambitious six-week project: Creating computers that could “use language, form...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK