20
[Q] Terminal navigation and Editors
(lemmy.ml)
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
I like VIM as a casual user.
I barely know any of the fancy shortcuts, never successfully used a macro in my life, can't remember how to open more than one edit buffer and have to look it up every single time, and I still constantly wrongfoot copy and paste regularly to the point where I consider it a waste of my time to try and I just type things out the long way. I totally get why people feel very defeated by this editor.
But I do feel very slick darting around with
hjkl
, occasionally throwing in agg
or aG
or a$
to leap around. Yeah, there are faster ways to get where I want if I'd only learn them, and I may some day, but this gets me around. If you can build up just the basic movements, that's enough to at least begin to appreciate the editor.Not having to touch my mouse to edit text is a massive game changer that is worth it on its own. Not that vim is the only one that offers this benefit, of course. But what it does well that I haven't experienced in editors I've tried is how beautifully it flows if you happen to already know how to touch-type. Y'know, hands on the homerow, certain fingers hit certain keys, building up the muscle memory so you don't have to look at the keyboard to type, all that. It's why vim uses
hjkl
to move the cursor--it's where the right hand rests in a touch-typist position.If you don't use keyboards this way, vim will probably ruin you. I know a lot of people who are proficient typists who never learned standard touch typing, instead home-rolling their own cursed setup that works for them, and god bless them, but they would be hard-pressed to negotiate vim. If this is you, vim may not be the editor for you.
What do you mean by this?
I can never reliably cut/copy and paste what I want in Vim. I'm always either picking up or leaving behind stray characters at the edges of my visual selection, because I find the end cursor so counterintuitive.
Especially true when newlines are involved, it's always a mystery how many newlines I'll paste into my document when I hit
p
to put.This is not Vim's fault, it's just skill issue.
Oh, and it's also a mystery whether the system clipboard will work properly with Vim out of the box or not. There's some voodoo setting you have to tweak if it doesn't.
I see. Yeah, the end cursor can take some getting used to.
The thing that always messed me up when starting out was how deleting any text overwrites the clipboard. It was an odd quirk at first but I kind of like it now.
Yeah, the notion that "cut" and "delete" are the same operation was an interesting hurdle. It's quite elegant, honestly.
The only thing it disrupts is the situation where you want to copy something, delete a second thing, then paste the first thing. Oops! Too bad! It's gone now!
I'm aware we do have access to multiple registers in Vim, effectively giving us many clipboards to bypass this, but I don't know the commands to utilize them. Without that knowledge, this little quirk remains an occasional irritation. Just not irritating enough to motivate me enough to knuckle down and learn it.
Yeah so vim isn't for me right now... Maybe in a unknown future where I find the motivation to learn the standard touch typing, but I have the feeling this add to much constrain and strange wrist movements (maybe i'm wrong ).
Thanks your thoughtful input and personal experience !
Proper touch typing is a dramatic increase to ergonomics and efficiency, and will reduce strain overall. Your wrists shouldn't be moving much if at all while touch typing. There are lots of free online resources available for you to learn how to touch type quickly (and properly). When I first learned how to touch type after years of looking at my keyboard, I got from 0 to 30WPM in a few days of spending a couple hours each day. After a week, I had almost doubled my WPM before learning touch typing, at 60WPM. It's a very important skill that you will be glad you learned if you have regular interactions with computers.
But I understand that this is beyond the scope of your original post.
As far as portability is concerned, you will find vi (the predecessor to vim) on basically any Linux system you will ever run across. It works consistently and is installed by default basically everywhere. I used to hate vim, but after taking the minimal amount of effort to learn neovim, creating my own keybinds, and installing plugins, I've come to absolutely love it. It just takes a small amount of time to wrap your head around switching between insert mode and command mode (i to enter insert mode, escape to leave insert mode back into command mode, :w to save in command mode, and :q to quit in command mode (can combine to save and quit with :wq)), but after that it becomes quite intuitive.
You could even use a mouse with vim/neovim, though I would recommend keeping that usage to when you are scrolling through a large file quickly, looking for errors, etc. where you don't need to be actively typing. You can even turn it into an IDE with the use of language servers that will find compilation errors in files, similar to what you can achieve in something like VS Code. The possibilities are endless. Yes, it has a steep learning curve if you want to get incredibly efficient with it, but you can pick up basic editing in vim very quickly.