sponsor Vim development Vim logo Vim Book Ad

Loupe : Enhanced in-file search for Vim

 script karma  Rating 2/2, Downloaded by 3548  Comments, bugs, improvements  Vim wiki

created by
Greg Hurrell
 
script type
utility
 
description
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.2.zip 1.2.2 2018-08-07 7.0 Greg Hurrell - Fix error-handling to work regardless of |'iskeyword'| setting (https://github.com/wincent/loupe/pull/14).

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
  |<Plug>(LoupeClearHighlight)|.
loupe-0.1.zip 0.1 2015-07-05 7.0 Greg Hurrell Initial upload
ip used for rating: 216.73.216.130

Questions about Vim should go to the maillist. Help Uganda.     Vim at Github