Conversation
The helper `ag#AgSetDefaultMappings` takes one argument, `matches_window_prefix`, which is determined by whether the matches window is a location list or quickfix window. Custom keymaps can now be given by setting the `g:ag_lmapping_func` and `g:ag_qmapping_func` options.
The option `g:ag_mapping_message_text` can now be used to display a custom message when the location list / quickfix window opens.
There was a problem hiding this comment.
I'm not against doing that, but wouldn't that require two keymaps? One for quickfix window mode and one for location list mode? The current implementation allows for a function that can take arguments and avoid duplicate code.
Again, I'm not against switching over to something like that, since ack.vim seems to do a similar thing. I'm actually interested in the logistics.
There was a problem hiding this comment.
You could have three optional sections. Global mappings, location list
mappings, and quickfix mappings. The most specific mappings would take
precedence, falling back to default values if we didn't find a specific
mapping or group of mappings.
On Oct 14, 2015 19:27, "Sai Kalidindi" notifications@github.com wrote:
In doc/ag.txt
#113 (comment):@@ -138,16 +138,36 @@ window is opened, or what size it is. Example: >
let g:ag_qhandler="copen 20"
<
+A custom command used to set key mappings for the location list. Default:_g:ag_lmapping_func_
+"call ag#AgSetDefaultMappings('l')". Example: >- let g:ag_qhandler="call AgSetMyCustomMappings()"
+<
+A custom command used to set key mappings for the quickfix window. Default:_g:ag_qmapping_func_I'm not against doing that, but wouldn't that require two keymaps? One for
quickfix window mode and one for location list mode? The current
implementation allows for a function that can take arguments and avoid
duplicate code.Again, I'm not against switching over to something like that, since
ack.vim seems to do a similar thing. I'm actually interested in the
logistics.—
Reply to this email directly or view it on GitHub
https://github.com/rking/ag.vim/pull/113/files#r42071618.
|
5 years later, still can't define key bindings |
It would be nice to be able to use the same keymaps from ctrlp's fuzzy file search with ag.vim.
The current functionality is kept as the default.