HACKER Q&A
📣 hannes0

Europeans, what keyboard layout do you use for programming?


Hi all, I want to get more serious with programming and realised that I have to learn touch typing. However, all the symbols for programming are on my German Mac Keyboard layout very hard to reach. I feel like everyone with an english keyboard has an advantage here. Just changing to the American layout wouldn't work, because I have to use umlaute, such as äöüß.

So, how do you do it? What layout do you use, especially if you're native to a language with special characters?

Additionally, if you are using not using a qwerty / qwertz layout, how well does it work with vim?


  👤 ad404b8a372f2b9 Accepted Answer ✓
I use the french layout at work and the U.S one on my imported (from the U.S) laptop. It hasn't been a detriment either way. I've also typed with a french keyboard using the U.S layout or inversely for convenience, occasionally. Both have worked fine with vim, even though I find vim pointless (unless you're sshing into a remote machine).

I have to say, the premise is wrong, you don't need to learn touch typing to be serious about programming. A good programming hour is 60 lines of code (heavy generalization, don't nitpick pointlessly), you don't need to type fast, you don't even need shortcuts or macros or whatever fancy IDEs or editors people spend endless time arguing about.

Don't make the mistake of doing the things you find satisfying (buying books, nice keyboards, customizing your IDE and OS for ultimate productivity, ...) instead of the things that are actually productive and hard: Actually programming something.

I'd recommend listing the things you think you have to do to be serious about programming, and plotting them on a 2D graph where the x-axis is how hard they are, and the y-axis is how much better they'll make you at programming. That will make it clear what you must do.


👤 tomjen3
Dane here. The default Danish keyboard is going to give you RSI/kill your hand 100%, because you need to type right alt+shift+7 to do an open squishing bracket. That requires you to turn your hand almost to its limits, and it is painful to do.

As a consequence everybody I know changes their layout to us english or something similar and then switch back when they need to type in danish for an email or a message.

I switched to programmer dvorak a long time ago, but I have no idea how well it works with vim.

Switching input options shouldn't be hard. On my work linux it is alt space (I think), on my personal mac I can either press fn or just hold down the key needed to select the special danish characters. So if I need to write to somebody that it is time to harvest the apples I can use hold down the a key to select æ and the o key to select ø (the message would then be "vi skal til at høste æblerne"), or switch over to a Danish keyboard and type the message directly.

But every OS since DOS has a simple shortcut to change your input language.


👤 nextos
US, with the typical ANSI (long) return key.

The trick is to use right alt as compose key. This way I can write virtually any character (e.g. á, ß, §, ō...) in an intuitive way. E.g. ø = Compose / + o, æ = Compose a + e, etc.

I regret not using ANSI much sooner. I switched 10 years ago and I couldn't be happier. All symbols are in the right place, which helps a lot when programming.


👤 timonoko
Luckily there is totally useless "§ ½"-key on Scandinavian keyboard. So I always do this:

    cat .inputrc
    "§": "{"
    "½": "}"
Also "å"-key is useless in Finland. So I have reprogrammed "å" with hippie-expand and other apropos-type functions.

👤 rlkf
I use a Dvorak layout for more comfortable touch typing, along with some changes I made to the numeric row to make it more suited for programming. For the "native" letters I use a European keyboard and map the extra key to Compose, instead of using AltGr. This will require some substantial investment in retraining, though. (In Vim the cursor keys are a little weird because they are based on placement, but the rest is mostly OK as they are mnemonics).

If you want to take the low effort route, I would just go for the US layout; on MacOS you can use the Option key to get the umlaut dead key. (On Windows, you would use the US International layout). Try this out for a while to see how often you really use the accented characters, compared to all the symbols used in programming; my guess is that you'll find it to be an insignificant bother.


👤 speedgoose
I use bépo, which is a keyboard layout designed for French. It’s not perfect for programming but I’m used to it and it’s still much better than Azerty or Qwerty.

Someone is building a new layout named optimot. It is optimised for French and English, and also taking programming into account. The author is doing a good job to test his layout with various kind of usage. I will probably learn it once it’s stable.

Vim is fine. I did remap a few keys in my Vimrc about 15 years ago, to get the shortcuts physically placed in the same way than a Qwerty layout.

Some text editors emulating vim can read my vimrc directly, or I have to remap the keys for them as well. It takes a little time once in a while but it’s worth it.


👤 RifatHimself
I am from Bangladesh. as a new programmer, I am using qwerty keyboard layout. I feel no disruption with this. and for my touch typing development, I am using a online typing practice platform - https://typingmentor.com

Hope this can help you out if you are a new or intermediate programmer. If I face any difficulties in future, hopefully I will share this also. Best wishes


👤 cydmax
I‘ve bought a ten less US layout qwerty keyboard (Keychron K3) for my programming work. There is a neat feature on macOS to type ‘Umlaute’. Just long press vowels and you can choose from all possible variations of the vowel. I’ve also build a custom Helidox Corne keyboard, but couldn’t learn the new typing system… (https://thomasbaart.nl/2018/11/26/corne-keyboard-helidox-bui...)

👤 Macha
I use an Irish keyboard layout (physically identical to a UK keyboard layout, just some extra dead key combinations).

It's sometimes annoying when video game consoles tell you to use ~ but they've mapped it to the raw keycode and you need to use ` instead, or with syntax that assumes ` is an easy key to type (fenced code blocks, looking at you), but it's not worth fighting years of muscle memory to change where I know quotes, @, # etc. are. If I was to put that effort in I may as well learn dvorak or something.


👤 lmarcos
International English. I like the L shaped return key. To type, for instance, ö, ó or whatever, I just press and hold the o key and select the adequate version with a number.

👤 yackfou
I moved from a German keyboard on a Mac to a US keyboard four years ago. And it definitely helped me to be able to touch type when programming.

I installed the USGerman Keyboard Layout [1] in macOS and have been using it ever since. It puts the umlauts at `alt + a|o|u|s` making it easy enough to type German texts as well.

[1] https://hci.rwth-aachen.de/usgermankeyboard


👤 throwaway67743
Standard IBM clone UK layout, everything else is subpar :D

👤 perakojotgenije
I use US keyboard layout for programming, then change layout with alt+shift if I need to type string with non-English letters and then change back to continue programming. Changing the layout takes a fraction of the second and is really not a problem.

👤 lioeters
I switch between several keyboard layouts, some of it custom made using Ukelele.

> Ukelele is a Unicode Keyboard Layout Editor for macOS

https://software.sil.org/ukelele/


👤 shirogane86x
Keyboard is standard Italian layout but i actually use eurkey because it has a US layout (which i find more comfortable for symbols) + all the accented variants for European languages (using altgr and letters). Pretty optimal for me.

👤 yorwba
Does macOS not allow you to have multiple keyboard layouts and switch between them with a shortcut?

On Linux I use fcitx to cycle through half a dozen keyboard layouts depending on which language I want to type in.


👤 ikeserbestian
I am using ANSI US layout even on ISO keyboards for programming.

But honestly, I can’t be sure if I’m touch typing or not. All I know, I can type at decent speed without noise and looking to keyboard.


👤 johncoltrane
MacOS + AZERTY layout + Vim + no touch-typing, here. It's all fine.

👤 eynsham
I use a compose key and the British layout. It’s fine for French, Spanish and German at least, and I can add my own sequences (e.g. for logical notation).

👤 iExploder
us querty for ages, i never use the accented characters my language has as it is easy to understand the meaning of what i type even without them. i think the same would apply to german

👤 marginalia_nu
American English QWERTY. (Swedish QWERTY is cruel and unusual.)

👤 tobbob
I always use UK layout.