Doom-emacs: Support colemak keyboard layout

Created on 6 Aug 2018  ·  9Comments  ·  Source: hlissner/doom-emacs

Planning on trying out new layouts soon, figured maybe we should have a support module.

Might be based off https://github.com/wbolster/evil-colemak-basics ?

help wanted new keybinds backlog

Most helpful comment

A big +1 for this. There is also the way Spacemacs does it.

All 9 comments

A big +1 for this. There is also the way Spacemacs does it.

I've been using colemak for a year without needing any changes to the bindings, but I guess these might be better?

The Spacemacs method is just to swap out the keybindings hjkl for hnei. That way, you maintain the directional keys on the home row, like vim does.

FWIW, this is what's preventing me from switching to Doom from Spacemacs.

I remap n e i o to h j k l, o+O to l+L, i+I to t+T and n+N to f+F

$ touch ~/.doom.d/bindings.el
.el (setq doom-leader-key "," doom-leader-alt-key ",") (map! :n "t" 'evil-insert :n "T" 'evil-insert-line :n "l" 'evil-open-below :n "L" 'evil-open-above :n "f" 'evil-ex-search-next :n "F" 'evil-ex-search-previous :n "n" 'evil-backward-char :n "e" 'evil-next-line :n "i" 'evil-previous-line :n "o" 'evil-forward-char )
load it at the end of ~/doom.d/config.el
$ echo '(load! "bindings")' >> ~/.doom.d/config.el
I couldn't find docs on the web for these special strings, but I could find them by emacs's describe-key,
ctrl+h then press k, then the key you want to find the special string for.

@JonathanReeve

IMO evil-colemak-basics has the best keybindings for vim like colemak experience, if anyone is interesed in setting it up until there is a keyboard layout support, here is how I do it.

config.el

(use-package! evil-colemak-basics
  :after evil
  :config
  (setq evil-colemak-basics-rotate-t-f-j t))

(after! evil (global-evil-colemak-basics-mode))

packages.el

(package! evil-colemak-basics)

I'm a colemak-DH user with my own key rotation going on -- I think a flexible option would be if I could redirect bindings in the map! macro itself somehow (something similar to how evil-collection does it)

About to take the doom plunge myself. What is the recommended way to remap keys? Is wis's suggestion above the way to go?

I haven't met another colemak user who uses my bindings. It's sort of like half of what https://github.com/wbolster/evil-colemak-basics does. Here's what I do in vim

" h/l stay in default colemak locations
" n/e remapped to down up
nnoremap n gj|xnoremap n gj|onoremap n gj|
nnoremap e gk|xnoremap e gk|onoremap e gk|
" Use k/K for next/previous search hits
nnoremap k n|xnoremap k n|onoremap k n|
nnoremap K N|xnoremap K N|onoremap K N|

About to take the doom plunge myself. What is the recommended way to remap keys? Is wis's suggestion above the way to go?

I haven't met another colemak user who uses my bindings. It's sort of like half of what https://github.com/wbolster/evil-colemak-basics does. Here's what I do in vim

" h/l stay in default colemak locations
" n/e remapped to down up
nnoremap n gj|xnoremap n gj|onoremap n gj|
nnoremap e gk|xnoremap e gk|onoremap e gk|
" Use k/K for next/previous search hits
nnoremap k n|xnoremap k n|onoremap k n|
nnoremap K N|xnoremap K N|onoremap K N|

I do have the k/K setup, along with the down/up; some details here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

governorgoat picture governorgoat  ·  3Comments

idoo picture idoo  ·  3Comments

Vvkmnn picture Vvkmnn  ·  3Comments

rgrinberg picture rgrinberg  ·  3Comments

gilbertw1 picture gilbertw1  ·  3Comments