A big difference between Vim and your 813 hotkeys is that Vim has a structure to the key bindings. Where you have to memorize individual hotkeys for each command in VS, Vim commands are simple languages. So when you learn a new action or scope, you can combine that with everything else you already know.
E.g. I know how to indent the entire file. Cool. Then I learn about the block scope, so I immediately know how to indent the block. Then I learn how to format text to be confined within the set text width. Now I immediately know how to format the entire file and a text block. Then I learn about the "from cursor to character X" scope and now I can perform all known actions on this scope as well.
Note that the scopes are not like selections. They are controlled by keyboard input, even though in Vim, selections are just another action as well and now that I know the key for that, I know how to select any of the scopes I already know.
For VS and other IDE's and editors, each permutation of these scopes and actions would require its own hotkey, or it can only work with a selection and for that you have to spam ctrl+arrow/pg{up,down}/{home,end}, which to a Vim user are clunky and imprecise.
This is of course just scratching the surface of all the power of Vim that are accessible through a few key presses..
A big difference between Vim and your 813 hotkeys is that Vim has a structure to the key bindings
No, I agree. That was my first thought when looking at them all. It'll take quite a while to memorize the ones I need (which isn't really all 813). To be fair, that also makes it funnier.
For VS and other IDE's and editors, each permutation of these scopes and actions would require its own hotkey, or it can only work with a selection and for that you have to spam ctrl+arrow/pg{up,down}/{home,end}
I don't know what other editors you're using, but mine lets me select a block, the entire file, or every occurance of a word with a single keystroke.
What about "from the cursor to the {first,last} occurrence of character X", or within/around/surrounding the pair of quotes, parenthesis, html tag, brackets, sentence, function argument, block, paragraph .. ?
within/around the surrounding pair of parens, HTML tag, brackets, function arg (mostly), block (indentation-delineated or brackets-delineated), and paragraph are all a single keystroke.
To the first/last occurance of X it doesn't do, and is the one thing from VIM that I've seriously missed.
Then again, it does have VIM mode, so I could just set it to behave exactly like VIM.
Do you have the ability to change the exact pairs of HTML tags, brackets, quotes, etc? Not the text within or including these paired objects, but the actual objects themselves? Change single quotes to double quotes, surround text with curly braces? These are the ones I cannot live without.. and I've just come out of a three hour long session in ipython notebook. I missed these so badly..
That's the vim way of doing this though. It's really hard to compare things.
For example, going to the end of the line is super important for most editors, but in vim it's the overly clunky $. Why is it like this? Because going to the end of the line in vim just isn't very important, there's so many other ways of doing things. E.g. o to get a new line below the current one, or yy to copy the entire line.
Ctrl+→ is used to move the cursor across words. So, move it to the appropriate place with that, then Ctrl+W the appropriate number of times.
Alternatively, press Ctrl+W enough times to select the entire start-tag, then press → to move the cursor into the text after it, then press Ctrl+W again to select the text.
If you can reach Ctrl+→ without moving your hands from the home row position, I'm impressed.
It also starts becoming more a game of navigation and less a game of somewhat semantic text editing. "I want to change what's inside those quotes" is a far more natural thought to me than "I want to press Ctrl+→ three times, then Ctrl+W two times."
If you can reach Ctrl+→ without moving your hands from the home row position, I'm impressed.
The only reason you can is that your arrow keys are artificially mapped onto the HJKL keys, because of the ancient terminal vi was originally made for, and then only when in the proper mode. Arrow keys, by contrast, have exactly one function that is always available.
Anyway, I have functioning arms with a functioning musculature. Moving my hands from the home row position is not a constraint.
"I want to change what's inside those quotes" is a far more natural thought to me than "I want to press Ctrl+→ three times, then Ctrl+W two times."
Apples and oranges. Controlling vi also involves mapping abstract actions (“change what's inside those quotes”) into concrete commands (va").
I do that at least (!) once a day. Even more commonly I use a special case of that to select/copy/delete/replace the contents of something that’s in quotes/parentheses/braces/brackets. At least several times a day.
This is actually the one thing I really miss from VIM. I frequently want to use it when I'm editing repetitive text that obeys (or obeys in the cases I'm dealing with) character-delimited rules. For examle, 10 rows of "string 1", "string 2", "string 3", and I want to replace the second string on each row. It makes it easy if you can hop over to the next double quote, or the next double quote not preceded by a backslash.
Marks are insanely useful. How many times have you ever wanted to do something in one function that involves checking something from another? (Hint: all the time). Just do ma to set a as a mark right here and then go off and check the other function. Then do `a to return. The advantage is that in large files you often forget exactly where the original spot was when hunting down what you need to know, which wastes time.
147
u/jollybobbyroger Sep 24 '15
A big difference between Vim and your 813 hotkeys is that Vim has a structure to the key bindings. Where you have to memorize individual hotkeys for each command in VS, Vim commands are simple languages. So when you learn a new action or scope, you can combine that with everything else you already know.
E.g. I know how to indent the entire file. Cool. Then I learn about the block scope, so I immediately know how to indent the block. Then I learn how to format text to be confined within the set text width. Now I immediately know how to format the entire file and a text block. Then I learn about the "from cursor to character X" scope and now I can perform all known actions on this scope as well.
Note that the scopes are not like selections. They are controlled by keyboard input, even though in Vim, selections are just another action as well and now that I know the key for that, I know how to select any of the scopes I already know.
For VS and other IDE's and editors, each permutation of these scopes and actions would require its own hotkey, or it can only work with a selection and for that you have to spam
ctrl+arrow/pg{up,down}/{home,end}, which to a Vim user are clunky and imprecise.This is of course just scratching the surface of all the power of Vim that are accessible through a few key presses..