Search code examples
searchvimeditorjedit

jEdit Hypersearch like results in VIM?


In jEdit, you can do what is called a hyper search, which lists all of the search results in one pane, and allows you to click on them to jump to that place in the text.

Does vim have a similar functionality, using a plugin or otherwise?


Solution

  • That would be the quickfix list or the location list.

    To search for foo in the current buffer and display a list of all the occurrences, do:

    :vim foo % | copen  <-- use the quickfix list
    :lvim foo % | lopen <-- use the location list
    

    To search for foo in the current buffer's directory and display a list of all the occurrences, do:

    :vim foo .* | copen
    

    See :h quickfix.