back

by ripe·4y ago·view on hn ↗
For people who ask, "why use text-only editors like vim or Emacs, when I can use a full GUI IDE?":

One of the reasons I haven't seen mentioned much is: I'm a touch typist, and I hate having to switch between mouse and keyboard! I have to take my attention off the screen. Slows me down. Disturbs my concentration.

With Emacs, I can work for hours without ever having to hunt for the mouse, or without even having a mouse plugged in. That's particularly nice for using my Ubuntu laptop on a lap desk, leaning back in my armchair. The best mouse is no mouse at all.

Yes, I know many IDEs have shortcut keys for some commands, but the basic assumption with GUI applications is that you have a mouse. Even if you learn the shortcuts, somehow you always end up having to use the mouse for some common task, e.g., to select a paragraph. That's why I never got to like a GUI IDE, despite having had to use Eclipse for years.

9 comments
I found I am unique, I never learned to touch type but at the same time reaching for a mouse really slows me down. I realized years into using Vim that the reason I love it so much is that I can do all my editing from the keyboard and because it is a deterministic state machine (modal) I can have a mental copy of the editor running in my head while I'm not looking at the screen. This is important to me because I look at my hands while typing. When I use GUI editors like VSCode it pops up all kinds of fancy bells and whistles that when I return my eyes to the screen it no longer matches the mental model I had in my head and I have to do a huge context switch to re-sync; just like how I have to context switch when I reach for the mouse. Am I the only one has this method of typing/editing? Praise the creators for Vim and Emacs editors.
When I was implementing a toy editor I read the neovim source code and to no one’s surprise the modes are just long switch statements - when in mode M and input key is K, do some action. It’s a simple program and your mental model is probably close to the vim source code!

For learning a lot of cool stuff about implementing my best book is The Craft Of Text Editing

http://www.finseth.com/craft/

I also find moving hand to mouse is a really frustrating context switch, so I ended up getting a roller mouse (https://www.contourdesign.com/product/rollermouse-red/) to use along with my main mouse. The idea is for lots of small things my hands stay at the keyboard but my thumbs can move the mouse so I don't incur a context switch.
All these friendly gooey things want to help you by popping up this kind of stuff. But luckily, some of them let you turn it off.

I've told IntelliJ and Eclipse and VSCode to please stop popping up suggestions, and let me type Ctrl+space to summon them.

Aaaah. Much better.

Drives me crazy that these types of programs always want to fill in the closing bracket for you. Like, as soon as you type an opening bracket, it sticks a closing bracket there. Completely interrupts my train of thought, why would I want the editor to assume it knows what I want and write things for me? Maddening. Especially something that messes with my internal thought process around the syntax "tree" that I'm trying to work out. I always disable it, but I have no idea how people put up with that. In Emacs on the other hand, it just highlights the matching bracket for you, so you easily know to type when you need it. Accomplishes the exact same goal without being so intrusive. I think there's a UX lesson to be learned there.
You are unique, but not in this respect. I write the same way, with a mental model of the editor state an integral part of the coding process.
Honestly stunned. Thanks for sharing.
I'm afraid you are the only one
I find it amazing how common it is for programmers to not be touch typists (I mean typing without looking at the keys). Like, isn't that something you pick up by the sheer amount of keyboard time?
Most people get by with pseudo-touch typing. They have most of the speed down, and look down at the keyboard occasionally, but they do not have the accuracy that is displayed in true touch-typing.
That describes me. I described it once as 'highly advanced hunt-and-peck'. I did learn to tough-type in school, but I didn't touch a computer until the following year and simply forgot it all. That was 40+ years ago. I get by well enough.
That sort of blows my mind. How can you not learn to touch type? It will take you a month at most and it greatly improves life at a keyboard.
IRC chatrooms got me much more comfortable with touch-typing than programming. There is too much time spent thinking when programming to feel slowed down by looking at the keyboard. IRC chats mean you have to be fast if you don't want the conversation to have moved on before you finish your message.
I don't touch type in the sense that I don't hold my fingers on the home row the way I was taught back in school. My home position for my right hand is shifted by one column, and I never use the little finger for typing. My hands move around the kit more than what a touch typist would be do.

However, I still type easily without looking at the keyboard, and I'm about as fast as the average typist, perhaps faster.

Could I speed up more? Possibly, but I don't feel that I'm slowed down by typing speed, and I find my way to type better when one uses a lot of special characters, as is common when doing programming and accessing Emacs keys.

I can type without looking but I still have trouble placing my fingers over the keyboard in the right initial place so I’ll often start a little off and I type so fast that I’ll type half a dozen characters before I realize and have to correct.
Most keyboards have a little raised bump on the F and J keys ;)
I'm not that old (30's) but we were forced into learning how to touch-type throughout grade-school. Pretty much any white-collar work requires it. Getting through university basically requires it (even humanities courses; good luck writing long essays without it). It's shocking that anyone who went through school in a developed country can't touch-type.
Which developed countries have courses in school to learn touch typing?

I have never, ever heard about it.

Edit: by touch typing I mean having your index fingers on fj and from there using ALL keys without ever leaving the starting position, and yes that includes shift, alt and control and special characters.

I know very few people who are really touch typists (I am a proficient one), and I don't believe for a second people are taught touch typings, it's a skill that requires consistent training.

You're assuming that most of the writing is done on computers - but depending on the discipline - it isn't : computers aren't nowhere nearly good enough to compete with paper / chalk (/ even whiteboard !) when it comes to mathematics-heavy domains.
I suppose it depends on your definition of touch typing. Back in the early 70s, before many people had heard of personal computers, I was planning a career in journalism. I had to learn my way around a keyboard, so I took a quarter of high school typing. It didn’t teach me to “touch type” in the sense of achieving 100 word per minute or whatever, but it was the solid foundation I needed for typing in college, in my (too brief) journalism career, in office work and systems admin work. I’m reasonably fast, and I don’t always look at the keyboard, and no one has ever complained about it.
I can type at warp 9, but never in my 30+ years with various computers and keyboards have I felt lack of typing speed or lack of laser focus on screen would be a drag on peogramming 'speed' or abilities even. However, it is a bit odd for someone spending few years behind keyboard not to pick up touch typing.. prime example being MDs.
I'm a touch typist, but emacs chords always bothered me. I feel much more content switching to mouse or track pad for things like switching tabs, picking files from a file tree to copy / paste or duplicate or whatever, etc.

That said, being a programmer and not touch typing definitely sounds odd to me as well

emacs chords always bothered me

I got carpal tunnels a few years back from emacs, which forced me to try https://ergoemacs.github.io/ . I like it a lot, it's more sensibly designed. I've found it a pain to install though...

unfortunately I can only really work for long stretches on a kinesis split keyboard - with the modifiers all the on the thumb. if they would finally make a bluetooth one maybe that wouldn't be so bad.
remapping caps lock to control helped me with emacs chords
It is simple, really: There are also many piano players who cannot make confident and accurate movements on the keyboard without looking at their hands! My process learning how to type on a computer keyboard without looking was very much like the process I experienced while working on my piano skills over the years: You graduate from fumbling with your hands and exhausting switching between looking at your hands and the sheet music to sight reading to playing with your eyes closed (if you want to). Though a lot of advanced players can and do play without sheet music and sight reading at all, interestingly, a lot of those players then keep looking at their hands instead! because the music progression is strictly following their mental model of the piece.
Yes, but I often work with different keyboards. The place I live has a couple of different stupid local variations, and then if I have an Anglosphere keyboard it's 50-50 between UK and US. Sometimes I change the "layout" and type as if I'm on a different keyboard, but usually the keys don't even physically match up. Then there are different types of keyboard, from super-compact to full numpad monsters and from chiclet to hefty mechanical, and then there's my shitty touchscreen phone.

I'd love to be able to type from muscle memory, but the keyboards keep changing!

Touch typing isn't about writing without looking at the keys, that's something that pretty much every dev I know does. It's about writing in an efficient way that minimizes finger travel, and zeroes palm and writ movement.

There's a reason F and J have bumps on them, or why we have two shifts, etc.

For anyone interested into relearning how to type efficiently I want to recommend this free website full of tutorials and exercises: https://www.typingclub.com/

> There's a reason F and J have bumps on them

Actually that’s a regression. At one point some keyboards (Apple IIRC) put the bumps on D and K, which made it much easier to notice when your hands were misplaced.

It’s easier to notice that the wrong finger has the bump than noticing that no finger has the bump beneath it.

to operate and use a tui like emacs with confidence and start typing at the speed of thought:

consider putting a photo of your keyboard next to your screen and painting the keyboard a nice uniform black.

your body-mind's intelligence will swiftly learn to position your hands and coordinate your/its fingers without adding things to unlearn later.

the photo of your keyboard near where you are focusing when looking at the screen makes a huge difference, one could start with just that.

I literally trained the correct technique as a child because I was so into computers. I'd argue children today are far less exposed to keyboards than people (well, nerds) my age were.
Maybe but I’ve typing since I was a kid on a Windows 95 and I still only know the gist of the keyboard and have to look down and correct myself every minute or so, so I don’t that’s they only reason. I actually think that typing without looking isn’t as important as people used to say it was for speed.
I was programming since 80s and had never managed to learn touch typing. I am a vegetable in this department. My fingers do remember some key sequences so when I press first key I could usually master the rest of the sequence without looking but then I have to look again.

I could probably put a gun to my head spend a month and learn it but I do not really feel it slowing down my programming (I spend more time thinking and drawing some skeletons) so I've never bothered.

I actually like it being a touch typist? Using the mouse gives me more movement and I like it. From my observation, there also seems to be a very high correlation between touch typing and carpel tunnel as well.
It's worth mentioning that Emacs is not a text-only editor, but is able to function in a text only environment if configured to. I think many people never consider giving Emacs a shot because they think it's purely a terminal based program.

Modern Emacs can be (and mostly is) compiled with GTK support and features a GTK interface, but can be launched in text-mode with a command line argument. If you don't mind using bleeding edge versions, there is a branch called "PGTK" that allows the GTK interface to run natively on Wayland!

> If you don't mind using bleeding edge versions, there is a branch called "PGTK" that allows the GTK interface to run natively on Wayland!

The two biggest Linux distros (Ubuntu and Fedora) are Wayland by default now. And the 'standard' Emacs distribution you install through the Software 'store' in both is GTK (which of course works). Wayland support isn't really a big deal anymore. I haven't come across any apps that don't work on Wayland.

Yeah, it is GTK but not pure GTK! It uses X11 drawing calls for some elements so it needs XWayland on Wayland. Pure GTK might be coming with Emacs 28 by the way.
At least on Sway (with the scaling settings I use), fonts are a bit crap (blurry) on xwayland and perfect on native Wayland.
Also a keyboardist, and you can pry my emacs from my cold dead fingers, but I still think it would benefit from a bit more ability to incorporate platform-appropriate keyboard-driven GUI widgets/arbitrary drawing. For example, if the minibuffer could look like a regular GUI text field + a drop-down menu, or a floating command palette, I genuinely think it would be a nicer experience (and would make it "look more modern" which is not a terrible thing)¹. Similarly for the mode line and fringes. If some of the peripheral elements could be enabled to escape the "everything is a grid of characters" paradigm I think it would be a net positive.

¹I've tried mini-frame, and it's fine, but it's still just a utilitarian grid of text.

On your last point, in terms of absolute speed, pointing your mouse to the paragraph and dragging to highlight is usually faster than the fussiness of multiple key presses and/or chord combos needed from a full keyboard setup. That is, unless you've macro'd a custom single key shortcut for just that particular action
Emacs has a standard shortcut for moving around in terms of paragraphs, so you don't need to customize anything. It's these semantic(ish) movement commands that really let keyboard navigation shine—moving around in terms of paragraphs, code blocks, matching delimiters is not only productive but also combines well with other commands and keyboard macros, which makes a lot of repetitive things easy to automate in Emacs but difficult anywhere else.
I have no problem going keyboard to mouse, but mostly because I use a macbook with touchpad exclusively. Reaching my thumb down right below the space bar to use the mouse is really not a big deal.
+ and basically I would generalize this across to all the common actions people typically use that are often easier with a mouse. And can even be faster, even with the extra hand travel to the mouse.
Never mind being "touch typist" I completely suck at typing in general. I think my cat could do a better job.

Still I hardly ever use mouse when using IDE's like Visual Studio C++ coding for example. It has shortcuts for everything.

I just started using VS Code a lot last weekend and I didn't find myself using my trackpad much. The Vim plugin, whatever it's called, allowed me to do the same things I do in Vim itself. I can't speak to the Emacs emulation, though, now that I think about it.
IntelliJ has a M-x equivalent and IdeaVim covers text editing. I literally never touch my mouse when using the IDE. I really don't think this is a compelling argument.
To add to this: yes, full blown IDEs have shortcuts but they are hard to explore, counter-intuitive and hard to extend.
I think JetBrains has a great system to it.

cmd+shift+a opens a command palette with every possible command in the IDE. It matches as you type the name of an action, and every action has a keybinding shown to the right (if it exists).

Every relevant button generally has keyboard shortcuts right on them.

And pressing cmd+e opens a list of gui interactions you've made so you can repeat them (things like focusing buffers, clicking on a file in the project file tree, etc.)

Basically, if you know cmd+shift+a, you're golden for learning commands and key shortcuts.

In comparison, emacs/vim are pretty awful. I've done a few tutorials of each and while I could have spent more time learning them, JetBrains makes it stupid easy to start learning the editor.