Skip to content

Commit

Permalink
modified readme
Browse files Browse the repository at this point in the history
  • Loading branch information
romainl committed Jul 4, 2015
1 parent 6b861c5 commit 28f2bb6
Showing 1 changed file with 7 additions and 67 deletions.
74 changes: 7 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,82 +16,22 @@ Use your favorite plugin manager or dump `qlist.vim` in your `plugin` directory:
# Windows
%userprofile%\vimfiles\plugin\qlist.vim

## Usage
Don't forget to execute the following command to make the documentation
globally available:

This plugin adds two custom commands to your configuration, `:Ilist` and `:Dlist`, overrides these four normal mode commands: `[I`, `]I`, `[D`, `]D` and adds their visual mode counterparts.
on Unix-like systems...

Those commands still behave like the originals and share the same requirements. There are two differences, though:
:helptags ~/.vim/doc

* The first difference is the whole point of this humble plugin: instead of displaying the results as a non-interactive list, we use the quickfix list. The benefits are huge...
on Windows...

* the results can be displayed in an interactive window where you can search and move around with regular Vim commands,
* the results are still accessible even if the quickfix window is closed,
* older searches can be re-called if needed.

* The second difference is minimal but worth noting...

* `:Ilist foo` works like `:ilist /foo`,
* `:Dlist bar` works like `:dlist /bar`.

The `/` forces vim to perform regular expression search instead of the default whole word search. This is actually a built-in feature that happens to be quite handy for quick searches:

:ilist foo " only finds exact word 'foo'
:ilist /foo " finds all words containing 'foo'

Here are explanations of all the commands:

[I " List every occurence of the word under the cursor
" in the current buffer and included files.
" Comments are skipped.
" Search starts from the top.

]I " List every occurence of the word under the cursor
" in the current buffer and included files.
" Comments are skipped.
" Search starts after the current position.

:Ilist foo " List every word containing 'foo' in the current
" buffer and included files.
" Comments are skipped.
" Search starts from the top.

[D " List every definition of the symbol under the cursor
" in the current buffer and included files.
" Search starts from the top.

]D " List every definition of the symbol under the cursor
" in the current buffer and included files.
" Search starts after the current position.

:Dlist foo " List every definition containing 'foo' in the current
" buffer and included files.
" Search starts from the top.

For more information, please read `:help include-search`.

## Configuration

If you don't want to override `[I`, `]D` and friends, you can still map each command to whatever works for you. Below are the default mappings that you can use as a basis for your own configuration:

" normal mode
nmap <silent> [I <Plug>QlistIncludefromtop
nmap <silent> ]I <Plug>QlistIncludefromhere
nmap <silent> [D <Plug>QlistDefinefromtop
nmap <silent> ]D <Plug>QlistDefinefromhere

" visual mode
xmap <silent> [I <Plug>QlistIncludefromtopvisual
xmap <silent> ]I <Plug>QlistIncludefromherevisual
xmap <silent> [D <Plug>QlistDefinefromtopvisual
xmap <silent> ]D <Plug>QlistDefinefromherevisual

`:help quickfix` is a recommended read if you are unfamiliar with the quickfix feature.
:helptags %userprofile%\vimfiles\doc

## TODO

* Add proper documentation.
* Add options?

## DONE

* Add a gifcast to the `README`. (sort of)
* Add proper documentation.

0 comments on commit 28f2bb6

Please sign in to comment.