4 ms·
I've watched people do work in vim. They don't work any faster than people using VS Code. Quite the opposite. I see them make more mistakes and lose their place
by wayneftw 5y ago
I've watched people do work in vim. They don't work any faster than people using VS Code. Quite the opposite. I see them make more mistakes and lose their place often because they don't have the same quality of tools integrated. By the time they've navigated manually to whatever code symbol they want to edit, I've already gotten my edit done and moved back to the function I came from.
The same people using vim swear by using CLI only tools and by the time they've found the command they want to edit and run in their bash history, I've hit Ctrl+Shift+G, entered my commit message and hit Ctrl+Enter to push. In the time it takes them to switch modes, I've already run the command I wanted to run since many commands are a single hot key and others are on an MRU list.
For editing stuff on a live server, in those rare events when nano isn't available I've always gotten by knowing the bare minimum - how to insert text, write and quit. But I haven't encountered a server lacking nano in years.
Maybe I haven't seen the fastest vim user though. So I looked just now and found [0]. I chose to watch [1] and ~1:24 you can see a demonstration of the guy typing out a command, "Switch" to switch a code symbol from the "true" to "false"... I thought that was hilarious because he typed 6 characters (7 if you include ENTER) in order to save himself from typing 5 characters and I just couldn't watch anymore after that so I left, wondering how many man hours have been spent bike shedding in vim.
That said - I didn't have the patience to find anything showing somebody doing something in vim that can't be done faster in VS Code, Sublime, etc. - so maybe a vim fan can point me in the right direction?
[0] https://old.reddit.com/r/vim/comments/3k1b7n/fastest_vim_videos/ https://old.reddit.com/r/vim/comments/3k1b7n/fastest_vim_vid...
[1] https://www.youtube.com/watch?v=zIOOLZJb87U https://www.youtube.com/watch?v=zIOOLZJb87U
- kbenson 5y agoI think you didn't quite understand what you were seeing in that video. That's a person showing off a quick plugin/function they made for vim that when called can switch things defined from one state to the opposite state. The top half of their screen is the source to what they wrote (I think, on mobile). They are showing how it works, so as an example highlight/select manually a bit of text then manually run it to show it swapping the value. There's a few things to consider here: - They are typing it out because the are demoing it and that's the name it's defined as in the code. Normally someone adding it would also add a key combo activation for it if they planned on using it often in that manner, and make it work on the word element under the cursor. - Even if a key combo wasn't added, they could also use this while selecting a larger chunk of text to switch all occurrences of one thing the the opposite. - The real usefulness for this is more likely in the case of some well formatted JSON, where you could start a macros, search for the next top level object, they search for a specific key in that object you know is the next occurr nice of a search term, then go to nth item, then run switch (maybe even typing it out). Then stop the macro. You can then rerun that macro with 1 (or at most a few) key presses the number of times you want, to perform those complex actions a defined number of times. As needed, vim is like an extensible interactive sed command. That doesn't mean I never use vim, but being able to do something similar to the text manipulations I do with sed while withing the file to confirm it worked right and undo if needed is sometimes useful. Could the JSON example above have been done with a dedicated tool? Sure. But it gets more complex for dedicated tools if the JSON is embedded in something else, and the important idea is not JSON editing, but that vim gives you a toolset that works just as well for XML or source or plain text, as the primitives it works with generally map well to how we use text.
- wayneftw 5y agoThanks for the explanation! I'll try to watch a few more videos.