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

Key mappings lost when reopening Quickfix window #48

Open reinerh opened 10 years ago

reinerh commented 10 years ago

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?

losingkeys commented 10 years ago

I'm not sure if those mappings can be set per-buffer, but I'll check that. Another thing to note that is if you do something like:

let g:ag_qhandler="copen 20"
let g:ag_lhandler="lopen 20"

Then the quickfix/location list windows will open larger... but not when you do :copen, because those variables only change how :Ag commands work.

Maybe it would be good to have an :AgLastSearch or similar command that:

  1. opens the quickfix/location list (depending on what was opened last? or should there be an :LAgLastSearch too?)
  2. reapplies the mappings
  3. Uses the handler variables so the window is the right size/in the right spot