- cross-posted to:
- linux
- [email protected]
- cross-posted to:
- linux
- [email protected]
I saw the video by noBoilerplate. How useful is knowing and using Vim-Shortcuts when writing a letter or an email? Does it only make sense to learn it if you write or code all day or is it useful enough for moderate tech users or office workers?
The best way I’ve heard it described is that learning all of the motions, shortcuts, commands, etc is the best way to remove all of the possible friction between you having a thought and you putting that thought into text.
It’s like using Word and learning that CTRL+B toggles Bold. You don’t NEED to know that, you can click the bold icon. The extra 2 seconds that it took to grab the mouse and click the icon and then move your hand back to the keyboard seems trivial, but if you’re doing a lot of writing that can add up to a lot.
In addition, having to stop your train of thought in order to fiddle with a GUI can cause lapses in concentration. Constantly having to stop typing in order to fiddle with a GUI is annoying and requires you to switch context from what you were typing to looking for the icon or menu that you need to click.
Multiply that by everything else you need to do in editing text (moving the cursor to different places, selecting text, finding text, opening and saving documents, etc. That’s a lot of time that you’re spending messing around with a mouse and GUI annoyances.
Also, if you’re using Linux, a lot of tools use vim keys as their interface. So learning the basics (mostly hjkl for moving, / for searching, etc) can help you in a lot of programs.
For example, I’m using vimium in Firefox, so I can operate the entire browser without using the mouse. Press f and all of the links and form fields on the page are tagged with a 2 letter combination, pressing those two letters is like clicking the link/field. I can access shortcuts, open bookmarks, etc all without needing my mouse. In addition, the browser has hotkeys for tab manipulation (ctrl t for new tab, ctrl f4 to close tab, ctrl shift t to re-open/undo last closed tab, etcetc).
I try to have all of my programs be keyboard driven (and use a lot of terminal applications where possible). Vim keys and motions, in all of the various programs that use them, along with the shortcuts from the window manager (everyone knows alt + tab, but there are many more) and even individual applications make that possible (except for Freetube, which requires the mouse :/).
Overall, I would say that it’s not a requirement, but if you’re willing to spend a week or two learning (and moving very slow as you force yourself to learn and use the keys) then I think you’ll have a better time in Linux.
Also, it feels pretty ‘90s hacker movie hacker’ to just flail on the keyboard and have things happen on your PC.
I use neovim btw
I personally started with vim and I’m now using neovim for years. And I have to admit that it’s just an editor… But a perfectly optimized one.
It requires some efforts to learn the basic useful features (like horizontal and vertical motion) but I quickly saw its potential. What made me stick to it and willing to invest even more efforts is the fact that you build it to fit your needs like a glove through the interface customization, no limit and powerful keybindings remapping, and a collection of plugins for everything (without making it slow or bloated). With the right plugins, this editor can handle any regular typing or specific coding language, and makes your workflow way more efficient thanks to a great project management approach and/or speedy fuzzy finder file explorer.
I’ve barely started a series of posts dedicated to this incredible editor. Whether or not you’re using a vim or neovim, I’d recommend to stay curious because there’s other editors out there to be aware of and one may prefer them. I’ve tried quite some of themwhen moving to neovim but this one was just the one for me.
The command chest sheet in that article is wrong. gg is first line of the document, not H
Beginner’s Command Cheatsheet
:q!
Shift + ZZ even easier
Using an ide to bigger things, and then just nano to edit or creat simple things. … and bat to view. I cant really see why i should make the effort to learn vim or its like
Ok, then don’t. Thanks for sharing.
“Why are we running from the police, Daddy?”
“Because we use Emacs, son. They use vim.”
–old Slashdot T-shirt
Emacs is a nice one as well. Its approach and purposes are just different. But in my opinion difference has a lot of benefits, so long life to all the editors and a big thank you to the wonderful devs who offer these tools to us (remember to buy them a coffee or more if you can).
Seems like one loves vim or one does not. I learned vi back in the mid 80s, hated it then, probablty not going back. These days I thankfully use Geany or nano. Learning vim seems like a right of passage or something.
Learning vim seems like a right of passage or something.
Yes, I think every developer is dropped into vim unexpectedly at some point (eg. git)… “What is this? How do I close it!!!”
After a decade of using the bare minimum vi modes I just yesterday discovered I could use visual mode to jointly indent multiple lines.
I will still prefer pycharm every day of the week over vim, but yesterday I needed to modify code on a server and rebuild some docker containers. I couldn’t be arsed setting up my local env, making a merge request etc and was pretty impressed that a combination of screen, vim, docker compose and git - all available via SSH, was a complete toolset for getting an emergency change deployed and an app running again.
I’ve switched to vim on a whim few months ago, and it still is a pretty fun and satisfying experience. I couldn’t get LazyVim to properly work on our Unity project, since the LSP can’t handle the hundreds of projects it generates, but IdeaVim in Rider works pretty much the same, as far as the movements are considered.
However, the important thing is that I said fun and satisfying, not faster and efficient. I still make mistakes, I have to look into a keybind reference sheet every time I want to do something I’m sure has to have a special keybind but I’ve forgotten which one it is, but once you do that it feels good.
Slowly but surely learning new stuff, getting the hang of some motions you use often, not having to reach for your mouse, all of that feels good. It’s still no way near the speed or efficiency of me just clicking the damn mouse, instead of fumbling around with VIM modes, undoing random actions because I missed one important key and now half of my text is gone, or just remembering that your clipboards get overridden by almost any action unless you do it differently.
So, if you want to get efficient and quicker in your programming, I highly recommend checking the keybind section of your IDE, and learning the few important keybinds it has, such as jump to next function/next parameter, search symbols, and the like. That will make you more efficient.
If, on the other hand, you want your editing to be a skill you can slowly continue mastering, eventually (after years of use) min-maxing, but always having some cool new things to learn that will feel good, them vim is pretty nice for that.
Just don’t expect it will make you faster or more efficient.
Just don’t expect it will make you faster or more efficient.
It will, but it requires you spend a lot of time dealing with being slow and wanting to give up and reach for the mouse.
I swapped keyboard layouts (to a 52 key split layout) and it took me around 2-3 weeks of typing slow, hitting the wrong keys, and keeping several printed sheets (for all of the keyboard layers) on my desk in order to learn the layout. It was frustrating and it would have been a lot easier to just grab a standard keyboard but, in the end, it was worth it.
Learning vimkeys/application hotkeys does take a while and it is much easier to avoid it for any given task. Just grab the mouse and avoid the frustration of having to try to remember the hotkey (or, even worse, look it up). But if you can avoid that and force yourself through the uncomfortable frustration. You’ll find that the time investment is worth it.
I’m in a similar boat. The difference for me is that I can definitely tell times where I’m faster. But there are still times where I fumble around. I know that eventually, I’ll be way faster using vim motions than I ever was without them.
When I first started actually trying to use it to do work, it felt pretty bad. But once I got over the hump it felt better.
I think I’m at the point where I’m at least as fast as I used to be, if not slightly faster.
That would be emacs.