rking / ag.vim Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mileszs/ack.vim
Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack'
This project forked from mileszs/ack.vim
Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack'
I use ag.vim a lot. Often I do multiple searches to drill down to areas of code. This is easy to do because I can use :colder and :cnewer to go between the quick fix lists as long as I don't create more than 10. But, sometimes I forget what search a list is showing the results for. Could the plugin be updated to add the search that was used to create the list to the status bar of the quick fix window? This may also help with issue - #15
What about adding an option to not show the quickfix list if there's no matches?
This'll make more sense when #33 is fixed.
I'm not sure how search patterns work and can't seem to find any documentation anywhere.
What type of expression does the pattern argument take? For example, how would I search for phrases['phrases']?
Re-open :Ag
when enter is pressed? or just show a message? Either way don't open the quickfix window/location list with "ERR: What did you want to search for"
While ag
reads .hgignore
and don't try to read all binary files, ag.vim
doesn't and thus is pretty unusable. :Ag
from vim will pretty much certainly output the "correct" sequence to garble all screen output and require me to restart the terminal session.
When I set --nogroup, it works fine. When I set --group, it doesn't. Any chance to make it work with group enabled?
Why have these lines been added:
https://github.com/rking/ag.vim/blob/master/autoload/ag.vim#L114-115
I'm not familiar enough with vim script to understand why those are there for Ag, but not for Ack.
I only ask because they interfere with the ability to invoke the Ag function and have it reach this line:
https://github.com/rking/ag.vim/blob/master/plugin/ag.vim#L30
I installed ag.vim via vundle
When I search for something like :Ag car_names .
I'm prompted with an error and usage information
ag: unrecognized option '--vimgrep'
In my .vimrc I have
set wildignore+= /node_modules/, dist/*, foo, bar
Any time I use Ag to search for anything, results from dist show up. How can I get it to REALLY ignore that directory.
Hi,
I just noticed this project and I wondered if there's really a need for the fork.
To make ack.vim work with ag is just a matter of:
let g:ackprg = 'ag --nogroup --nocolor --column'
I use ag with ack.vim like that and it just works.
No hard feelings :)
Seems like an unwanted side-effect
Hi, I wanted to find all occurrences of --require spec_helper
in my files. No problem, right?
:Ag '--require spec_helper'
Except that this bombs out with ag: unrecognized option '--require spec_helper'
Is there any way to use a search string that has leading dashes?
what if I always want to run ag with options -i
?
Hey! Just trying out the plugin and it seems to do what I want very well, however:
Is there any way of preventing it from leaving crap in the terminal when you exit vim?
The original ack.vim
just uses plugin/
, but this one has the frayed beginnings of autoloading.
Nice plugins autoload where possible. This should be nice.
the silver searcher itself now supports multiple file types.
like ag --cpp --cc ***
to seach both cpp files and c files.
but now ag.vim does not support that.
Would love it if I can have a larger window
Is it possible to enable to open the file and quit the buffer. I tried to this but it does not works. What can I do?
Could you make mappings changeable in .vimrc? (Like in https://github.com/Valloric/ListToggle -- and itegrate its functionality -- only two mappings really! if possible).
In current state I can't replace mappings which need 'l:matches_window_prefix' to be set.
As workaround, this file local var can be replaced with buffer local -- then I could use it in ftplugin for my own mappings.
P.S. At work I often search in kernel sources and preview feature 'go' is very useful for it.
But pressing 'go' for 20-50 entries isn't much pleasing. As temporary workaround I use direct mapping in ftplugin/qf.vim "nnoremap :copen". But in such case I can't use location lists (I need that l:matches_window_prefix, which local to your plugin only :( )
There is an error In "Configuration" section.
You should use ' instead of " because vims parser corrupts path, which you specify in "" but keeps untuched specified in ''.
Repoduced 10/10 with gVim on windows 7.
I know, its very minor bug, but anyway.
:Ag -g "some_filename"
shows matching files in quickfix window, but hitting "e" / "t" / whatever just opens an empty buffer.
Looks like ag.vim ignores the --color-match
option right now. Would be great if it could be supported. Looks like ack.vim doesn't have it either: mileszs#94
Some windows, like nerdtree windows have special properties, like certain sizes and properties (like not responding to C-w = ). Should we avoid opening results in those windows?
This could be used for displaying an error message when:
ag
command didn't work (if it's not installed or g:agprg
is wrong)And probably other things?
As I wanted to add a flag, I added this to vimrc:
let agprg="Ag --smart-case"
The problem is every line in quickfix begins with "|| " instead of the filename, e.g.
|| data/devices.txt:4:gadget
Not sure why that happens. The prefix is preventing quickfix from opening these files. It works fine without "let agprg", so is there any way to remove the double pipe?
Hi!
Is there a possibility to view multiple search results without overwriting old ones (different tabs)?
eg
I search :Ag "float: right;"
I see search results
I open new tab:
next I type :Ag sentences_hb
And got next search results
But my old ones (for float: right
) results are gone (in previous tab).
Is it possible to implement that?
Plugins like ctrlp and vinegar take into account the 'wildignore' option, which makes them show more relevant results more quickly. I think we should add an option for this, and turn it on by default (though the default is probably up for discussion).
almost a duplicate of #30, but for v
instead of gv
None of the shortcuts mentioned in the README work for me except the enter key to open a search result.
When I run ":Ag term" from Vim it finds the first file with a match and opens it.
The status line says "No matches for term" even though it found at least one.
It does not open the quickfix list in a split window.
When the Quickfix window is closed (q oder :ccl) and reopened (:copen), Ag's key mappings are no longer available.
Perhaps a new command can be added that reopens the Quickfix window with the already available results and sets up the key mappings again?
I am reading the code of reviewboard. https://github.com/reviewboard/reviewboard.git
you can see that , the second in the ag.vim output is one absolute path, where I expect it to be relative path.
The output of running the same command in shell gives the expected result.
Running gv
after :LAg blah
gives the following:
E121: Undefined variable: b:height
E116: Invalid arguments for function printf(":normal %d\<c-w>_", b:height)
E15: Invalid expression: printf(":normal %d\<c-w>_", b:height)
Press ENTER or type command to continue
All mappings should be double checked to make sure they work in both windows.
Hello,
I just switched from :Ack, and I love the speed of it. However theres one small issue. When I run :Ag foo
, it automatically opens first result in my buffer. Most of the times I use this tool merely to quickly find references using preview
window, and don't actually want to edit the file.
How could I achieve the desired behavior?
When you have g:aghihghlight=1 in your .vimrc and perform :Ag findstring, findstring is highlighted only in first opened file. If you navigate to the next search result from the quickfix window (or with :cnext/:cprevious) findstring is no longer highlighted.
The following patch fixes this:
--- autoload/ag.vim 2014-03-27 23:30:46.000000000 -0400
+++ autoload/ag.vim.patched 2014-03-29 14:25:27.000000000 -0400
@@ -71,6 +71,7 @@
if exists("g:aghighlight")
let @/=a:args
set hlsearch
redraw!
When using a terminal smaller in width than the length of the keys help text, i.e.:
ag.vim keys: q=quit <cr>/e/t/h/v=enter/edit/tab/split/vsplit go/T/H/gv=preview versions of same
This causes vim to show the "Press Enter or type command to continue" prompt.
How about an option to just not show the keys help text?
When I hit 'h' or 'H' on the results in the quickfix window, nothing happens.
Vertical split works fine.
(using terminal vim).
Originally reported on the vim_use mailing list here: https://groups.google.com/d/msg/vim_use/L9E3EJqd610/9o1Uq2p_9bwJ .
e.g. remove \<
and \>
and \V
(maybe only if they're at the start/end of the string?) when -l
or --literal
is present.
Something similar is already being done for -g
(file search), so I think this makes sense.
Related to #57 (comment) and #58.
There is currently a bug that introduces some wonkiness with getting the search results to show within the quickfix window. Here is the issue:
:Ag example
the search is run (in the background), the first result is automatically opened, the quickfix window is not opened, and the status bar says No matches for "example"
.:Ag example
will now correctly open the quickfix window, but now when you load one of the results into a buffer with o
the quickfix window's results are cleared away.I am using Square's maximum-awesome plugin set (default bundles here) on OS X Yosemite with vim 7.4.52.
Here are some screenshots illustrating the above:
Scenario:
I'm searching the official Rails repo (cloned on my machine) for the word "DHH" and get a lots of results.
When I'm now closing the results and search again for "DHH" I just get one result.
I tried this outside of vim and it worked like expected and didn't produce this odd behavior.
PS: I'm not sure if this is intended, if yes, a short description in the Readme would be nice.
Hi
Is it possible to just populate the quickfix window and not open the file.
I want to look at the quickfix list and then open what is required.
Thanks in advance
When I set g:aghighlight to enable search lighting, it works only if I don't specify a path to search. However, I like to include a path to significantly speed up my search.
e.g.
Ag searchthis
will highlight search results
`Ag seachthis here/' will not
Furthermore, when it does work, it turns search highlighting on for all future searches in all buffers (not Ag search, but in buffer /
searching). It would be nice if it were restricted to the quickfix search window.
Any way to do this? Thanks!
Is there a way to use regex with the ag command? I've been searching and cannot find an answer!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.