Skip to content

Commit

Permalink
Add a FAQ about not jumping to first result
Browse files Browse the repository at this point in the history
References #59. Thanks @ejoubaud for the succinct abbreviation
suggestion that I wish we documented a long time ago.
  • Loading branch information
ches committed Jul 4, 2016
1 parent 35f4c78 commit eede042
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ nice code clean-up (which ack.vim is now hopefully getting), and ack.vim picked
up a few features that haven't made their way to ag.vim, like `:AckWindow`,
optional background search execution with [vim-dispatch], and auto-previewing.

#### I don't want to jump to the first result automatically. ####

Use `:Ack!`, with bang. If you want this behavior most of the time, you might
like an abbreviation or mapping in your personal config, something like these:

```vim
cnoreabbrev Ack Ack!
nnoremap <Leader>a :Ack!<Space>
```

Most of the `:[L]Ack*` commands support this. Note that this behavior follows
the convention of Vim's built-in `:grep` and `:make` commands.

[The Silver Searcher]: https://github.com/ggreer/the_silver_searcher
[sadface]: https://github.com/mileszs/ack.vim/commit/d97090fb502d40229e6976dfec0e06636ba227d5#commitcomment-5771145

Expand Down
14 changes: 13 additions & 1 deletion doc/ack.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,19 @@ If you're using this plugin with ag, The Silver Searcher, bear in mind that:
==============================================================================
ISSUES AND FAQ *ack-issues-and-faq*

I use NERDTree and opening ack.vim results in a vertical split displaces it.~
I don't want to jump to the first result automatically.~

Use `:Ack!`, with bang. If you want this behavior most of the time, you
might like an abbreviation or mapping in your personal config, something
like these:
>
cnoreabbrev Ack Ack!
nnoremap <Leader>a :Ack!<Space>
<
Most of the `:[L]Ack*` commands support this. Note that this behavior
follows the convention of Vim's built-in |:grep| and |:make| commands.

I use NERDTree and opening ack.vim results in a vertical split displacing it.~

You are probably using NERDTree with its default alignment at the left
side of the window. Set these custom mappings in your vimrc to work around
Expand Down

0 comments on commit eede042

Please sign in to comment.