-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Convention for remapping layer's key bindings? #3018
Comments
I was able to remap the org-mode bindings but I had to look though evil-org code instead of just the org layer. I guess question 2 depends on the layer itself...
|
Look at key translation, for instance: (define-key key-translation-map (kbd ";") (kbd "l")) |
Haven't looked too into to much yet but as of now the key translation works but it also takes effect in insert mode which is not desired. Is there an equivalent to vim's |
Try: (evil-define-key 'normal key-translation-map (kbd ";") (kbd "l")) This should work only in |
hmm I see what you are trying to do but it doesn't seem to work for me :( ;; remappings
(evil-define-key 'normal key-translation-map (kbd "j") (kbd "h"))
(evil-define-key 'normal key-translation-map (kbd "k") (kbd "j"))
(evil-define-key 'normal key-translation-map (kbd "l") (kbd "k"))
(evil-define-key 'normal key-translation-map (kbd ";") (kbd "l"))
|
I tried this and I get the following error:
when adding this to the end of
Any ideas why this is happening? If I add it to the
it just says |
I'm trying to add the following binding: (evil-define-key 'normal evil-org-mode-map
"C-o" 'org-insert-heading-after-current
"C-O" 'org-insert-heading
) Doesn't seem to work. Also tried using |
This works under user-configuration. If you're wondering, these are keybindings for the Workman keyboard. (define-key evil-normal-state-map "h" 'evil-yank) (define-key evil-normal-state-map "k" 'evil-forward-WORD-end) |
Before using Spacemacs (i.e. just using Evil), I used the following with some success:
Seems to work alright in Spacemacs, and probably goes some way towards satisfying the OP's desires. Ideally, I think that the option to use |
We could leverage the new keyboard-layout layer in develop branch. |
To make some evil-org keybinding overrides, I had to use
Strangely, remapping
Which I don't understand, even after a quick look at https://github.com/syl20bnr/spacemacs/blob/a298a5a311dfe8b449b5f538740303f1ab3d5695/layers/org/extensions/evil-org/evil-org.el Both are in the body of |
@arnm This is an old post, but I spent hours trying to get this to work. The solution is:
(cross-posted from my answer on Stackoverflow) |
@LeMikaelF Thanks for posting a solution. A note about github comments, you can edit one of your comments or even delete it (for example the duplicate without the stackoverflow link), by clicking on the three dots |
@duianto Oops! Thanks for pointing that out, my mistake. |
@LeMikaelF Thanks for posting! Probably saved me a few hours too :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
I prefer
jkl;
tohjkl
and would like to apply this as much as possible across all layers. It is easy enough to remap the evil motion keys indotspacemacs/config
but I don't know if it's that simple for bindings specified in other layers.I specifically want to override the
gh
gj
gk
gl
in the org layer right now but I do see myself needing to remap other bindings specified in other layers.So my questions are:
P.S I'm new to spacemacs...I see there are a lot of conventions and was wondering if there was one for remapping bindings specified in layers.
The text was updated successfully, but these errors were encountered: