4 ms·
Ctrl-W is "select word" but it expands each time you press it. So if I'm in the middle of a string, and that string is part of a method call: ( "some string" )
by binaryfinery 16y ago
Ctrl-W is "select word" but it expands each time you press it. So if I'm in the middle of a string, and that string is part of a method call:
( "some string" )
And I press Ctrl-W, then at first "some" will be selected, then "some string", then ""some string"" (with the quotes).
So assuming that moving my thumb to Ctrl is free, I did it in the same number of key presses as you. Or its 4 vs 3 if you count the ctrl key. Or its 4 vs 4 if you are in insert mode and have to esc first. [Edit: ok, you have to press delete too, so its 5 vs 3 or 5 vs 4.]
The difference, however, is that Ctrl-W is all you have to know. Its just as fast as all your different combinations even for the worst case, but:
a) its often faster - i.e. just two Ctrl-W's for selecting the text inside the string.
b) it provides visual feedback.
Its just as fast for the expert, but yet its obvious, intuitive, and lends itself to discovery based learning. Once you know Ctrl-W selects a word, there's a good chance a user will learn its advanced features by accident, even if they aren't told.
Goto line: Ctrl-G 10.
Goto first line: Ctrl-Home (standard in most GUI editors)
Goto last line: Ctrl-End (also)
The '=' auto indent feature: Ctrl-Alt-L Enter is "format entire file". Its fast, so why would you ever want to format just a little bit? Ctrl-Alt-L Alt-A Enter is format the entire project. I dont have a binding for indent, because why would I ever want to? Just write code, then let editor make it look pretty in one go with Ctrl-Alt-L Enter.
I assume the "." command is used to say repeat a replace or a find: in which case there are keys for that. I'd like to see some use cases for that other than find and replace.
Editors like IntelliJ, SlickEdit, Resharper, all have powerful keybinding support. SlickEdit has a built in scripting language if you want to go crazy. All have far more commands than are actually bound. SlickEdit has a vi mode even.
So you haven't convinced me that vim offers any advantage over a good IDE.
- lelele 16y agoI'm not convinced by your example, either ;-) Let's take your example: ("some text") "cib" will leave you with: () no matter where your cursor is (inside the parentheses), and no matter how many words are there. No visual feedback is needed, since you know what the command is going to do. Can your C-w do the same? I don't think so. This is much ado about nothing, however. Plugins to get Vim-like commands in IDEs do exist. So what? The power of advanced text editors comes from this: they don't do too much, and talk to other tools, and you can compose them in a modular way. Talk about knowledge reuse. IDEs are monoliths, and refuse to talk to outside world... the opposite of modular design. Isn't that ironic? Where is your IDE when you need to edit a blog post? Or when you need to do a big text munging? Your editor will be with you wherever there is text.