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?
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.
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.
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.
cat .inputrc
"§": "{"
"½": "}"
Also "å"-key is useless in Finland. So I have reprogrammed "å" with hippie-expand and other apropos-type functions.
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.
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.
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
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.
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.
> Ukelele is a Unicode Keyboard Layout Editor for macOS
On Linux I use fcitx to cycle through half a dozen keyboard layouts depending on which language I want to type in.
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.