sponsor Vim development Vim logo Vim Book Ad

Loupe : Enhanced in-file search for Vim

 script karma  Rating 1/1, Downloaded by 368    Comments, bugs, improvements  Vim wiki

created by
Greg Hurrell
script type
Loupe enhances Vim's |search-commands| in four ways:

1. Makes the currently selected match easier to see ~

When searching using |/|, |?|, |star|, |#|, |n|, |N| or similar, it can be hard to see
the "current" match from among all the matches that 'hlsearch' highlights.
Loupe makes the currently selected match easier to see by:

- Applying a different |:highlight| group (by default, |hl-IncSearch|) to the
  match under the cursor.
- Keeping the matching line centered within the window when jumping between
  matches with |n| and |N|.

2. Applies sane pattern syntax by default ~

Loupe makes "very magic" (|/\v|) syntax apply by default when searching. This
is true even if you initiate a search via a novel means, such as from a visual
selection or with a complicated |:range| prefix.

This means that you can use a pattern syntax closer to the familiar regular
expression syntax from languages such as Perl, Ruby, JavaScript (indeed, most
other modern languages that support regular expressions).

3. Provides a shortcut to remove search highlighting ~

Loupe maps <leader>n to quickly remove all 'hlsearch' highlighting (although
you can provide an alternative mapping of your choosing or suppress the
feature entirely).

4. Sensible defaults for search-related features ~

Loupe provides reasonable defaults for most search-related Vim settings to
provide a good "out of the box" experience. For more details, or to see how to
override Loupe's settings, see |loupe-overrides|.
install details

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
loupe-1.2.1.zip 1.2.1 2016-07-14 7.0 Greg Hurrell - Match default Vim behavior of opening folds when jumping to a match.
loupe-1.2.zip 1.2 2016-06-27 7.0 Greg Hurrell - Suppress unwanted cursor movement after |<Plug>(LoupeClearHighlight)| and
  when using |:nohighlight|.
- Expose |loupe#hlmatch()| (previously was a private function) for users who
  wish to do low-level intergration with other plug-ins.
- Provide |<Plug>| mappings for |star|, |#|, |n|, |N|, |gstar|, |g#| (see
  |<Plug>(LoupeStar)|, |<Plug>(LoupeOctothorpe)|, |<Plug>(Loupen)|,
  |<Plug>(LoupeN)|, |<Plug>(LoupeGStar)|, |<Plug>(LoupeGOctothorpe)|).
loupe-1.1.zip 1.1 2016-06-16 7.0 Greg Hurrell - Make compatible with older versions of Vim that do not have |v:hlsearch|.
- Add support for special delimiters with |:substitute| command.
loupe-1.0.zip 1.0 2015-12-28 7.0 Greg Hurrell - Renamed the |<Plug>LoupeClearHighlight| mapping to
loupe-0.1.zip 0.1 2015-07-05 7.0 Greg Hurrell Initial upload
ip used for rating:

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.
SourceForge.net Logo