-
Notifications
You must be signed in to change notification settings - Fork 52
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
binding for <C-tab> doesn't work in god-mode #157
Comments
Thanks for reporting this @dadinn! |
It looks like this is due to God mode getting confused by the many ways key bindings for the TAB can be defined. There needs to be some refactoring done for looking up commands for multiple keys i.e. |
Oh, before I forget to mention, a possible workaround for this issue is to define a keybinding for TAB in (define-key god-local-mode-map (kbd "TAB") 'indent-for-tab-command) ... or with (use-package god-mode
:bind
;; ...
(:map god-local-mode-map
("TAB" . indent-for-tab-command))
;; ...
) This is slightly roundabout, but it should work. |
The "roundabout" solution seem to have worked! I've also changed the binding for company mode to be |
Thanks for confirming! |
Uh, oh... I've just realised there seems to be a problem with this solution. My above configuration prevents If I take out the TAB binding from the god-mode-local-map, then C-h k shows that god-mode would interpret the TAB key as C-TAB. It seems to me the problem is that my |
Maybe there has to be an additional mode-map for Alternatively, the solution could be to create a utility procedure similar to Not sure, do you think that would work? |
You can always modify the order of items in
Binding to a custom function is a good approach to having different actions based on certain conditions. (defun org-cycle-or-indent ()
(interactive)
(if (eq major-mode 'org-mode)
(org-cycle)
(indent-for-tab-command))) Interpreting the Unfortunately, I simply cannot recreate this in a minimal config with the |
Based on your suggestions I came up with the following:
It works quite well for me. It allows you to bind different tab-command to execute for different major-modes while It happens that Other modes can be added easily by adding an additional pair to I am adding this here just as a reference for anybody who has the same problem. I don't think anything should be changed in |
That looks good, @dadinn! This sounds like it might be useful to others so I'll add something to the README with your example. |
I've tried to configure
<C-tab>
key-binding to callindent-for-tab-command
, while usingTAB
forcompany-complete-common-or-cycle
, or alternativelycompany-indent-or-complete-common
.Yet, when in god-mode pressing
TAB
always calls company's completion.My expectation is that in god-mode
TAB
would always indent instead.The text was updated successfully, but these errors were encountered: