mileszs / ack.vim Goto Github PK
View Code? Open in Web Editor NEWVim plugin for the Perl module / CLI script 'ack'
License: Other
Vim plugin for the Perl module / CLI script 'ack'
License: Other
I've modified the plugin by adding my own mappings so that when I move up and down (j and k) in the quickfix window the selected file is previewed (equivalent to typing "go"). My question is this: "Could this be made into a configuration option so I could set it from my .vimrc instead of having to modify the plugin source?".
Hey
sometimes it would be really nice to be able to search for the current selection.
:Ack! '<,'>
At the moment this returns some errors:
Error detected while processing function <SNR>19_Ack:
E40: Can't open errorfile /var/folders/l8/1p3_btjs0y7bcw5k7df81czm0000gn/T/v9uVjcT/1
Maybe I am missing something here and this is already possible with some mapping.
Just let me know then.
I use haskellmode-vim and when I have a buffer open which is has the haskell filetype, invoking :Ack! always gives an empty quickfix window, even though the same query returns results when run from the shell prompt.
Here is a diff on ":set all" output between a plain buffer (where :Ack works as expected) and a buffer with the haskell filetype: https://gist.github.com/1688263
Sorry for filing this as an issue, I'm just out of ideas on how to debug it and could use some help with that. My whole vim config is available at https://github.com/arnar/vim-config
I can never remember all of the flags for Ack, especially when I need to do something like search only file names, etc.
I would like :Ack and others to have completion so that I can fill in possible flags.
I cloned the latest Ack.vim and had it installed using Pathogen (amazing plugin if you haven't tried it). When I went to use the bang option to prevent opening the first result (thanks for adding this feature, btw!), I would get:
|| /bin/bash: ack -H --nocolor --nogroup: command not found
as my error message in the quickfix window. This seemed symptomatic of the ack script not being in my $PATH or something like that, but ack worked fine from my shell prompt. As it also did with all the flags passed to it (-H --nocolor --nogroup --column
) in the Ack.vim script.
Eventually after much poking, I saw the following line was in a "if !exists("g:ackprg")
block in the script. Even when I added the commented out line to let g:ackprg.... to my .vimrc, the plugin still didn't work.
So finally I just removed the if !exists
block and left the blow line in the script:
let g:ackprg="ack -H --nocolor --nogroup --column"
Now it works great!
So..maybe reconsider the need of that if block??
It would be great if this had a feature similar to ctrl-p, where you can somehow signal to ack.vim to find the first git/svn repository that the current working directory is in, and then search from that root.
Sometimes the search freezes and freezes the complete macvim window. Sadly I can't reproduce it but I think it has something to do with the NerdTree. Everytime the search freezes, NerdTree was open.
I'm trying to use the "o" keyboard shortcut to open a file from the quickfix window but I get:
Cannot make changes, 'modifiable' is off
It seems to be trying to do "insert newline below" so it's failing. This is normal VIM behavior isn't it? What am I missing?
Is it possible to close the split window with a simple keystroke ? e.g. esc ?
Is posible to search words by Ack like this?
Ad.with_*some_scope(:params[:scope])
and press something like <leader>vv
to search :Ack with_some_scope
if you ack.vim for something and open a file found, it leaves open a new empty unnamed buffer :( :( :(
Have been struggling with this one for a while. It's not a bug but more my ignorance of ack I suppose, sorry about that.
I would like to find a way to search in all the files of a 'project', meaning the current directory and subdirectories, while honoring my .ackrc
file.
:Ack somestring
This finds all the occurrences of somestring in the open buffers. That's fine but not what I want, I want to find a way to include the files that aren't opened yet as well.
:Ack -u somestring
This comes a little closer to the solution. It now finds all occurrences of somestring, even if the file isn't opened yet. Problem is this also includes my log files (in one of the subdirectories) and my .git directory, meaning the search doesn't only takes ages but also finds a lot of useless matches.
The log and .git directories are excluded in my .ackrc
file but I think adding the -u
parameter tells ack to ignore that file. Is this correct?
So, is there a way to get all occurrences of somestring in the current directory and subdirectories while following the rules in the .ackrc
file?
Thanks!
It continues saying "Searching ..." if something should have been found, and returns a blank quickfix if there is nothing found (as it should). This is an issue with the current state of master (e93f693). It works fine in vim, but is an issue in MacVim.
When I use Ask a new buffer
#h "[No Name]" line 1
is append to buffer list.
Hi,
small problem when searching a directory containing non accessible files (e.g. cache files that were created by a daemon's user). Those error messages are interpreted as matches from ack-grep and displayed accordingly. Since ack-grep seems to properly send these errors to STDERR, a quick fix would be to make the system call using "2>/dev/null".
Detecting and properly showing these messages as error-messages would be even better.
thanks,
Tobias
Added as recommended for Debian / Ubuntu:
let g:ackprg="ack-grep -H --nocolor --nogroup --column"
but getting "Unknown option: column"
Partially works without column, i.e. displays result in quick search, but not opening in a split when I hit [Enter]
Hi there,
Is it possible to configure Ack.vim so that it does not auto-open the first file which matches the search term?
Cheers,
Alastair
Is there any way to open all files return from the ack results into the buffers? It's easy to open each file individually, but I would like to open all of the files that are returned.
So accidentally hitting a file that is one line long and hundreds of characters long might wrap for 15+ lines... can we get an option to fold results with too may lines by default?
When I run vim from OS X's (10.6.7) Terminal or iTerm apps and use the Ack
command it works as expected, but upon closing vim all of the search results have been printed in the terminal window.
This does not occur when using MacVim even if it is launched via the mvim
command.
So in vim I would :Ack, and then get back instead of a line match, a blob match like grep -C 2
would do, for example. /cc @jacobo
Line 15 (https://github.com/mileszs/ack.vim/blob/master/plugin/ack.vim#L15) should read
let g:ack_apply_qmappings = !exists("g:ack_qhandler")
instead of
let g:ack_apply_mappings = !exists("g:ack_qhandler")
When using Ack to search a Javascript project tree (Node.js), the new window shows no results or if shown sometimes, it clears the results when I choose any result.
When I use the ack from windows command prompt, it displays perfectly all results found.
Using gVim on Windows XP with ack-standalone.pl.
Hi,
I would like to type :ack instead of :Ack! when searching. Is there a simple way to setup an alias or something to do this?
The ! is passed as an extra argument from looking at the code.
Would you recommend I just fork the project and change the code, or is there an easier way?
It's helpful to Freebsd user to see installation in README
When I invoke :Ack with no arguments, I'd like the quickfix window to open, showing me the results from my last :Ack search. Would you accept a patch for this feature?
What do you think about preferring ag
if it is installed?
(Or, perhaps we could add an :Ag
command?)
I profiled it and it's a bazillion times faster.
I can see the result of :Ack something in a hsplit below. But the behavior of quickfix window is weird o instead of opening the file tries to open a line and give error modifiable is off. Nothing else seems to be working like v, t, h, q...Am i the only one facing this?
I'm using HAML + JS, so I need to search for ids i.e. "#message". However, when the following search returns nothing in vim:
:Ack "#message" -Q --haml
I read all the options for the ack command so I think I'm using ack properly (I could be wrong). So is this me misunderstanding the '#' symbol in the context of vim, or is this issue from elsewhere?
I often need to search for strings that begin with "#" when finding id divs in haml/css
However Ack.vim explodes when using:
:Ack -Q "#something"
error:
E194: No alternate file name to substitute for "#"
ack -Q "#something"
works fine from the command line so something in ack.vim is screwing it up
Hi, great plugin. I'm using Snow Leopard, and in both the latest MacVim and vim 7.2 hitting return after searching doesn't open the file. It's highlighted, but nothing happens.
This was an oops. :-)
It would be awesome if y'all would tag and/or branch stable releases. Apart from the benefits it would have for developers working on ack.vim (like, being able to easily check out the code that people are ostensibly using on their machines, for instance), it would also be a boon to those of us using pathogen to manage vim plugins. We could submodule the "stable" branch (or whatever you want to call it) and then just always have the latest stable branch. Right now the choice is between manually managing it with the .tar.gz from vim.org or getting potentially unstable code.
When I'm acking for something it is VERY rare that I want to lose my current place in my open tab, I just want to see the usages of some word or phrase. By default Ack will overwrite your buffer with the first match and I can't seem to find a way to turn this off. It's very annoying frankly, if I forget to open a new tab before acking I lose my place and have to go buffer hunting.
When I use :Ack I would like to see search results but choose which result to open. Oftentimes, I don't want to open the first search result but instead continuing editing the buffer I'm editing.
:make
supports this with the alternate :make!
command. Hopefully something similar is possible for Vim's external grep command functionality?
A help section toggled with some key (like ?
) to print key bindings would be seriously awesome.
NERDTree and Gundo have that and it's really useful at least when just started using it.
Hi,
can you add tags in .gitignore file?
Useful when we use pathogen.
Thanks,
Marco
is there any way to search in multiple directories ?
it will be a great feature to have a configurable list of directories in vimrc in addition of current directory.
usefull to find patterns in external library
After updating to the latest, if I run the :Ack command to search…
:Ack 'button'
no results are produced. Running ack in Terminal works as expected. Is there something I need to update in my .vimrc to get it working?
Thanks!
When searching in large project trees it would be very useful to execute
:Ack
asynchronously in the background.
I am not sure about how to implement this and if it makes sense at all, but
wanted to request it.
Here is some reference to the Vim Wiki:
http://vim.wikia.com/wiki/Background\_grep\_searches
Your docs assume that the reader knows how to use the split-window grep thing. I didn't, and so had to hit #vim because the docs themselves weren't very clear.
Maybe a crash course in using this functionality, or pointers to an explanation, would be helpful to the newbies like me.
:Ack "hello|wello"
gives me
Searching ...
Error detected while processing function <SNR>20_Ack:
line 16:
E40: Can't open errorfile /var/folders/If/IfZlMN-8G3OpvJi2H-YbLk+++TI/-Tmp-/v56w6f0/5
Whereas
ack hello|wello
on the command line works fine.
Wherever you're referring to petdance.com/blahblahblah in the docs, please refer to http://betterthangrep.com/ That's the permanent home.
Please explain in the README what :AckAdd, :LAck, and :LAckAdd do. For those who don't really know much about grep.
Searching with :Ack pattern
takes ages compared to searching from the terminal $ ack pattern
How can I make ack-vim ignore the files and directories I´ve specified in my ~/.ackrc ?
Cheers,
martins
NERDTree has some really slick commands for file node mappings. These could translate really well to ack.vim.
o = open (same as enter)
go = preview file (open but maintain focus on ack.vim results)
t = open in new tab
T = open in new tab silently
also some nice ones to open in split mode.
plz implement. thanks!! :-))
On MacVim build 57, how can I stop a search that is running (and taking forever ! )
Thanks
Since the lastest deploy on master, my ack.vim has been acting weirdly
Everytime I ack for a term, say controller
, an error like this gets spat out
Note, I'm using the_silver_searcher as my ack command,
let g:ackprg = 'ag -S --nogroup --nocolor --column'
It even behaves the same way with the default ack command.
And yes, I have both the_silver_searcher
and Ack
instalelled and working.
It would be nice if the search process would not block the complete interaction with vim
so that I can edit code while searching for stuff.
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.