3 ms·
> an ordinary visual text editor Funnily enough, Vim is short for "Vi IMproved", and its predecessor vi is short for "visual"! --- Taking the time to learn V
by mpalmer 4y ago
> an ordinary visual text editor
Funnily enough, Vim is short for "Vi IMproved", and its predecessor vi is short for "visual"!
---
Taking the time to learn Vim yields significant rewards if you're willing to meet it on its own terms. I certainly grant you that it's not for everyone. It's the agony and the ecstasy of deep tools. No pain, no gain.
> The frustration is that probably there are fixes for all these things, which if I were an expert I would know.
I would submit that if you were an expert, you would not have the same list of gripes. To wit:
> Like, why can't I hit right at the end of a line, and move to the next line?
This is a fair complaint, but one that's actually never occurred to me as a Vim user, because:
> Why do I have to have a special mode to insert things?
It's a core part of Vim's design! In fact, insert mode is The other mode (Normal mode) is where the real power is. It's not so much about moving chunks of text around with the keyboard as about moving the cursor.
Vim divides normal mode key commands into motions and operators. operators add/remove/change text, and motions move the cursor.
For instance:
- `d` is an operator deletes text.
- `w` is a motion that moves the cursor to the start of the next word
- `12w` does this 12 times (practically every motion can be repeated like this)
But the rubber really meets the road when you combine them.
If you hit `d` once in normal mode, nothing happens: you've started a command but Vim is waiting for you to finish it by entering a motion. `dw` deletes from the cursor up to the start of the next word (you can guess what `d12w` does).
> And why does the help system never tell me what I want?
Perhaps start with `:help help` :)
- lovehashbrowns 4y agoThese sorta combinations and things like visual block mode are why I can’t let go of vim. You can also do: set -o vi And get vim in your bash shell. Then you wonder what the default mode is, and it turns out it’s emacs and you can do wild things like ctrl-A to go to the beginning of the line. And now I cringe when ever I see someone painstakingly left-arrow for 30 seconds to edit something at the beginning of their bash prompt.
- artificialLimbs 4y ago>> set -o vi A million thanks!
- ilvez 4y agoDidn't know about that. I'm using default shell shortcuts, which are different set of shortcuts. Like: * Ctrl-u: clear line and start from the beginning * Ctrl-a: go to the beginning of line * Ctrl-e: go to the end of line * Ctrl-b: move backwards * Ctrl-f: move forwards * Ctrl-c: leave the command as it is, just cancel the command and start with new line * Ctrl-w: delete a word before cursor * Ctrl-h: delete a character before before cursor * Ctrl-d: delete a character after cursor * Ctrl-t: swap last 2 characters (this is one of my favourites in terms of lulz, I actually trained myself to use it :D) * ... Pulled these out of my fingers, but there are more. Don't know the correct source to point to. What's good about those is that they work by default and behind every computer.
- lovehashbrowns 4y agoThis is where you can find a reference for the default emacs mode: https://catonmat.net/bash-emacs-editing-mode-cheat-sheet https://catonmat.net/bash-emacs-editing-mode-cheat-sheet Unless you’re super into vim, it makes more sense to learn the basic emacs keybinds ‘cause like you said, it’s almost everywhere.