Colemak keyboards with Emacs or VIM [closed]
Asked Answered
H

8

28

I've been crossing things out on my TODO list. I've recently picked up Colemak. Next I wanted to learn Vim or Emacs. I was leaning towards Vim, however one of its benefits are sticking to the home row. With Colemak, the home row has been changed. I realize that I could remap the keys, but assigning the functionality to different letters is not extremely appealing to me (if there is any relation between letters and their function. I know movement is not correlated but I'm not sure on all the rest.)

I don't want to start an argumentative post about text editors, but rather receive comments from Colemak (or Dvorak) users about alternative keymappings and these two editors.

Thanks

Heintz answered 31/10, 2008 at 14:58 Comment(11)
I've never heard of that layout before this morning. Makes me curious as to how many keyboard layouts there areStraddle
As far as I know Qwerty, Dvorak and Colemak are the only ones that really matter.Jilljillana
I'm curious to hear your reasoning for going with Colemak over Dvorak. Since you're already remapping your brain, why not just go all the way and get the full ergonomic support of Dvorak? I find Colemak's argument for easier copy paste type operations a little weak when most of what you do is type.Return
@Tim: I've read that Colemak has the same ergonomic support as that of Dvorak, but also includes easier copy / paste / etc shortcuts. It also has a wider following and implementation.Seng
@Chetan: I hadn't read that when I was looking into things but doing some brief googling seems to indicate that you're largely correct, especially if you're a programmer. It seems like the prevailing anecdotal comments are that if you're still on QWERTY and you're a programmer, switch to Colemak. If you're still on QWERTY and mostly type english, switch to Dvorak. If you've already switched to either one, don't bother switching again. If you have actual research that you can point to I'd love to get a link to it.Return
@warren: "infinite". ;) mkweb.bcgsc.ca/carpalxReturn
@Tim: Yeah, I wouldn't switch if I've already learnt one or the other. They're both great, and Colemak is better for programmers, but again not by much.Seng
Some Vim user may want to have a look at this plugin: github.com/jooize/vim-colemak . Colemak key mappings for Vim!Amena
I'm a longtime vim user and I feel like hjkl is kind of a crutch. There are better ways to harness the power of vim than to walk around with single-character movements. I'm hoping my pending switch to colemak will break my hjkl dependency.Joeyjoffre
I stucked with the same problem when decided to switch off from QWERTY. And finally made my own solution: the layout that places most often used Emacs keys into more comfortable places. And it also solves QWERTY problems too. Well it may has sense only if you are look at the world through Emacs glass :) Keymacs layout: github.com/keyboard-ergonomics/keymacsDeane
Expandind on the answer to @warren, now there is Workman too. After reading a comparison on the Workman website, I decided to go with Colemak, but maybe in retrospect Workman would have been better even though Colemak has more support like vim bindings that I don't really like.Ashkhabad
E
8

Glad to see another Colemak user :)

For Emacs there really isn't a need to remap, since the initial "shortcuts" aren't designed to be close to each other. If anything, you're gonna be more comfortable using Emacs on Colemak than on Qwerty (at least I was).

In Vim it's a lot trickier since hjkl will be completely messed-up. Then again, I've always felt that hlkl was broken and should have instead been jkj; or ijkl, so a remap is probably a good thing. Here's a broader discussion about Colemak+Vim on the Colemak forum: http://forum.colemak.com/viewtopic.php?id=50

Empower answered 3/11, 2008 at 8:41 Comment(2)
I agree with HJKL. NEIO is the way to go :)Baroness
i made hnei style navigation for evil-mode (vim in emacs), and packaged it github.com/wbolster/evil-colemak-basicsCalculable
N
14

I'm using a similar set up to Graham (up, down, left, right, is hkjl (Qwerty hnyu)) but instead of using noremap, remap using langmap in my .vimrc:

set langmap=hk,jh,kj

This has the added advantage of changing other commands that use these movement keys (e.g. g, z and C-w) without having to redefine all these commands manually, i.e. C-wh moves up a window, C-wk moves down a window, etc.

Nassir answered 11/4, 2011 at 13:33 Comment(4)
This is awesome, thank you! There is just no getting used to the way the movement keys map out by default with Colemak, what with the up and down feeling upside down!Atal
Neat way to do the remap. However,I've been won over to @asgeo1's answer of not remapping at all. It now feels natural on Colemak to use the keyboard keys labelled "y", "n", "u" and "h" for down/up/right/left (corresponding to letters j, k, l, h), without having to reconfigure Vim for every server I SSH into.Pirri
I can see how that would be advantageous, at the moment whenever I ssh I have to remember to adjust back to the default way. It feels like flying a flight sim - push forward to go down, pull back to go up!Nassir
I've just discovered that this can actually subtly break vim plugins (noticed in paredit.vim) which use j/k/h for movement in their functions, so I'm going to try to adjust back to "flight sim" mode and not remap at all.Nassir
B
11

I have recently switched to Colemak and I also use Vim as my main editor.

I can tell you that there is no need to remap the movement keys - or any other Vim keys for that matter. Your brain will quickly learn the new positions of the movement keys. For the mnemonic keys there is definitely no need to remap - you want to keep the mnemonic meanings behind the keys.

If you remap the Vim movement keys you will be in the unfortunate position of not being able to operate a vanilla Vim with any real efficiency - for example if you need to SSH to a server. I argue that for most people that will be much more common than having to use someone's computer that does not have Colemak.

As well, there are Vim plugins you may get one day that will clash with your remappings, or you will read a Vim tip one day about a feature which you can't now use because you have remapped things.

It will be a real pain for you, so I wouldn't bother with any remappings.

Bargainbasement answered 11/12, 2009 at 2:5 Comment(3)
You are right unfortunately. I have remapped the keybindings and I experience all these problems very frequently. This is really frustrating.Progesterone
You are probably right about the remapping not being portable. But if the most used keys within vim are diagonal movements that's gonna be a strain on the hands right? The whole point (non historical) of using hjkl is that it's easier to reach than the arrow keys.Ashkhabad
@Ashkhabad - it's not a huge strain on the hands. The right index finger is responsible for all 4 keys (hjkl). That finger is the strongest and most capable of reaching above or below anyway. Since I wrote this answer, I've been using Vim for now 12 years with Colemak, and do not have any hand strain issues regarding hjkl. And it's better to use other navigation means most of the time anyway, i.e. f, t etc. Other unix programs, ie. less also use j/k for up and down too - it's best to keep things consistent. Remapping is just not a good idea IMOBargainbasement
E
8

Glad to see another Colemak user :)

For Emacs there really isn't a need to remap, since the initial "shortcuts" aren't designed to be close to each other. If anything, you're gonna be more comfortable using Emacs on Colemak than on Qwerty (at least I was).

In Vim it's a lot trickier since hjkl will be completely messed-up. Then again, I've always felt that hlkl was broken and should have instead been jkj; or ijkl, so a remap is probably a good thing. Here's a broader discussion about Colemak+Vim on the Colemak forum: http://forum.colemak.com/viewtopic.php?id=50

Empower answered 3/11, 2008 at 8:41 Comment(2)
I agree with HJKL. NEIO is the way to go :)Baroness
i made hnei style navigation for evil-mode (vim in emacs), and packaged it github.com/wbolster/evil-colemak-basicsCalculable
P
7

This in your .vimrc will change the cursor movement for Colemak without affecting other vim mappings, because it only affects the h/j/k letters.

  • up = h (labelled as "h" on the keyboard)
  • down = k (labelled as "n" on the keyboard)
  • left = j (labelled as "y" on the keyboard)
  • right = l (labelled as "u" on the keyboard)

Here is the mapping:

noremap h k
noremap j h
noremap k j
Pirri answered 3/2, 2010 at 6:27 Comment(2)
I like this solution a lot. I just wish it was better by default, though. I do a lot of pair programming with dvorak/qwerty users so i'd need a way to switch this on and off for it to be practical, thoughJeri
@bjeanes, you could keyboard shortcuts for swapping keyboard shortcuts, e.g.: nnoremap <F1> <Esc>:nnoremap h k<CR>:noremap j h<CR>:noremap k j<CR> <br /> nnoremap <F2> <Esc>:nnoremap h h<CR>:noremap j j<CR>:noremap k k<CR> <br /> Add that to your ~/.vimrc, and F1/F2 will swap between qwerty/colemak movement keys. If you mean swapping keyboard layout, not just Vim mappings, there should be an (OS-dependent) solution for that too ;-)Alveolus
R
4

I've run with Dvorak for a number of years now (probably ~4). I have also used vim for all of the standard reasons you have to use vim like things (less, config edits that have their own editors (visudo, etc.), etc.). Emacs was actually the first Unix program that I learned (I'm a native to the Apple world) and I currently picked it back up after being castigated by Yegge's ramblings about how ridiculously awesome it is.

From a strictly keyboard layout stance, I would say that Emacs is probably the winner here because no remapping is required. Other than swapping the Caps-Lock key for a Control key (which should really be done period, the Caps-Lock key is like every keyboard's high-school hickey), I would say that every keybinding is more comfortable to use with Dvorak than with Qwerty. I especially find the constantly used C-x and M-x bindings to be very comfortable to type.

However, vim is really no big deal. 'j' and 'k' are still right next to each other. 'h' and 'l' are at least conveniently on one hand and are on and above the home row. Other than that, it's simply about remapping the keys in your mind for doing things in the editor that you want to hae happen. I personally don't see any reason to remap anything, and I'm high risk for RSI (hence the switch to Dvorak). For keyboard centric apps like vim and emacs, the fact that I can use them comfortably unaltered should be fairly impressive. :)

Good luck!

Return answered 4/11, 2008 at 0:7 Comment(0)
O
3

I'm using Ryan Heise's solution for Vim:

I came up with the "NEST" navigation bindings which preserve the physical location of the up/down navigation keys (left/right are different but still on the home row):

N = down E = up S = left T = right

The commands for setting this up are on my Colemak page at the bottom:

http://www.ryanheise.com/colemak/

Mostly, these bindings allow you to use a regular vim cheat sheet to learn the commands, except for navigation of course.

Of the 4 keys assigned in N-E-S-T, the "N" ("n"ext search result) and "E" (move "e"nd of current word) were frequent but gobbled up. I remapped them back to their original QWERTY positions and so they are the only two commands that don't have their original logical names.

Taken from https://forum.colemak.com/topic/50-colemak-vim/p2/#p2514

Omaomaha answered 9/6, 2011 at 16:1 Comment(0)
E
2

I'm a vim+qwerty user (I've tried learning dvorak, but it turns out typing speed is not my rate limiting factor and I don't have RSI issues). Only the hjkl cursor movement keys in vi(m) are position dependent, everything else is mnemonic. I see on the Colemak layout, that h/l are vaguely left/right, but j/k are down/up. Nevertheless, I doubt that would be a significant stumbling block. You could either use the arrow keys instead, or continue to use hjkl and deal with the funny positions.

I wouldn't be inclined to try to remap the vim functions depending on the keyboard layout. That seems like too much potential confusion for me.

Excise answered 2/11, 2008 at 9:54 Comment(0)
C
1

Here is a previous post that should help you some. There is some discussion on there, some users don't remap. Some do.

I am going to remap over the weekend actually. I have for the past year used the default mappings, with Dvorak.

Chandos answered 31/10, 2008 at 14:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.