-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom keymaps #113
base: master
Are you sure you want to change the base?
Custom keymaps #113
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.
|
||
|
||
*g:ag_qmapping_func* | ||
A custom command used to set key mappings for the quickfix window. Default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use a map, like ctrlp does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" [email protected] 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.