sponsor Vim development Vim logo Vim Book Ad

MarkLines : Toggle highlighting on important lines

 script karma  Rating 34/22, Downloaded by 1860  Comments, bugs, improvements  Vim wiki

created by
Matt Wozniski
 
script type
utility
 
description
The MarkLines plugin allows one to visually mark any number of lines, in any
number of buffers, with any chosen highlight.  In a sufficiently new version
of VIM, 7.1.040 or greater, you can use more than one highlight color per
window simultaneously.

THIS PLUGIN REQUIRES VIM 7.0 OR GREATER.

Useful for things like 'Mark every line that contains the word...'  or
'Brighten every line containing a function declaration' without having it
cleared every time you search for something else.  :)

(By the way, you could do the first example with :%g/foo/MarkLinesOn)

:MarkLinesOn         turns on highlighting for the current line or range
:MarkLinesOff         turns off highlighting for the current line or range
:MarkLinesToggle  toggles highlighting for the current line or range

Each can be followed by an optional highlight group name as an argument;
if so they turn on highlighting to that color (On, Toggle) or only clear lines of
that color (Off).

A few maps are provided as well.
<leader>mc   Clear:  Call MarkLinesOff for the current line or selection.
<leader>ms   Select: Call MarkLinesOn for the current line or selection.
<leader>mt   Toggle: Call MarkLinesToggle for the current line or selection.
<leader>me   Error:  Like \mt but using the "ErrorMsg" group, rather than the
                     default highlight group.

For more details please see the in-vim help.  I spent a long time writing it,
someone should read it.  ^_^

Any questions, please feel free to email me.
 
install details
To install, download the zipfile and unzip it to ~/.vim, or ~/vimfiles in windows, then run ':helptags ~/.vim/doc'
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
MarkLines.zip 1.1 2008-12-11 7.0 Matt Wozniski Fix up a few assorted bugs.
MarkLines.zip 1.0 2007-09-25 7.0 Matt Wozniski I forgot that I hate VimBalls.  Just unzip in your ~/.vim directory , or whatever the windows equivalent is, and then do ':helptags ~/.vim/doc' from within vim
MarkLines.vba 1.0 2007-09-25 7.0 Matt Wozniski Initial upload
ip used for rating: 3.235.251.99

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github