Skip to content

A vim9script plugin to run commands across non-continous line ranges

License

Notifications You must be signed in to change notification settings

FMakosza/vim-non-continuous-range

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-non-continuous-range

Run commands across non-continuous line ranges.

Install

This plugin requires vim9script, but not necessarily vim9 itself. Some distributions compile the version of vim8 in their repositories with vim9script support, which this plugin aims to support. It has been tested on vim v8.2.

Using vim-plug: Plug 'FMakosza/vim-non-continuous-range'

Using vundle: Plugin 'FMakosza/vim-non-continuous-range'

Overview

non-continuous-range lets you run any valid :execute expression on an arbitrary selection of lines in the open buffer. You can select the lines visually or by passing a range of lines directly on the command line.

For example, :NCRExeOnRange 1,5-9 s/ /\t/g will replace four spaces in a row with a tab character on lines 1, 5, 6, 7, 8, and 9.

Make a visual selection and run :'<,'>NCRAppend to add the selection to a persistent per-buffer line selection list. Build up your selection with more :'<,'>NCRAppends or subtract from it with :'<,'>NCRSubtract, then run :NCRExeOnSelection s/ /\t/g to substitute across your entire selection at once.

:NCRClear will clear the selection, and :NCRRestore will restore the most recent selection after it has been wiped by :NCRClear or one of the :NCRExeOn commands.

Both :NCRExeOn* commands will take your line range and, starting from the bottom, run :execute {expression} on every line sequentially.

Please read the included vim doc for more details, including a comprehensive list of commands and all available configuration options.

License

This plugin is licensed under the GNU General Public License v3.0.

About

A vim9script plugin to run commands across non-continous line ranges

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published