News for hackers. Stuff that matters.
Re:Vim is touch-typing on steroids by p-e-w on Friday January 13, 2023 @12:38AM (#34364336)
When engineers report that switching to Vim has massively improved their productivity, I can't help but think that the way they work must be very, very different from my own.

When I "program", 95% of what I do is read documentation and other technical resources, conceptualize what I want to happen, and construct the corresponding logic flow, while trying to anticipate potential problems and corner cases. In other words, most of what I do doesn't involve touching the keyboard at all.

If Vim magically tripled the speed at which I'm able to edit text, I doubt it would have a noticeable impact on my overall productivity. In fact, even if you gave me a brain-computer interface that allowed me to manipulate text at the speed of thought, it wouldn't matter much. I touch-type at around 70 WPM, which is very average, but if I two-finger typed at 15 WPM instead I would still be able to produce exactly as much code as I do today.

Simply put, text manipulation is not at all a productivity bottleneck for me. I need much more time for thinking about code than I need for writing it.

Is this really unusual? How do people operate for whom Vim gives a productivity boost? Does code just flow from their brains into their fingers? I don't get it.

Re:Vim is touch-typing on steroids by Panzer04 on Friday January 13, 2023 @12:42AM (#34364353)
I think it's rarely a productivity bottleneck, but that doesn't mean that Vim keybindings and navigation aren't superior in the vast majority of cases to what most people are doing - which is scrolling, mousing about, etc. Vim keybindings significantly accelerate the editing and browsing of existing code in-editor.

It also has the convenience of being a fairly common set of keybindings in editors nowadays, as many have an extension that gives Vim keybindings without having to go all-in on a CLI-style Vim editor.

Re:Vim is touch-typing on steroids by p-e-w on Friday January 13, 2023 @12:53AM (#34364406)
Every modern code editor has character-, word-, subword-, line-, and page-based navigation, as well as "jump to symbol" functionality. Bookmarks, paragraph navigation, and similar are also very common.

I fail to see how Vim is supposed to be superior to that. It has essentially the same navigation features, with different keybindings. And the idea that those different keybindings are somehow "better" is a big [citation needed].

Re:Vim is touch-typing on steroids by Panzer04 on Friday January 13, 2023 @01:02AM (#34364458)
How common are the keybindings used in existing editors? I must admit I haven't ever really noticed the hotkeys/keybindings in editors - until I started using Vim bindings instead. There's likely a large crossover between people who use a lot of hotkeys and people who look into learning something like Vim. If they change often across editors, it wouldn't surprise me that they aren't often used, so don't get much evangelism compared to Vim (which has been more or less the same for decades)

I only use a small subset of Vim's shortcuts - but most text editors I've used I'd imagine don't have the breadth Vim does (or they do a really poor job of documenting it). Can you point out a doc page for some IDE with similar navigation capabilities to Vim?

Re:Vim is touch-typing on steroids by p-e-w on Friday January 13, 2023 @01:21AM (#34364535)
> How common are the keybindings used in existing editors?

The whole point of widget toolkits is that the keybindings for input fields are the same everywhere. I use Linux and almost exclusively run GTK-based apps, and every text input across the whole system behaves the exact same way, with consistent keybindings for navigation, undo/redo, copy+paste etc. This is how good UI should work.

Platform conventions are important, and it's the job of individual programs to adapt to them – not the other way round. Vim fails big time in this regard. Can you make Firefox's form inputs use Vim keybindings? If not, there's your inconsistency already.

Re:Vim is touch-typing on steroids by xeyownt on Friday January 13, 2023 @01:45AM (#34364672)
> Platform conventions are important, and it's the job of individual programs to adapt to them – not the other way round. Vim fails big time in this regard. Can you make Firefox's form inputs use Vim keybindings? If not, there's your inconsistency already.

I disagree with that. And the world doesn't have to be perfect.

If you use Vim and you like it (it takes LOT of effort), you will adapt the platform to the Vim ways whenever possible. Everytime I encounter something I cannot vim-ize, I'm pissed but I have to put up with it. It's like working with Windows.

For the browser, you can use Vim binding for navigation, and edit with Vim. But again, this is not mandatory per se to benefit from Vim as a developer.

Re:Vim is touch-typing on steroids by kovac on Friday January 13, 2023 @02:30AM (#34364906)
> Can you make Firefox's form inputs use Vim keybindings?

Do you mean something like this: https://github.com/glacambre/firenvim?

Re:Vim is touch-typing on steroids by p-e-w on Friday January 13, 2023 @02:36AM (#34364949)
Yes, but I mean without an ugly hack that involves spawning a process every time you want to edit a browser text field.
Re:Vim is touch-typing on steroids by worksonmine on Friday January 13, 2023 @09:19AM (#34368047)
It's not an ugly hack, it's about not reinventing the wheel. Pure js solutions also exist but they're a subset of the features, and using native vim gives you the benefits of plugins you already have on the system.

It's a feature, and it follows the unix philosophy. But I get that not everyone needs or wants it.

Re:Vim is touch-typing on steroids by ablob on Friday January 13, 2023 @09:43AM (#34368345)
"Yes, but ..." is a great way to move your goalposts.

On another note, do you expect your hotkeys from your Office program to work in a Firefox form field?

Re:Vim is touch-typing on steroids by Shorel on Saturday January 14, 2023 @03:56PM (#34384096)
> There's likely a large crossover between people who use a lot of hotkeys and people who look into learning something like Vim.

Please no. My keyboards have cursor keys. I really appreciate the freedom not to have to remember if I am in insert mode or in edit mode.

And yes, many of my shortcuts involve the cursor keys and the rest of the extended keyboard keys. Also, the function keys. These keys exist for a reason.

Re:Vim is touch-typing on steroids by unsignedchar on Friday January 13, 2023 @01:29AM (#34364581)
vim has had these keybindings/controls as primary features for decades, and people that have these in their muscle memory the benefits have accrued over a long time and a number of different platforms.
Re:Vim is touch-typing on steroids by worksonmine on Friday January 13, 2023 @09:08AM (#34367937)
Not a scientific source, but there's probably a reason behind the popularity of evil mode for emacs, and vim plugins for just about anything (yes I know emacs is often the default, but that's for practical reasons like Ctrl+a/e is easier to add than 0/$).

My pinkies love me ever since I started using vim. For me it's not the specific keybindings, but the modal editing allow more uses for the same keys depending on context and less need for modifiers.

Re:Vim is touch-typing on steroids by twobitshifter on Friday January 13, 2023 @04:46PM (#34374329)
All of those keybindings are not composable, vim is. you can find with a shortcut, but vim can “dtr” to delete all text up to r. or maybe you want to delete 3 lines, 3dd will do that. Once you recognize vim is like a language for editing, you’ll get it.
Re:Vim is touch-typing on steroids by rraghur on Saturday January 14, 2023 @02:04AM (#34377973)
You aren't wrong... But the base vim keybindings and modal nature make navigation extremely efficient instead of chorded keystrokes. Then, most editors(vscode, jetbrains) have decent vim binding support via plugins. Now, you're 80% efficient since muscle memory kicks in and you can just focus on the code better
Re:Vim is touch-typing on steroids by Shorel on Saturday January 14, 2023 @03:51PM (#34384053)
I think the reason is that in VIM, you either learn the shortcuts or you just can't do anything.

In other editors, you can learn the shortcuts, or you can just monkey around.

But it is true, and I agree, that learning how to use YOUR editor gives great dividends.

In my case, my editor is Sublime Text. I have extensions and configurations I really need, because now I am used to them. Yes, I know the commands to navigate by word, line, block of code, or even use the right side minimap (with git colors for new and edited code) to move faster through the code.

Also: some users, even here in HN, underappreciate the mouse. But every single ex-StarCraft player knows that mouse+keyboard can be ridiculously fast when being used by trained hands.

At least for me, I can select and move, or reindent, or whatever, a chunk of code much faster with the mouse than having to know how many lines it is and then typing the equivalent command.

So yes, learn touch typing, and learn how to use your editor. It matters. What doesn't matter is if your editor is vim or not.

Re:Vim is touch-typing on steroids by Aperocky on Friday January 13, 2023 @12:53AM (#34364408)
Do you write config files? Do you copy similar unit test structures? or perhaps have you ever found a mouse/touchpad annoying?

If purely going off programming speed, probably won't improve much. Most of the time is spent thinking. But it helps reduce annoyance in many other situations - I'm not annoyed when I think, but I'm annoyed when I have to move the cursor, drag it and do it 10 different times when in vim the same is burned into muscle memory and can be done without any thought process, over some config file that I must edit now but not that often enough that it's worth creating a script or template, and then the same apply to templates as well and all levels of abstraction.

An extremely common scenario is to copy the content from one enclosed parentheses and into another, and similar class of problems. With vim it's just a few keystrokes, but without it's lots of cursor and drag. These common scenarios are why people use vim bindings.

Oh and I can do all of that in the terminal of a remote machine, which happen to have enough memory to run a massive integration test, and build all things a lot faster.

Re:Vim is touch-typing on steroids by xeyownt on Friday January 13, 2023 @12:57AM (#34364426)
If I would type at 15 WPM, I would be MUCH less productive than I am today for sure.

The point of using Vim, is that you boost your keyboard interface to the maximum. Obviously, using Vim, means you touch-type. Also, you don't use the mouse. Basically, using Vim, is like having the brain hard-wired to the computer for every task, not only text edition. Everything you do goes through the keyboard, and you don't have to think about it. You scroll through text, search for it, edit it, open new files, etc.

For instance, most of the time I don't use any GUI for Git either. I do everything in the terminal, and only use the GUI for partial commit (ie. select which line to commit). I have dedicated aliases for getting history, etc.

Also, when learning Vim, you notice that many (Linux) tools have Vim shortcuts enabled. I discovered many of them by chance, out of the habits of using Vim shortcuts.

Re:Vim is touch-typing on steroids by p-e-w on Friday January 13, 2023 @01:10AM (#34364492)
> Everything you do goes through the keyboard

Except web browsing, which is a huge part of software engineering, and which is nearly impossible to do without the mouse because most websites cannot be reasonably navigated with shortcuts alone.

So the whole model falls apart, really.

Re:Vim is touch-typing on steroids by schoen on Friday January 13, 2023 @01:29AM (#34364585)
Some avid vim users will also use https://vimium.github.io/ in their browsers, so they can also browse using the keyboard and vim-like cursor movement commands.
Re:Vim is touch-typing on steroids by d4rti on Friday January 13, 2023 @01:29AM (#34364587)
Tridactyl does the job for most websites pretty well as for text heavy sites like documentation it’s very good.

https://github.com/tridactyl/tridactyl

Re:Vim is touch-typing on steroids by ludicast on Friday January 13, 2023 @01:31AM (#34364596)
I don't find myself needing the browser too much when I code. Other than to reload a page if I'm tweaking something on the FE.

Not that I know everything, but I view informational browsing as a distraction while programming. The LSP augments most of the knowledge gaps for me.

If vim isn't for you that's cool. But I find other editors for me are this-is-fine.gif.

Re:Vim is touch-typing on steroids by xeyownt on Friday January 13, 2023 @01:32AM (#34364609)
I use trydactyl.

Really, the model doesn't fall apart. But you don't have to use it if you don't want to.

Re:Vim is touch-typing on steroids by prmoustache on Friday January 13, 2023 @04:01AM (#34365461)
Not really and only on a vanilla browser.

Most of my operations on a web browser involve scrolling or swapping pages, which I typically do with a keyboard. Besides every browser has keyboard extensions that allow one to select links through keyboard press. Being a neovim user I like vimium on firefox. I also like to use text based browsers for a better browsing experience and less distraction when I am coding.

Re:Vim is touch-typing on steroids by roelschroeven on Friday January 13, 2023 @05:10AM (#34365893)
For what it's worth, I have no problem using the mouse, or the keyboard, but I hate having to switch between them all the time. The longer I can use one without having to switch to the other, the better. Editing text can't really be done without the keyboard, so for that activity the use of the mouse should be absolutely minimal.
Re:Vim is touch-typing on steroids by helaoban on Friday January 13, 2023 @01:00AM (#34364440)
For some (myself included) the high speed and efficiency of proficient modal editing serves as a thinking aid, like sketching with a pencil and eraser. I tend "play" with the code: chopping it up; splitting lines and inserting a bunch of white space; duplicating lines dozens of times to act as placeholder values (e.g filling an array literal); renaming variables across a file many many times before settling on the right name; moving helpers functions to the top, then to the middle, then next to their first invocation etc.... All doable with other editing styles, but at a higher cost, and the cost of manipulation has to be very low in order to reap those meditative qualities.

Manipulation far outweighs input. And manipulation is fundamentally thinking, at least for me.

Re:Vim is touch-typing on steroids by 5e92cb50239222b on Friday January 13, 2023 @01:31AM (#34364600)
All of that can be done in JetBrains' IDEs with a single hotkey. Especially stuff like code extraction or variable/class/function renaming — it actually works reliably across the whole project (not just a couple of files) even if you have multiple functions with the same name. Extracting code to variables/constants/functions also works reliably (like automatically adding referenced data as function arguments).
Re:Vim is touch-typing on steroids by kqr on Friday January 13, 2023 @01:40AM (#34364647)
Yes, but does it work the same way in Shell scripts, Ada, Haskell, Perl, Python, C#, screenwriting, and documentation?

The power of text-based manipulation is that you don't have to learn a different set of hotkeys for different types of material.

Re:Vim is touch-typing on steroids by probablynish on Friday January 13, 2023 @01:51AM (#34364711)
IntelliJ (the canonical JetBrains IDE) has plugins for the first 6 of those - so at least for those, it does work the same way. The hotkeys to perform the actions mentioned in the parent comment don't change.
Re:Vim is touch-typing on steroids by kqr on Friday January 13, 2023 @02:44AM (#34364995)
TIL! There weren't so many language plugins last time I tried it, so I felt like I had to drop back into Emacs/Evil fairly often. Good to know that's not as much the case anymore!
Re:Vim is touch-typing on steroids by 5e92cb50239222b on Friday January 13, 2023 @02:00AM (#34364759)
Yes, and also in CSS, SQL, ocaml, Rust, and a million other languages. Navigation works reliably (including cross-language navigation: for example, you can easily jump from a CSS class mentioned in HTML or JSX to its definition even if it's has a very generic name and is defined in a random file far away). Even if it has a complicated definition using something like SCSS and is simply not greppable.

Or do the reverse — find all usages of a CSS class from its definition (again: do so reliably, it's not a simple grep).

Find all references to a particular database column (in SQL queries across the project, foreign keys in other database tables, and ORM models)? Same hotkey.

Stuff like code selection works reliably since IDE work with code on an AST level and you're asking it to select the current AST node (and not the "current text block"), going up the tree as needed.

And so on.

Re:Vim is touch-typing on steroids by p-e-w on Friday January 13, 2023 @02:09AM (#34364809)
> The power of text-based manipulation is that you don't have to learn a different set of hotkeys for different types of material.

And the weakness of text-based manipulation is that it views code as characters rather than as semantic data.

Modern IDEs either have their own semantic code operations, or use language servers to actually understand the code rather than just work with character strings. This is vastly more reliable when doing refactoring or project-wide navigation. Text-based approaches are a crude hack by comparison.

Re:Vim is touch-typing on steroids by probablynish on Friday January 13, 2023 @02:54AM (#34365055)
Would you say that a vim plugin in your IDE of choice gives you the best of both worlds? The superior semantic manipulation of an IDE and the superior text manipulation of vim.
Re:Vim is touch-typing on steroids by rhaway84773 on Monday January 16, 2023 @08:44PM (#34408164)
IDEs are incredibly slow. Even the fastest IDEs.
Re:Vim is touch-typing on steroids by fileeditview on Friday January 13, 2023 @06:41AM (#34366492)
In Vim you also have plugins that provide you with semantic editing (e.g. via LSPs). You then have it both.. same as if you installed a Vim plugin in your IDE. The only difference being that the IDE is slow and has a multitude of features that I don't need whereas Vim is configured to exactly my needs and has instant response always.
Re:Vim is touch-typing on steroids by techwizrd on Friday January 13, 2023 @10:31AM (#34369094)
I tend to use Vim/NeoVim regularly, and I really enjoy using IdeaVim when I use JetBrains' products. I get the fast modal editing and the IDE refactoring features. It's the best of both worlds.
Re:Vim is touch-typing on steroids by Aperocky on Friday January 13, 2023 @01:05AM (#34364475)
Great point, /SEARCH_TERM and n is extremely useful for finding stuff and understanding. also when you screw up either because muscle memory went haywire or the logic looks bad then just uuuuu until the status bar (plugin) show no change since last save.
Re:Vim is touch-typing on steroids by p-e-w on Friday January 13, 2023 @02:13AM (#34364830)
As opposed to other editors, which don't have shortcuts for search and undo?
Re:Vim is touch-typing on steroids by rhaway84773 on Monday January 16, 2023 @08:46PM (#34408176)
Ctrl/CMD + Z vs u

Ctrl/CMD + Y vs r

There’s a significant difference in speed. But more importantly, the former requires RSI inducing finger gymnastics, whereas the latter is a tap of a fingertip.

The much faster speed but more importantly less complicated chords/key taps in VIM, leads to a qualitatively different editing/reading experience.

Re:Vim is touch-typing on steroids by worksonmine on Friday January 13, 2023 @08:50AM (#34367617)
If your goal is to return to the state where you opened the file ":earlier 10m" might be more useful than spamming u.
Re:Vim is touch-typing on steroids by probablynish on Friday January 13, 2023 @01:07AM (#34364480)
This is a great point that I never thought of. Seems like a general example of the idea that lowering the cost of some action sufficiently low can lead to not just efficiency gains in areas where that action is currently used, but also new and surprising uses of that action.

For example, I once read an economics book that characterized computers as lowering the cost of integer arithmetic by an extreme amount. That led to things like digital music/pictures - no-one would have previously thought of using a ton of numbers to represent a song - not just efficiency gains in accounting.

Re:Vim is touch-typing on steroids by thwarted on Friday January 13, 2023 @04:17AM (#34365563)
> no-one would have previously thought of using a ton of numbers to represent a song

Music has long been represented using math and math concepts. Musical notation is a cartesian plane with time on the x-axis and pitch on the y. But that's the representation, and it's not about the representation, it's the ability to manipulate at extremely high speed.

Re:Vim is touch-typing on steroids by probablynish on Friday January 13, 2023 @03:47PM (#34373671)
I see what you're saying, but musical notation isn't a precise representation of the audio. Given the same score, two musicians can produce very different interpretations. Perhaps I should have said 'audio' instead of 'song'. (I took classical piano exams as a kid, and at some point a group of us would perform our prepared pieces for each other as practice, and I remember always being surprised at how different everyone's pieces sounded. I'd thought mine was the One True Way!)
Re:Vim is touch-typing on steroids by tjrDL6MjB2Zwwa on Saturday January 14, 2023 @05:11PM (#34384641)
Claude Shannon showed that everything is just data, that's why it wasn't done previously. It seems obvious today, but wasn't always.
Re:Vim is touch-typing on steroids by mannykannot on Friday January 13, 2023 @09:45AM (#34368380)
Personally, when I find myself doing the things you mention, I realize it's time to back off and refocus on the things mentioned in p-e-w's second paragraph. In that state, I feel I am fidgeting with the code, and it is probably because some unresolved issue is blocking me.
Re:Vim is touch-typing on steroids by fierro on Friday January 13, 2023 @03:13PM (#34373241)
totally agree. Also, when developing in complex codebases, being able to shorten the time distance between thinking an action needs to be done and actually doing it means you can keep more ideas in your head rather than spend your CPU cycles on visually moving around your screen, clicking, waiting, etc.
Re:Vim is touch-typing on steroids by koonsolo on Friday January 13, 2023 @01:28AM (#34364577)
I work differently. I mainly read code, and do small manipulations in different places. Reading technical documentation is maybe 5% of what I do. I mainly need to figure out code.

So basically it's jumping around, refactor some stuff, and add some stuff. For that, Vim is ideal.

Code only flows straight from brain to fingers when it's trivial and boring ;).

I use the VSVim plugin in VSCode. I wouldn't necessarily call it a "productivity boost", but more of a convenience or ergonomic solution.

The Vim keybindings make it really easy to for example copy something within () and then navigate quickly and paste it somewhere without touching your mouse.

But overall I agree, I can probably do the same amount of work without the Vim plugin, it would just make it more inconvenient: more mouse manipulations, ctrl-shift-arrow finger spreadstands to select chucks of text etc.

Re:Vim is touch-typing on steroids by BrS96bVxXBLzf5B on Friday January 13, 2023 @02:01AM (#34364767)
I agree with your point but fwiw when I worked a full time C job doing things with servers running a custom Linux kernel the biggest conveniences were Shift+k over a keyword to open the man page (most of my time was reading docs too!), having some custom scripts that read ctags and could tab-complete keywords from our large codebase and open the files at the right line, and having the same editor on our embedded servers and VMs as on dev machines (and even now that's half of why vim is still my primary).

There were people at the company who were more efficient than me using Sublime + mouse, but I was less efficient using Sublime.

(but really the biggest reason I use vim as a slow and sloppy typer and not a computer person is, hotkeys make my hands hurt, I've managed to avoid any RSI or pains like this, and I like vim better than vim keybindings in other editors.)

other productivity gains not related to typing were the search/replace in vim, embedded terminal, and being in and staying in a terminal made it easier and quicker to switch to scripty things, searching or reformatting files etc

Re:Vim is touch-typing on steroids by p-e-w on Friday January 13, 2023 @04:50AM (#34365771)
> Shift+k over a keyword to open the man page

Any widely used modern editor/IDE will have plugins to do the same thing.

> having some custom scripts that read ctags and could tab-complete keywords from our large codebase

Contextual completion as offered by modern IDEs or language servers is vastly superior to Ctags, and you don't have to home-cook anything to get it working.

> and having the same editor on our embedded servers and VMs as on dev machines

That's what SSHFS is for. No need to limit yourself to whatever happens to be installed on the remote machine. You don't even have to copy config files around.

Re:Vim is touch-typing on steroids by BrS96bVxXBLzf5B on Friday January 13, 2023 @05:33AM (#34366030)
okay? you've pivoted from "not understanding" vim to having an anti-vim boner. other people in the same environement achieved as much or more than me with different tools. and those different tools didn't work for me. that's all that's going on here.

(sshfs is not a direct substitute for being able to quickly interact with a remote environment)

> having some custom scripts that read ctags and could tab-complete keywords from our large codebase

for clarity i meant that I had a completion in the terminal when not in the editor to quickly jump to a tag in a file. `vim -t <keyword>`. i could be in a terminal, execute a remote command on a machine, know what I wanted to look at next and quickly go there without much effort. And again, other people were productive without doing this. these were just my tools and i liked them.

Re:Vim is touch-typing on steroids by johannboehme on Monday January 16, 2023 @05:28AM (#34399114)
Any widely used modern editor/IDE will have plugins to do the same thing. > True. But i do not want to install multiple several gigabyte sized bloatware gui behemoths apps just to develop some software.

Contextual completion as offered by modern IDEs or language servers is vastly superior to Ctags, and you don't have to home-cook anything to get it working. > Also available in vim and doesnt need any home-cook solution. There are decent plugins that work out of the box for that kind of stuff

That's what SSHFS is for. No need to limit yourself to whatever happens to be installed on the remote machine. You don't even have to copy config files around. > or more easily: just edit remote files directly via scp/ssh. Vim can do that.

Re:Vim is touch-typing on steroids by jhoechtl on Friday January 13, 2023 @02:22AM (#34364870)
Only tangentially touching your points, my take on Vim or modal editing in general is the following:

When I edit existing text (program code, prose) a modal editor shines. I am mostly in command mode and re-arrange text or re-factor code from here to there.

When I am _creating_ text, for me a modal type editor is a hindrance. Agreed, I should probably be most of the time in insert mode yet in practice I find myself switching between insert mode and command mode all the time. For what reasons ever this switching never made it into "muscle memory" and disrupts my workflow.

For that reasons I am an avid user of both Vim and Emacs.

Re:Vim is touch-typing on steroids by doix on Friday January 13, 2023 @02:26AM (#34364887)
> Is this really unusual? How do people operate for whom Vim gives a productivity boost? Does code just flow from their brains into their fingers? I don't get it.

I am very bad at keeping all that stuff in my head at once. I need to get things out of my head onto the screen as fast as possible, so that I can then think about the "next step". Then I need to be able to quickly refer back to many places quickly and switch back and forth between different places in the codebase.

For example, as soon as I think of a corner case, I'll try to handle it immediately in an if statement or something. Then it's there, in the code. Maybe it stays in the final version, maybe I end up with 10 if statements and need to refactor everything.

But it's much easier for me to do that when everything is written down in the code rather than trying to do it all in my head.

If I typed at 15 WPM, I'd probably be easier to just reason about it in my head, because by the time I finished typing, I would have forgotten what I was thinking about.

I'm sure these things cause a feedback loop of sorts. Because I know I can get stuff out of my head quickly, I don't bother training myself to get better at storing more in my head at once. So I get worse and the solution is just to edit text faster.

Similarly, I suspect since you can keep everything in your head, there's no incentive to get faster at editing text. And if a problem is "harder" the solution is to get better at keeping stuff in your head.

I don't think there is a right or wrong answer. I think exposing people to both sides is important, so they can find what works for them.

Re:Vim is touch-typing on steroids by jcalvinowens on Friday January 13, 2023 @03:13AM (#34365172)
I love vim. I've been using it for almost 20 years now.

I agree with you about code entry speed, that's not the point.

I think the easiest way to put it is that vim is 0% task loading. I never have to expend any energy dealing with it, making it do something I want, finding some button that moved around, etc. Vim just works: in almost two decades, I have never once encountered a single bug or change in behavior that I found irritating. Seriously, never. I just write code.

99% of the code I have written both personally and professionally in my lifetime was written in vim. That's the other win for me: all that muscle memory is still beneficial, now and forever. Its a much more universal tool than any IDE.

Re:Vim is touch-typing on steroids by flohofwoe on Friday January 13, 2023 @03:29AM (#34365267)
I fully agree. Yet I still learned the vi input model because pretty much every text editor on every platform supports it one way or another, and a cross-editor / cross-platform input model makes it a no-brainer to switch editors (which I do all the time, e.g. using vim for quick edits on the command line, and a 'proper' IDE for coding, where the IDE also changes (VStudio, Xcode, VSCode) depending on platform or task at hand. And while typing speed doesn't matter much for productivity, "muscle memory" does for "staying in the flow".
Re:Vim is touch-typing on steroids by alwillis on Friday January 13, 2023 @03:52AM (#34365409)
> Simply put, text manipulation is not at all a productivity bottleneck for me. I need much more time for thinking about code than I need for writing it.

For simple things, there's no perceived bottleneck in any editor… but not everything is simple. The productivity gains come from being able to make complex changes to documents using just normal mode and ex commands, which would normally require macros, scripts or plugins in other editors.

For example, this 12 year-old video by Derek Wyatt [1] demonstrates extracting the text from a XML representation of a mind map and turning it into a hierarchical, bulleted list using Vim’s search and replace commands which support regular expressions. Attempting to do the same thing in Notepad for example might take you 15-20 minutes.

He has a series of these videos, some of them jaw-dropping showing the power and brevity of using Vim for non-trivial editing and data extraction tasks.

And remember—this is Vim from 12 years ago with zero plugins.

> Does code just flow from their brains into their fingers? I don't get it.

There's a reason why the subtitle for Drew Neil's book Practical Vim is "Edit Text at the Speed of Thought" [2]. It's probably the best book on Vim that illuminates the power and efficiency of Vim and why it matters.

One you attain a level of proficiency with Vim, as you think about what to do next, your fingers hit the right keys and without thinking about it, the change is done.

An identifier for a constant needs to be all caps? Say the cursor is at the end of the line and the identifier is at the start of the line and I'm in insert mode.

1. Press Escape (enters normal mode)

2. Press '0' (motion for jump to first character of the line)

3. Press control-v (enter visual block mode)

4. Press 'e' (move the cursor to the end of the word while highlighting the word)

5. Press '~' (switches the case of the highlighted characters)

There's no reaching for the mouse or moving your hand towards the trackpad from the keyboard. It may not seem like much, but for experienced Vim users, an operation like this is a second nature, muscle memory thing that takes about a second to do. There's no break in focus or concentration and you're off doing the next thing.

That's where you save time and editing becomes more efficient. And while there are dozens of these types of simple edits that second nature to Vim users, doing more sophisticated changes can be just as efficient.

[1]: https://vimeo.com/user1690209

[2]: https://pragprog.com/titles/dnvim2/practical-vim-second-edit...

Re:Vim is touch-typing on steroids by Zacharias030 on Friday January 13, 2023 @12:39PM (#34371052)
I have mapped esc+hjkl to arrow keys system-wide and moved esc to capslock, which is a already a game changer.

The respect for vim and especially vim keybindings is definitely there, I use it for editing bashrc‘s or similar or inspecting stuff in the terminal, but what do you recommend to get over the hump of learning it better such that e.g. vimbindings in vscode could replace the standard?

For code, I use vscode currently, so your example would be:

* cmd capslock h (to go to the beginning of the line) * alt capslock l (to move right to the first word and off the whitespace) * cmd d (to highlight the word und the cursor) * F2 to rename the symbol codebase-wide or cmd shift g to select all occurrences in the file * retype the word in allcaps (enter if F2 was used)

Re:Vim is touch-typing on steroids by jatins on Friday January 13, 2023 @04:25AM (#34365616)
I'll tell you my motivations to switch to Vim. My wrists.

All that typing in 20s finally caught up and I have been having recurring wrist pain.

Keeping fingers near the home row as Vim keybindings encourage and avoiding jumping around on keyboard in one way to avoid wrist strains and something I'd recommend people to start doing earlier rather that later.

Re:Vim is touch-typing on steroids by jiki on Friday January 13, 2023 @04:35AM (#34365680)
Same here. My productivity gain mainly comes from my brain, not how fast I can type.
Re:Vim is touch-typing on steroids by throwaway_au_1 on Friday January 13, 2023 @05:39AM (#34366078)
It sometimes seems like a lot of the Vim, ew crowd think that the sole reason for using Vim is gaining some kind of god-like ability to physically pump out and manipulate characters. Sure, maybe that's possible. For me, it's about being efficient with my keystrokes. Standard shortcuts (Ctrl+_) are pretty unpleasant for my hands - saying this having already mapped CAPS_LOCK to LEFT_CONTROL (and LEFT_CONTROL to ENTER). I like running commands using sequences of letters - it just feels physically easier to me than sequences of multi-key-presses (e.g. Ctrl+Shift+T). That Vim has other smarts around that is just a perk.

Editing text using Vim, once you've built the muscle memory, really feels super natural and effortless. I really hate reaching for the mouse; it just irks me in a way that's hard to describe. Similarly, editing code without Vim feels tedious in a similar way. Imagine scrolling a long article by pressing the down arrow over and over, or clicking the down button at the bottom of the scroll bar.

Another complaint I see is that remembering the commands is too hard an ask. I moved from QWERTY to Workman at the same time that I was learning Vim and it was interesting because I learned that I -- and probably most people, but I'm speculating -- don't associate commands or actions with letters after they're initially learned. It's all muscle memory, just particular movements of select fingers. The Vim stuff you use day-in-day-out just sticks in your brain and you don't think about anymore than you think about which fingers to activate to type words.

Of course, some people probably just prefer to edit text like they do in almost all other text-editing contexts. They can already edit text; without some kind of perceived extra value, there's no motivation to change, or seemingly even try and understand. For me, it's the pleasure of feeling efficient and doing dev pain-free.

Re:Vim is touch-typing on steroids by fileeditview on Friday January 13, 2023 @06:44AM (#34366511)
Yep there are many more reasons than "typing fast" for using Vim. For me the main motivator to dive into Vim was to not use the mouse at all because it constantly gave me RSI. It worked great. I never again had RSI since I switched to Vim for all my coding.
Re:Vim is touch-typing on steroids by ErikCorry on Saturday January 14, 2023 @04:16AM (#34378692)
I think part of the benefit of vim for RSI is that there's not much chording - pressing two keys at once.

When not using vim you often need control characters on the left hand. Ctrl-C Ctrl-V Ctrl-X Ctrl-A are all on the left. Also, for bash, Ctrl-R and Ctrl-E. I've been training myself to use the right ctrl key for all these, because for some reason I was chording with the left hand.

I've also tried to learn to use caps lock for all-caps, but with less success.

Re:Vim is touch-typing on steroids by mrjin on Friday January 13, 2023 @07:29AM (#34366834)
I guess it might be because the nature of your work. When I started as a SE over a decade ago, my job was really just writing code according to the specs. Typing speed was important as I wrote over 100k lines of code in the very first year. But less and less code I wrote after that. Once I spent around 6 months meeting CEO daily just to figure out what was wrong with something screwed pretty badly by someone with a fancy big title. Eventually the code I changed to fix those problems were less than 30 lines. That was extreme, but on average, I hardly write more than 100 lines of code per day just like you. Typing was no more an issue for a very long time.
Re:Vim is touch-typing on steroids by PurpleRamen on Friday January 13, 2023 @09:50AM (#34368451)
> When I "program", 95% of what I do is read documentation and other technical resources

That's very off from my work. For me, it's the opposite: 95% is writing code, navigating code, testing code or doing stuff in the shell. Reading documentation usually makes only a small amount. And even then, writing notes makes a good part of it too.

> conceptualize what I want to happen, and construct the corresponding logic flow, while trying to anticipate potential problems and corner cases.

I can also do that while typing. Mindgears are no reason to stop typing.

Re:Vim is touch-typing on steroids by DennisP on Friday January 13, 2023 @10:09AM (#34368751)
It was a huge productivity boost for me, because when text editing was tedious, I would lose my flow, get bored and annoyed, and start goofing off.
Re:Vim is touch-typing on steroids by stcroixx on Friday January 13, 2023 @10:14AM (#34368827)
Agree so much. It’s such a tiny fraction of the time spent for me no amount of optimization would affect the overall timeline.
Re:Vim is touch-typing on steroids by jerf on Friday January 13, 2023 @10:20AM (#34368926)
"If Vim magically tripled the speed at which I'm able to edit text, I doubt it would have a noticeable impact on my overall productivity."

It's an Amdahl's law thing. Even if you drop my typing time down to zero, it wouldn't affect much. That said, multiplying my typing time by 10 would be a hit.

I consider being bottlenecked on my raw ability to type to be a huge red flag. I'm doing something wrong unless I have a very specific reason to be so bottlenecked, like I'm momentarily just doing data entry with no ability to simplify the process. (Unusual, but it does happen; for a micro example, typing out all of some enumeration's value can bottleneck on raw typing speed if there's more than a couple of them and I happen to be able to instantly and correctly name them all.) Must be missing an abstraction or something.

Re:Vim is touch-typing on steroids by gmadsen on Friday January 13, 2023 @10:33AM (#34369143)
10k lines is still 10k lines. What I like about vim is that it mimics how i think about code, its the closest thing to a brain interface that an editor can be.
Re:Vim is touch-typing on steroids by zokier on Friday January 13, 2023 @10:36AM (#34369184)
Fast typing speed and efficient editor practice are transformative; when human-computer interface becomes frictionless you unlock notation as a tool of thought, and really be able to use the computer to design your programs instead of doing design first in your head/pen-and-paper/whiteboard and then transcribing near-final code to computer. Or at least that is the idea; I'm not 100% certain if it is not just pipedream for majority of us.
Re:Vim is touch-typing on steroids by goodpoint on Friday January 13, 2023 @11:02AM (#34369630)
> text manipulation is not at all a productivity bottleneck for me

No, but the benefit is in the mindset encouraged by Vim, especially around modal editing.

Re:Vim is touch-typing on steroids by jononomo on Friday January 13, 2023 @11:03AM (#34369646)
"Does code just flow from their brains into their fingers?"

Honestly, it does feel that way sometimes. You move so much faster and with so much more efficiency and power that you can just think at a higher level while you're coding.

Re:Vim is touch-typing on steroids by rewgs on Friday January 13, 2023 @11:50AM (#34370384)
It’s flow state/reducing cognitive load, not just literal typing speed. I know that might sound insane —- I was extremely weary of such claims for a long time and thought vim was stupid —- but after getting over the “hump,” I get it and absolutely can’t go back.
Re:Vim is touch-typing on steroids by wruza on Friday January 13, 2023 @12:42PM (#34371094)
read documentation and other technical resources, conceptualize what I want to happen, and construct the corresponding logic flow, while trying to anticipate potential problems and corner cases. In other words, most of what I do doesn't involve touching the keyboard at all.

In my case, this often creates an elegant and conceptual code that doesn’t match expectations or even reality. Reminds me these meetings when someone e.g. says “no-brainer, there’s API for that” and goes on with requirements, schedules and administrative tasks without checking first if it’s hooks, streaming, polling with a rate limiter, or a non-idempotent email-like protocol with a completely undocumented bullshit in its payload section. The correct remark is “hold your horses”.

More than half of my work (strange corners of fintech) is checking, testing, prototyping, fail-refine cycles, unrealistic expectation reports. Not only APIs, also hw, niche software, reverse engineering, a little bit of everything. 80% of it goes straight into the “Attic” repo after few hours. I have to type an unelegant and unconceptual code fast and reshape it at the speed of thought about a realtime problem, there’s no time for clever design if a business-critical decision or a paper-heavy process depend on these experiments.

Using a boring editor feels like you want to quickly visit a few places to see if they are good enough, but they are all in different cities, so you start to forget details while you drive. And relying on a documentation is like buying a house by pictures alone.

For me the structure comes from the actual code, after I can extract its true shape, after the requirements got satisfied in a fully functional prototype, which is also a sort of a knowledge base for a project. I’m able to plan it in advance, but only with 20% probability and 80% of unnecessary work.

Re:Vim is touch-typing on steroids by martindbp on Friday January 13, 2023 @02:59PM (#34373084)
> Simply put, text manipulation is not at all a productivity bottleneck for me

I once believed this and this comment could have been written by me verbatim. But I decided to seriously give vim a try and I'm still very happy 8 years later. I don't know for sure that vim makes me a better programmer, but going from vim to another editor is a bit like going from your large desktop screen to a 13" laptop working at a café. I can do the work but it's just slower and not as enjoyable.

Maybe it's not so much vim specifically, although I enjoy the modal editing part, but just 100% investing in a single editor and getting really good at navigating and editing code with it. It's always fast and responsive and always available. Before vim I used different editors for different jobs, Emacs, BlueJ, Eclipse, Visual Studio, Sublime, XCode etc and I never truly invested in any of them. Once you make a decision to just use the one editor, it's a powerful thing.

Re:Vim is touch-typing on steroids by triceratops on Friday January 13, 2023 @04:50PM (#34374385)
Or, as Steve Yegge put it, most programmers are CPU-bound rather than I/O bound.
Re:Vim is touch-typing on steroids by bostik on Friday January 13, 2023 @04:56PM (#34374451)
> Is this really unusual? How do people operate for whom Vim gives a productivity boost?

Don't think of vim as a magic totem of productivity. You should think of it as a largely distraction-free editor. No messing about with a mouse. No GUI to get in the way of your thoughts. Loads up immediately, and works the same way in any system, local or remote.[ß]

So it's less to do with speed of writing, and much (much!) more about maintaining focus.

ß: not really true, any long-time user will have their own customisations they rely on, but the basic commands are always the same.

Re:Vim is touch-typing on steroids by palata on Friday January 13, 2023 @07:21PM (#34375811)
I don't think I'm more productive than non-vim users, it's just my preference. To the point where it's actually painful to use an editor that doesn't support the vim bindings.

I like not having to use the mouse, that's more ergonomic for me. Some people have an ergonomic mouse, I just avoid using it. Different solution, not necessarily better or worse.

Re:Vim is touch-typing on steroids by gorgoiler on Saturday January 14, 2023 @03:27AM (#34378414)
What you describe feels very true for constructing a green diff containing lots of new code being added to a code base.

Being able to juggle text really comes into its own when you now have to move it around from one module into many, appease the linters, search-for then factor-out a common pattern, or rewrite your idea in place without breaking it. These are all things we do to take code from the “it works” stage to the “it’s correct” stage, namely self documenting modular code that is human as well as machine readable.

Vim makes light work of the back breaking chores involved with code gardening, which indeed bears little resemblance to programming.

Re:Vim is touch-typing on steroids by JimBlackwood on Saturday January 14, 2023 @10:25AM (#34380985)
I doubt Vim helps my productivity. At least, I’m sure if I dropped vim I would be learn to be just as fast in whatever I ended up using.

It’s just the ergonomics and easy customizability. Keybindings are in all editors, but in vim I don’t have to press all buttons at once. Just: “space”. Walk to the coffee machine. “g”. Get interrupted. “c” - there opens my git commit window. This feels so infinitely much nicer than any other keybinding system I have used. I always struggle going back to anything else.

Next to that, the way the config just works. Just a file I can edit.

Vim doesn’t work wonders, it’s just a preference.

Re:Vim is touch-typing on steroids by camgunz on Sunday January 15, 2023 @12:50PM (#34391323)
(Sorry late to the game)

A friend suggested this to me a while back so I tried a couple IDEs, and it didn't really do it for me. Mostly I think this for three reasons:

1. IDEs don't offer features I need. I don't often need to do a big rename (and if I do, sed and grep have me covered) or generate getters/setters, or what have you.

2. Cool stuff happens outside IDEs. There are tools that generate docs for APIs or even APIs themselves. There are tools that generate clients for APIs. There are tools to build apps using formal techniques (think Jason Donenfeld's work on WireGuard here). IDEs are behind here.

3. For "reasons", I had to implement a circumspect version of DBT in a few days, roughly 1300 LOC. Doing this with Vim was hard enough, but doing this with an IDE would've been impossible because while they help with some of the drudgery of the structure, they can't implement a structure itself, and they can't help me wrangle the raw code.

> Does code just flow from their brains into their fingers? I don't get it.

It sounds ridiculous, but yeah, more or less. I learn and assess by doing, so mostly I jam things out at 140 wpm, see if it's good, if not do it again. And over a career of doing this I have to do things over less and less, and when I do I get both an implementation and a pretty good empirical defense of it at the end.

Re:Vim is touch-typing on steroids by rhaway84773 on Monday January 16, 2023 @08:42PM (#34408149)
Vim is fantastic for reading text. There are so many good commands that make it trivial to move around your code incredibly easily, and also make it easier to read (for example, a 2 key chord to position the line under your current cursor to the top/middle/bottom of your viewport).

Even better, unlike most IDEs, the overwhelming majority of your screen is devoted to just the text. There are no toolbars, no sidebars, not even a menu bar. Vim (and similar terminal based editors) are the original focus mode text viewers/editors.

Finally, the VIM chords become natural in a way keyboard shortcuts don’t. Part of the reason is that with the VIM normal mode, you have access to significantly more keys with which to form shortcuts, whereas most other editors use number and letter keys for typing text, so shortcuts become increasingly convoluted combinations of modifier keys.

Everything about VIM is optimized for reading text, then editing text and only after that inserting text. Inserting text is a special mode in VIM, whereas the default normal mode is for reading.

So VIM is a highly optimized tool for the workflow you described.