Coder Social home page Coder Social logo

searchparty's Introduction

SearchParty

Enhanced searches, highlights and matches for Vim

Tip
If you like SearchParty and want to share the W00t!, I’m grateful for tips or beverages.

AfterSearch Event

Functions matching the pattern /AfterSearch_[0-9]/ will be called in numeric order after a search operation: / ? n N g g.

Visual Searches

  • * Searches for the next occurrence of the currently selected visual text. <Plug>SearchPartyVisualFindNext

  • # Searches for the prior occurrence of the currently selected visual text. <Plug>SearchPartyVisualFindPrior

  • & Starts a :substitute using the currently selected visual text. <Plug>SearchPartyVisualFindSubstitute

  • <leader>/ Prompts for a literal string to search for. This does NOT use a regular expression, so the characters you type here will be searched for literally without any magic interpretation. The <Up> key scrolls through prior literal search history. <Plug>SearchPartyFindLiteral

7,12 RSearch foo

Searches for "foo" only within the range from lines 7 through 12, both inclusive. The default range is % (the whole buffer).

Multiple Replacements

  • <leader>mp Prompts for a Search Term and then prompts for Replacement Terms (space separated). The current line is then duplicated as many times as there are replacements, minus one, and the Search Term is then replaced on each line with each successive Replacement.

Search Highlight Replace

  • <leader>mar Prompts for a Search Term and a Replace Term and whether you want to use global replacement. The currently highlighted search terms will then have Search Term replaced with Replace Term. This map works in normal mode on the current line and in visual mode on the range given. There is a corresponding command:

    :[range] SearchHighlightReplace
Note
This feature is experimental and may not work properly or may have adverse side effects. Please contact the plugin developer if you experience any grief with this feature.

Search Highlighting

  • <C-L> Temporarily clears search highlight. <Plug>SearchPartyHighlightClear

  • <C-BSlash> Toggles search highlighting. <Plug>SearchPartyHighlightToggle

  • <leader>* Highlights all occurrences of word under the cursor. <Plug>SearchPartyHighlightWord

  • <leader>mah Toggle automatic highlight of all occurrences of word under cursor. NOTE: Update delay determined by 'updatetime' <Plug>SearchPartyToggleAutoHighlightWord

  • <leader>g* Highlights all occurrences of WORD under the cursor. <Plug>SearchPartyHighlightWORD

Highlighting Print Command

E.g.:

:g/something/P

Will show the matching lines with all occurrences of something on those lines highlighted.

  • <leader>ms Prompts for a pattern and sets the current search to that pattern without moving the cursor to the next match of that pattern. <Plug>SearchPartySetSearch

Matches

  • <leader>mm Prompts for a pattern and uses matchadd() to highlight all occurrences of that pattern in the current window. <Plug>SearchPartySetMatch

    There are six match patterns available, called SPM1-SPM6 respectively. Using more than six matches will recycle through the SPM set, losing the previous match assigned to that slot.

    By default, the terminal palette colours #1-#6 are used for SPM1-SPM6. You can override these by providing lines like this in your ~/.vimrc file:

    hi SPM1 ctermbg=123
    Note
    Do this after you have set your colorscheme.

The following functions and commands are available for Search Party matches:

  • SearchPartyMatchDelete(number) - clear match by number

  • SearchPartyMatchList - list all match patterns

  • SearchPartyMatchNumber(number) - reset match number (1-6)

M.A.S.H.

Mash is a motion activated (lol - er, I mean, when you press n/N/\#/\*/g#/g*) current search match highlighter. Breaking that down for you, it highlights the match under the cursor differently to all the other matches (if you have :set hlsearch activated). If you don’t use hlsearch, then it will still highlight the current match.

SearchParty’s MASH now plays nice with vim-indexed-search

searchparty's People

Contributors

dahu avatar raimondi avatar kovetskiy avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.