Modified Colemak for Programming
Asked Answered
V

3

16

Does there exist a modified Colemak keyboard layout designed specifically for programming?

I went cold-turkey on the Colemak keyboard layout a few days ago and I really like it for normal typing, but I have some issues for frequent programming characters like the ; (semicolon) key. A modified layout that has direct mappings for braces and parentheses would be nice.

Obviously I could remap these keys myself via trial-and-error, but I'm hoping someone has done some testing to determine an optimal layout for common language characters.

Vallombrosa answered 20/2, 2013 at 13:50 Comment(3)
Waiting only a few days to acclimatize is probably not enough to have a real sense of whether <kbd>;</kbd> (etc) are working out for you. Your question is quite old now though; how did you go? On the subject of enhancing Colemak, if you're on a Mac, check out Karabiner, which can be used to set up pretty much anything (such as layers, inverting your number row etc).Lines
@wincent I'm still on Colemak and use Karabiner, but I would not recommend switching away from QWERTY to anyone else. I'm a masochist - it's too late for me, although I would recommend getting an ergonomic keyboard like a Kinesis.Vallombrosa
Pinging you to let you know I updated my answer.Cowden
C
27

Background

I am obsessed with efficient workflows, and the results from my experiments are very compelling and I guarantee it is very much worth the endeavour. This is also my third major edit, and I have more or less settled upon the layout I use today.

I will be try to be brief and to the point.


Current Layout:

Highlight: Finger rest

  • Your fingers rest on the highlight

  • Wide Angle Mod: Right hand has shifted one column. Benefits:

    • Less stress on right wrist
    • Layout is now symmetrical
    • Shift R + Level5 is easier to reach.
  • 8 layer layout requires 3 modifiers:

    1. Shift
    2. Level3 usually known as Altgr
    3. Level5
    include "level3(lalt_switch)" // Left Alt
    include "level5(ralt_switch)" // Right Alt
  • level5 is very obscure and extremely useful to know about, if you wish to expand. For example, on my layout, it would allow for around 200 extra characters to be added.

How 8 Layers works

Layer:

  1. No modifiers
  2. Shift
  3. Level3
  4. Level3 + Shift
  5. Level5
  6. Level5 + Shift
  7. Level5 + Level3
  8. Level5 + Level3 + Shift

Numbers

Highlight: How you input numbers

  • Accessed solely on Layer3
  • A programmer who uses numbers often, is a bad programmer. See: https://en.wikipedia.org/wiki/Magic_number_%28programming%29
  • This was why it was taken off of Level1 ( No Modifiers )
  • For convenience, it is arranged in a number pad.
  • 1230, constitute the most common numbers, and hence are found on the home row.
  • The right hand number pad has close access to -+.,#%$*/\;:=, the most relevant mathematical operators.
  • I search for keys about 10× less compared to a standard 1234567890 layout. I find this much easier and more intuitive to use.

Alternative Characters ( Requires Modifier )

Highlight: Level Characters

The least common alternative characters were delegated to Level3 and Level5 modifiers. They were mapped with the following reasoning:

  • @ resembles Q
  • & resembles B
  • $ resembles Z
  • × resembles X
  • ~ resembles W
  • ` is on C, "aCute"
  • | is on V, "Vertical pipe"
  • % is on M, "Modulus"
  • # is on H, "Hash"
  • < and > Easy Access for writing html etc.
  • ^ is next to < and >
  • + and - is next to the Numbers, with - easiest to access

Alternative Characters ( No Modifier required )

Highlight: Non-Modifiable Keys

Generally the most common programming characters that you will type exist here:

  • ? ! in the corner, because they typically close off sentences. Colemak was designed that letters that end sentences are more common on index and middle fingers, and placing it here on the pinky improves hand movement. ! also remains on its original position.
  • [ and ] are easy access, because Regular Expressions tend to use them a lot. They mirror ) (.
  • ) ( are reversed because it is easier to roll the fingers from the pinky to the index finger. The following trigram is also very common: (); and works best in this orientation.
  • " is on an easy access area, and mirrors '.
  • ' is on the opposite hand as s which is important for the 's bigram.
  • { } are usually automatically handled by editors, so they are placed in the hardest to reach region.
  • * and / are for the /* bigram and are common vim commands.
  • \ is on the right hand at the far corner, to resemble Escape and to work best with the following bigrams, \t \n \r
  • ; : = are all similar, and resemble Return. Again, because they exist near the corners, and they typically end sentences, they work best on the Pinky and Ring Fingers.
  • Prior Next aka Page Up Page Down are directional keys in the middle. This is exceptionally useful on Thinkpad Keyboards, as they are right next to the Trackpoint. Even without the trackpoint, it is nice when it comes to just scrolling through documents. The reason why they are not the same as Page Up Page Down is to grant more flexibility for run configurations.
  • _ the underscore here works well for writing object names, and works well with the m_ and s_ bigrams. It also is not a letter because that makes shifting it a painful exercise.

Directional Keys

Highlight: Moving Up Down Left Right

  • Inspired by Vim
  • Without the "Wide Angle Mod", the thumb will cramp up reaching for Level5
  • Amazing for editting regular documents.

Letters

Shift + [A-Z]

Highlight: Alphabet

  • Capslock and Enter Removed and replaced by Shift
  • Shift's are replaced by Control
  • Shift's are 3× more comfortable
  • Control's are 5× more comfortable
  • Capslock was not missed. Prefer it as Shift over Backspace or Escape provided that I have access to those keys on Level3 or Level5

Return

Highlight: How one Returns

  • Placed on the o because in vim, its functionality is similar to Enter.
  • Sometimes can cause issues with Games which will not detect it.
  • Surprisingly, not a big issue. I would consider it maybe 1.3× more difficult to use compared to its original position, which is great tradeoff to be able to get Shift on the home row.

Functional Keys

Highlight: Functional Keys

  • Accessible by either modifier.

  • Backspace is on the left pinky, to be intuitive with the direction you are deleting.

  • Delete is on D, and is intuitive with the direction you are deleting.

  • Escape for some reason, feels best on the Ring Finger, rather than the pinky.

  • End and Home are inspired by a colemak Vim configuration:

    • InSert, which will go to the beginning of the line before editting.
    • Append being on the T, which goes the opposite direction.
  • Backspace is used 10× more ( Meaning that I will use the Home Row position 10× more, rather than its default position. ).

  • Delete is used about 20× more.

  • Escape is used about 15× more.

  • Home and End is used about 200× more often and utilized far more often, being especially useful in editting documents outside a vim environment.


Todo:

If you are up for the challenge, there are some useful ideas I have played around with, however was not able to formally add to the layout simply due to the difficulty of doing so.

In short, you could theoretically map characters or functions to the modifier keys, that only execute upon a key release. For example,

  1. Press Shift and no other keys
  2. If you release it within 1 second, Its alternative key would execute.

And that's that.


Lazy Installation:

  1. Go here: https://paste.ubuntu.com/p/TbJJkm2vxM/
  2. sudo vim /usr/share/X11/xkb/symbols/us
  3. Replace the contents
  4. WARNING: This will replace your default Colemak.

Configuration Files


Cowden answered 29/4, 2017 at 12:23 Comment(5)
Is this compatible with OSX?Pincince
@AdrianForsius Unlikely. I briefly looked up how to create a new keyboard layout, and it looks like that xkb is Linux only. If you do recreate it on Mac, please share it here.Cowden
@Cowden have you had a look at kmonad? github.com/kmonad/kmonad I use it to do what you described under TODO. When I "tap" an alt key, for example, I switch to another layer until I press it again. When I hold it in combination with another key, it behaves like a regular alt-modifier. You can do more things with shift, caps lock, and so on. For example, when I tap caps lock, it acts as escape. When I hold caps lock and hit another key, it acts as control.Ingratiate
@Ingratiate Does it work on both wayland and X11?Cowden
@Cowden it works on both wayland and X11.Ingratiate
C
2

I realize this question is already a year old, but here is my reply in case it helps anyone else.

This is a problem I have dealt with more often than I care to elaborate.

Suffice it to say that no, even after months of search, I have yet to find a suitable "Colemak for programming". It has the same annoyance as the usual QWERTY in overusing the right pinky for special symbols and a remap would have been desirable, but now that the mess is done, there won't be any immediate solutions.

There's only two things you can do:

1) Make a custom layout keyboard. There are various tools to do this on Win/Lin/Mac. This is neat as you can just rearrange everything as you see fit. The huge drawback, on the other hand, is that nobody else uses your keyboard layout, and if you ever are asked to type something on a computer, you will be in trouble, as your muscle memory is entirely different.

2) There is a keyboard layout called Programmer Dvorak, which aims to solve your problem. Here, the drawback is that programmer Dvorak is relatively unknown compared to the standard Dvorak keyboard, so same issue as above. It only rearranges special symbols, however, which means you could still use the standard Dvorak if so required (and it is far more widespread than Colemak). Be prepared to spend months in the transition, though.

Alternatively, you could try and opt for a third option and try to persuade the Colemak community in developing a programmer-friendly version of colemak. But this will take time and I wager you will find few supporters.

Commander answered 8/2, 2014 at 9:16 Comment(0)
C
1

have you had a look at the dreymar wide angle mods on colemak.com?

you could stick the ; in the middle of the keyboard for easy access with [ and ] above and below it perhaps?

Calabresi answered 25/8, 2013 at 21:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.