mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -4,6 +4,10 @@
|
||||
Author: Antoine Imbert <antoine.imbert+ackvim@gmail.com> *ack-author*
|
||||
License: Same terms as Vim itself (see |license|)
|
||||
|
||||
This plugin is only available if 'compatible' is not set.
|
||||
|
||||
{Vi does not have any of this}
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *ack*
|
||||
|
||||
@ -16,7 +20,7 @@ shows the results in a split window.
|
||||
Search recursively in {directory} (which defaults to the current
|
||||
directory) for the {pattern}. Behaves just like the |:grep| command, but
|
||||
will open the |Quickfix| window for you. If [!] is not given the first
|
||||
occurence is jumped to.
|
||||
occurrence is jumped to.
|
||||
|
||||
:AckAdd [options] {pattern} [{directory}] *:AckAdd*
|
||||
|
||||
@ -90,7 +94,6 @@ Example:
|
||||
>
|
||||
let g:ackprg = "ag --vimgrep"
|
||||
<
|
||||
|
||||
*g:ack_default_options*
|
||||
g:ack_default_options
|
||||
Default: " -s -H --nocolor --nogroup --column"
|
||||
@ -107,18 +110,17 @@ Example:
|
||||
let g:ack_default_options =
|
||||
\ " -s -H --nocolor --nogroup --column --smart-case --follow"
|
||||
<
|
||||
|
||||
*g:ack_apply_qmappings*
|
||||
g:ack_apply_qmappings
|
||||
Default: 1
|
||||
|
||||
This option enable mappings on quickview window.
|
||||
This option enables mappings on the |quickfix| window.
|
||||
|
||||
*g:ack_apply_lmappings*
|
||||
g:ack_apply_lmappings
|
||||
Default: 1
|
||||
|
||||
This option enable mappings on Location list window.
|
||||
This option enables mappings on |location-list| windows.
|
||||
|
||||
*g:ack_mappings*
|
||||
g:ack_mappings
|
||||
@ -139,7 +141,6 @@ Example, if you want to open the result in the middle of the screen:
|
||||
>
|
||||
let g:ack_mappings = { "o": "<CR>zz" }
|
||||
<
|
||||
|
||||
*g:ack_qhandler*
|
||||
g:ack_qhandler
|
||||
Default: "botright copen"
|
||||
@ -150,7 +151,6 @@ If you want to open a quickview window with 30 lines you can do:
|
||||
>
|
||||
let g:ack_qhandler = "botright copen 30"
|
||||
<
|
||||
|
||||
*g:ack_lhandler*
|
||||
g:ack_lhandler
|
||||
Default: "botright lopen"
|
||||
@ -161,9 +161,7 @@ If you want to open a Location list window with 30 lines you can do:
|
||||
>
|
||||
let g:ack_lhandler = "botright lopen 30"
|
||||
<
|
||||
|
||||
*g:ackhighlight*
|
||||
|
||||
g:ackhighlight
|
||||
Default: 0
|
||||
|
||||
@ -173,7 +171,6 @@ Example:
|
||||
>
|
||||
let g:ackhighlight = 1
|
||||
<
|
||||
|
||||
*g:ack_autoclose*
|
||||
g:ack_autoclose
|
||||
Default: 0
|
||||
@ -185,9 +182,7 @@ Example:
|
||||
>
|
||||
let g:ack_autoclose = 1
|
||||
<
|
||||
|
||||
*g:ack_autofold_results*
|
||||
|
||||
g:ack_autofold_results
|
||||
Default: 0
|
||||
|
||||
@ -200,9 +195,7 @@ Example:
|
||||
>
|
||||
let g:ack_autofold_results = 1
|
||||
<
|
||||
|
||||
*g:ackpreview*
|
||||
|
||||
g:ackpreview
|
||||
Default: 0
|
||||
|
||||
@ -212,9 +205,7 @@ Example:
|
||||
>
|
||||
let g:ackpreview = 1
|
||||
<
|
||||
|
||||
*g:ack_use_dispatch*
|
||||
|
||||
g:ack_use_dispatch
|
||||
Default: 0
|
||||
|
||||
@ -229,9 +220,7 @@ Example:
|
||||
>
|
||||
let g:ack_use_dispatch = 1
|
||||
<
|
||||
|
||||
*g:ack_use_cword_for_empty_search*
|
||||
|
||||
g:ack_use_cword_for_empty_search
|
||||
Default: 1
|
||||
|
||||
@ -239,34 +228,76 @@ Use this option to enable blank searches to run against the word under the
|
||||
cursor. When this option is not set, blank searches will only output an error
|
||||
message.
|
||||
|
||||
|
||||
Example:
|
||||
>
|
||||
let g:ack_use_cword_for_empty_search = 0
|
||||
<
|
||||
|
||||
|
||||
==============================================================================
|
||||
MAPPINGS *ack-mappings*
|
||||
|
||||
The following keyboard shortcuts are available in the quickfix window:
|
||||
The following keyboard shortcuts are available in the |quickfix| and
|
||||
|location-list| windows:
|
||||
|
||||
o open file (same as enter).
|
||||
? display a quick summary of these mappings.
|
||||
|
||||
O open file and close quickfix window.
|
||||
o open file (same as Enter).
|
||||
|
||||
O open file and close the quickfix window.
|
||||
|
||||
go preview file (open but maintain focus on ack.vim results).
|
||||
|
||||
t open in a new tab.
|
||||
|
||||
T open in new tab silently.
|
||||
T open in new tab without moving to it.
|
||||
|
||||
h open in horizontal split.
|
||||
|
||||
H open in horizontal split silently.
|
||||
H open in horizontal split, keeping focus on the results.
|
||||
|
||||
v open in vertical split.
|
||||
|
||||
gv open in vertical split silently.
|
||||
gv open in vertical split, keeping focus on the results.
|
||||
|
||||
q close the quickfix window.
|
||||
|
||||
To adjust these, see |g:ack_mappings|.
|
||||
|
||||
==============================================================================
|
||||
Ignoring files *ack-ignore*
|
||||
|
||||
If you're using this plugin with ag, The Silver Searcher, bear in mind that:
|
||||
|
||||
- It ignores file patterns from your .gitignore and .hgignore.
|
||||
|
||||
- If there are other files in your source repository you don't wish to
|
||||
search, you can add their patterns to an .agignore file.
|
||||
|
||||
==============================================================================
|
||||
ISSUES AND FAQ *ack-issues-and-faq*
|
||||
|
||||
I use NERDTree and opening ack.vim results in a vertical split displaces 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
|
||||
this:
|
||||
>
|
||||
let g:ack_mappings = {
|
||||
\ 'v': '<C-W><CR><C-W>L<C-W>p<C-W>J<C-W>p',
|
||||
\ 'gv': '<C-W><CR><C-W>L<C-W>p<C-W>J' }
|
||||
<
|
||||
This solution will be improved in the future.
|
||||
|
||||
Results show a mix of relative and absolute paths, making them hard to read.~
|
||||
|
||||
This is a quirk of Vim that can happen with plain |:vimgrep| too. You can
|
||||
try this in your vimrc to work around it:
|
||||
>
|
||||
autocmd BufAdd * exe "cd" fnameescape(getcwd())
|
||||
<
|
||||
but for some users this may be disruptive to their Vim workflow. For more
|
||||
details, see:
|
||||
|
||||
http://vi.stackexchange.com/a/4816/7174
|
||||
https://github.com/mileszs/ack.vim/issues/143
|
||||
|
||||
vim:set et sw=4 ts=4 tw=78:
|
||||
|
Reference in New Issue
Block a user