1

The question is quite intricate. I am using doom-emacs and evil and I am customizing the keys. Usually, something like

(define-key evil-normal-state-map "g" 'evil-paste-after)

would work. However, the g key seems to be quite overloaded with different functionalities. In my case g works as a leader key for many org-mode, outline-minor-mode and evil-mode commands. First I have a general question:

Is it possible in an easy manner to set the key g to nil for all the modes and to remap the original leader key g to some different key for example y, so all the commands which were initiated with g are initiated with y?
Then I could easily reassign the leader key and set the desired functionality to g key through the function above.

Or is there only a hard way of finding all the key-maps where g works as a prefix and disable each of them individually?
This would be quite tedious. As an example, I have the bindings

outline-minor-mode-map <motion-state> g j
outline-minor-mode-map <normal-state> g j
outline-minor-mode-map <visual-state> g j
outline-minor-mode-map <motion-state> g h
outline-minor-mode-map <normal-state> g h
outline-minor-mode-map <visual-state> g h

and I would need first to set them all to nil and this is only a small fraction where g is a prefix I suppose.

1 Answer 1

0

I found a partial solution to my problem. These outline bindings were produced by my own config file and I haven't even noticed it!

I had to comment out

  (evil-define-key '(normal visual motion) kmap
"gh" 'outline-up-heading
"gj" 'outline-forward-same-level
"gk" 'outline-backward-same-level
"gl" 'outline-next-visible-heading
"gu" 'outline-previous-visible-heading)

Furthermore I had to create the lines

(define-key evil-normal-state-map "g" nil)
(define-key evil-motion-state-map "g" nil)
(define-key evil-normal-state-map "g" 'desired command)

to make g the desired command (in my case the desired command was 'evil-next-line).

However this is only a partial solution. The problem is, there seems to be some bug, so the solution doesn't really work. After initial command execution after starting emacs when you try to execute the command again it seems to get remapped and which key: there are no keys to show shows up in the subline

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.