rking / ag.vim

Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack'
1.74k stars 131 forks source link

In correct shortcut listed on main git page. #126

Open drone1 opened 8 years ago

drone1 commented 8 years ago

https://github.com/rking/ag.vim

This page says that 'e' should be used (in the shortcuts section) to open and close a file, rather than what the help says, and what actually works, which is the 'O' key. Thanks!

sunflowerseastar commented 8 years ago

It doesn't appear as though 'O' is implemented. Are you looking at ack.vim? Or am I confused..?

drone1 commented 8 years ago

I'm looking at the page linked above in my first comment, this section:

Keyboard Shortcuts

In the quickfix window, you can use:

e to open file and close the quickfix window o to open (same as enter) go to preview file (open but maintain focus on ag.vim results) t to open in new tab T to open in new tab silently h to open in horizontal split H to open in horizontal split silently v to open in vertical split gv to open in vertical split silently q to close the quickfix window

For me, I have to press 'O' rather than 'e' to open a file and close. Don't see anything weird in my .vimrc, just:

let g:ackprg = 'ag --nogroup --nocolor --column'

sunflowerseastar commented 8 years ago

Sorry I wasn't clear. For me, 'O' does work for :Ack, and appears to be implemented in the ack.vim plugin.

However, 'O' does not work for me when using :Ag (pressing 'O' returns E21: Cannot make changes, 'modifiable' is off because it thinks I want to edit the quickfix list with the normal mode 'O' command), and it looks as though it is not implemented in ag.vim.

I am curious if you're maybe using ack.vim but thinking that ag.vim is handling your 'O' command from the quickfix list. That is to say, if 1) you have ack.vim installed, 2) you're setting the ackprg option to ag (per your let g:ackprg = 'ag...'), and 3) you're using the :Ack command—not :Ag—then you're actually using ack.vim, not ag.vim. (Note that in that scenario, you would be using the Ag search tool, but through the ack.vim plugin.) It's also possible that I'm confused. Can you confirm on your side that you are definitely using ag.vim and the :Ag command?