sponsor Vim development Vim logo Vim Book Ad

occur.vim : Show all lines in the buffer containing word (grep buffer)

 script karma  Rating 64/21, Downloaded by 2188  Comments, bugs, improvements  Vim wiki

created by
Noriyoshi Furusawa
 
script type
utility
 
description
This script looks like 'occur' of emacs script.

Create a quickfix list using all lines in the buffer containing a match for regexp.
Search for regexp in the current buffer or all buffers.

Search current buffer:
(1) Search the word by '/' command.
(2)  :Occur

Search all buffers:
(1) Search the word by '/' command.
(2)  :Moccur

Seach all buffers for occurrence of the word nearest to the cursor:
(1) move the cursor to the word
(2) :StarOccur

You can use keymappings of
  <Leader>oc   - Occur
  <Leader>mo   - Moccur
  <Leader>*   - StarOccur

# The default <Leader> is backslash. (ex: \* = StarOccur)
# (see :help mapleader)

[QUICKFIX KEY-MAPPING]
This plugin enhances quickfix key-mapping.
(when this plugin opens the quickfix window.)

<Space> : Set current window height to highest.
x : Display the occurence the current line.
q : Quit the quickfix window.

If you want to disable this, then you can set the variable in the "vimrc".

  let g:occur_no_quickfix_map = 1
 
install details
Copy occur.vim to your plugin directory.


 

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
occur.vim 0.03 2008-07-13 7.0 Noriyoshi Furusawa add: new command "StarOccur"
add: enhansed quickfix key-mapping
occur.vim 0.02 2008-06-08 7.0 Noriyoshi Furusawa add: 'errorformat' setting
occur.vim 0.01 2008-06-08 7.0 Noriyoshi Furusawa Initial upload
ip used for rating: 3.141.202.187

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