From eede0425f50d92be89ee8fb4560a5afb707c2a54 Mon Sep 17 00:00:00 2001 From: Ches Martin Date: Mon, 4 Jul 2016 17:24:30 +0700 Subject: [PATCH] Add a FAQ about not jumping to first result References #59. Thanks @ejoubaud for the succinct abbreviation suggestion that I wish we documented a long time ago. --- README.md | 13 +++++++++++++ doc/ack.txt | 14 +++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a82bb804..af8f522d 100644 --- a/README.md +++ b/README.md @@ -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 a :Ack! +``` + +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 diff --git a/doc/ack.txt b/doc/ack.txt index 33939516..22e884bc 100644 --- a/doc/ack.txt +++ b/doc/ack.txt @@ -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 a :Ack! +< + 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