Everyone Who Tried to Convince Me to Use Vim Was Wrong
yehudakatz.com
yehudakatz.com
I recommend people making it their desktop background. Being "in your face" helps you remember to learn and explore things like 'ca)' rather than just hitting delete and arrow keys a bunch.
>"Can you tell me a way to switch that will not significantly reduce my productivity for the first few weeks."
Two obvious answers that came to me while reading that sentence: 1) Use it at home/off hours/for side projects/etc until you are proficient enough to do work with it. 2) Use it for 1 task a day, then 2 tasks, etc.
The "Turn everything off" is stupid way to start. [Altough it's one way to reach next level after you are basically proficient] Clue to OA, find better people to get advice from.
> I was able to get here because I used my [blah, blah, blah]
No, because you stuck it out. Like most worthwhile things Vim is not instant gratification.
Then I picked up these cheat-sheet tutorials and WOW! Just code as usual, but in vi with the first easy cheat-sheet lying in front of you; almost no productivity hit, and you seamlessly build up the cheat-sheet 'till you know all the commands!
The only way to learn vim, I think.
Commands stuck when I saw someone else use vim, do something I didn't know about like yyp, and I asked how they did it. I'd like a video of someone using vim for real work and then explaining how they did it.
PeepCode also sells two screencasts about Vim that I think are quite good. (http://peepcode.com/products/smash-into-vim-i and http://peepcode.com/products/smash-into-vim-ii) Depending on how long you've been using Vim, you may find them a bit basic (especially the first), but Vim has so many nooks and crannies that you will likely pick up some things anyhow.
I didn't have that opportunity, but a few screen casts really opened my eyes as to how far down the rabbit hole I should consider going...this one in particular is a pretty amazing example of someone with some serious keyboard AND customization chops:
Or maybe Menu, Windows, etc. keys, on keyboards that have them.
As pointed out, Textmate is a new editor and you don't come to a standstill when you use it for the first time. But Vim is a fundamentally different KIND of editor than Textmate. It's not that it's a different program. It's that it's probably the first modal editor you've ever used. As far as I'm concerned, the whole bulk of the first and hardest step in learning Vim is just wrapping your head around editing modally. Whether you want to disable your arrow keys and obsessively leave Insert mode, in order to cultivate good habits, or you just want to muddle through and implement Vimisms where you can is wholly up to the reader. It's analogous to whether you want to cover your keycaps and use dvorak all the time even when you can't touch type, or just ease into it. But the hump, the bit that's a qualitatively different experience, is the modality of the application.
The only thing I've ever had a hard time getting used to with Dvorak is the diagonal movement commands in nethack. hjkl is not a big deal, but yubn trips me up.
I like Emacs's extension model, and its "everything is a buffer" design, but dislike its modifier-heavy keybindings. I like vi's modal interface and general command orthogonality, but would rather have a persistent, extensible, etc. environment. (Also, I like Lisp, but elisp kind of sucks. And I have written, and continue to write, a fair amount of elisp.)
On the balance, Emacs works better for me, though if a synthesis of the two with a good extension language (I nominate Lua) ever comes along, and retroactively gets the ten programmer-centuries of work it'd take to match what Emacs has, I'd switch in a heartbeat.
Also: Yes, I know about Viper and the other vi-emulation modes, but people who write Emacs extensions follow the cultural standards for keybindings, etc. Including me.
hjkl is kind of a red herring in this case. those keys happen to be bunched together in qwerty, but that's an irrelevant accident of history, and those keys are not used very commonly to begin with. at least, they shouldn't be used very commonly. much better and faster keys are: 'w', 'b', 'I', 'A', '{', '}', 't', '/' etc.
" Dvorak
" Normally, < ^ v > == h k j l
" Here, < ^ v > == h t n s, d remains delete
noremap t k
noremap k t
noremap n j
noremap j n
noremap s l
noremap l s
(And for those accustomed to vim, there is no error in the layout.)Definitely gratifying to hear this guy's experience, BTW. I got religion when it comes to Vim. If you spend 8-10 hours a day editing text, it makes sense to put some thought into how you are doing it. Small efficiency gains add up.
} else if (...) {
line, repeat... To go the other direction, ^ moves you to the first non-white character, the close brace.http://github.com/andrewvc/vim-settings/blob/master/vimrc
I only remapped some of the keys though. Remapping ':' is really useful, I have it mapped to - (which is , in qwerty), which means its only a step away from my right pinky, no shift required.
The problem with this argument is that it clearly shows why so many people get stuck in local maximums, even though there are much higher peaks around, one just has to walk downhill first and then uphill again.
It takes sweat.
Then again, I have a sneaking suspicion that it has to do with people liking the exclusivity factor.
They both come from a day when all UI's were text based and so it's not surprising that they offer more powerful editing models than newer alternatives, considering they've both had 30 odd years of refinement.
It's also understandable that people find them more difficult to use. The major advantage that a GUI has over a text interface is that it's more discoverable and given that most people these days have grown up around GUI's, we thus find text based UI's intimidating.
Either way, as developers, most of our day to day tasks revolve around editing text, so I'd say that using a tool that's aimed at giving us maximum textual love is a good thing.
And don't get me started on asking why, after all this time, emacs still defaults to non-CUA when it has a perfectly good mode that emulates it? That's just asking to keep new users away.
I've seen plenty of people who only dip their toes in with vi and never get this. You feel the frustration when you watch them try to use it - pressing the 'x' key repeatedly, or navigating around whilst in insert mode.
I never knew about that ci" usage he mentions. Very handy.
If you pick up a new language (say) and are immediately fluent, have you actually learned anything?
Katz's counter example is that he "didn’t really have to put up with a huge amount of pain when switching to Textmate for the first time. In fact, it was downright pleasant." Note, however, that (based on what he says about his TextMate usage) all he every did with TextMate was type text. He didn't use snippets or commands much. As he says, "When I really thought about it, Textmate wasn’t doing all that much for me. It was a glorified Notepad which had working syntax highlighting and understand where to put the cursor when I hit enter (most of the time)." So TextMate didn't hurt, but it also did help. In my mind Vim is likely to do both: hurt at first (it's a big adjustment), and help a lot later.
(That said, I don't think there's anything wrong with learning Vim more gradually, as he's trying now. But his initial demand of "no significant drop in productivity" isn't as reasonable as he seems to think.)
There's a fundamental disconnect between me and the programmers who say "the only real choices are Vim and Emacs", and I'm fully willing to consider that I'm doing it all wrong, but I wonder if there's anything out there that could convince me that living on the home row in a modal editor can work me through the entire job of being a programmer and maintainer, as opposed to editing and entering text in a single or very few files.
I really tried to like Rad Rails, but I it just felt like overkill, and the interface was too complicated. Besides adding a breakpoint to a rails app is as simple as adding the line 'debugger' to it. No big deal.
I've heard that for Java the situation is reversed, but I'm not a Java programmer so I couldn't say if there's anything to that.
I know what you mean, but... Vim is first and foremost a text editor, and one could argue that none of this is a text editor's job. (In the spirit of the Unix tradition, do one thing and do it well, etc.)
You can customize Vim a great deal, but it isn't really meant to do all of the above. I can see why you would choose to go with an IDE instead.
I use Emacs for a lot of Python and Django work. I can visually step through debugging, add break points, watch points, and etc... with Emacs.
Emacs was designed with extensibility from the ground up, and there are a lot of debugging plugins that turn emacs into an "IDE".
As far as setting breakpoints and stepping through, I personally use the gdb console. However, you can set breakpoints by clicking the left margin of the line you want to break on, and I believe there is a key map for stepping through.
I use Geben as the emacs plugin to connect to the debug client. http://code.google.com/p/geben-on-emacs/
The benefit of this is that I can debug remotely, or when I have my development setup in a chroot or virtual environment, I can still debug from outside.
Also, because you've put the glue in place yourself (by hooking up GDB, creating separate windows, running SQL commands as subprocesses, etc.) you've really tailored your environment to your needs. And trust me, once you get to that point, no other IDE will compare.
ViEmu, although not free, is a first class Vi mode for Visual Studio, so good that there's barely anything I use in Vim that isn't available in ViEmu.
For Eclipse, Vrapper is an excellent newcomer that implements a pretty large portion of the Vi command set. It's not as complete as some of the other Vi modes for Eclipse, but it's definitely the best integration I've found, and hasn't fallen done in edge cases like the others have.
Good (and as so often, kinda obvious ;) advice.
Apologies if the title wasn't as reflective of the content as I had hoped.
(Disclaimer: I do use Emacs, mostly.)
Haven't tried learning the keybindings yet myself, and I've heard VIPER isn't the complete Vim.
It amuses me that people actually think that's just a joke.
Emacs is far easier to script and plays nicer with other programs so there are more, more useful extensions for working in various languages. On the other hand, I find vim's modal interface faster and easier on my hands than emac's chording interface. viper-mode in emacs might be ideal.
Ergonomics. There's an emacs key chord for everything, but many of them involve two or three modifier keys.
i.e. search and replace is Alt+Shift+5, indent block is Ctrl+Alt+\
These require some finger contortions. I haven't used vim, but the impression I get is that similar commands in vim are all closer to home row so you don't have to contort your hands as much.
search & replace is % indent is > (auto-indent is =)
Emacs seems really neat, and I'd like to try out some other editors, but none of them compare to the ease of vim's modal style.
See :help motion.txt - they're in section 6. Text Object Selection. Also, just play around with them a little. For example:
<p>This is a tes|t. Do not be alarmed.</p>
If that's your text, and the cursor is at the pipe: ciw # remove all of 'test', enter insert mode
caw # remove the word 'test' and preceding space, enter insert mode
vit # visually select all the text within the <p> tags
vat # visually select the whole <p> elementThe composability of vim motion commands is what keeps me using it.
Edit: seems actual jump selection can be finicky.
Even better, you can use b instead of ( and B instead of {, because it's easier to type.
Firstly, that your title should align with the broad story "I like Vim now / Vim is pretty good" as well as the specific story "The usual advice on how to switch is wrong". Your title strongly implies that Vim is not worth learning and that you should ignore people who suggest you try it.
Secondly, that you should start with your conclusion and slowly expand on it. This is because you don't know how much of your article any given reader will read before giving up or getting distracted.
These are both a non-trivial effort. How do you, for example, convey the entire meaning of the article in the title while still making people want to click and read? How do you hit them with the key argument of your story without building up the foundation?
It's only in the past few months, I've realized that every major IDE out there - from Visual Studio to Netbeans have plugins to enable vi-mode. Heck, many popular ones like QT Creator, KDevelop, MonoDevelop have Vi mode baked in right into the IDE itself, ensuring a high degree of integration. This gives you the best of all worlds - you get an intelligent, yet efficient editor.
A lot of projects exist, like VimWrapper[1], which enable application developers to embed Vim, or to emulate its functionality without excessive efforts and re-implementing the same code again and again. The Netbeans protocol in Vim is still used by editors like Pida to skillfully embed the entire editor, and there are great projects like Eclim, which prove the degree of integration Vim can have with its environment despite the governing policy discouraging interaction with external tools.
Personally, I switched to Emacs for two months (or tried) but found that with some tweaking, most of what can be accomplished by Emacs can be done using GVim. I feel, that with a little effort, the vi-emulation in Emacs itself can make for a better generic editing experience than either of the standard editors.
Besides cat, pipes and grep, vim is the only useful editor (i.e. works in the command line over ssh) you can count on always being on every *nix machine. There are a very few it is not included in, but these do not have any other editors either.
I'm curious: when have you come across an editor-less unix?The vi-less ones I've come across have generally had some bizarre substitute that uses wordstar keystrokes or something equally obscure...
You raise a fair point, though: knowledge of vi = knowledge of ed which will work even when vi won't (horrid slow link and/or broken terminal emulation).
I would certainly suggest anyone switching to vim or emacs that they mod the heck out of them, just to make it bearable. You can always peel the mods off once you get more comfortable with the tool. After all, what makes these editors so awesome in the first place, is exactly that you can mod them.
I am one of those rare people that can't use MS Notepad; I routinely get weird dialogs popup in applications because I use emacs key-chords from muscle memory.
That's a disastrous series of commands.
So C-a C-x C-s C-v C-s is just a funny way of saying C-s.
After all, emacs comes out of the box with menus, a toolbar, normal keybinds, to set people at ease if they are used to "normal" text editors like Notepad or Word or something. At least GUI emacs, that is.
I thought that it's after you learn a bit more about emacs that you normally turn all those things off and just rely on commands and key bindings and your own custom modifications.
An aside: In my experience, it also seems like this "newbie-friendly" environment sometimes turns off vim users who consider emacs to be somehow "less hardcore" and therefore worthy of scorn. Which is weird for a few reasons.
But once you get past sqrt(15i*π)/2 emacs mastery, you stop using the menus and start using M-x with tab completion. There's a standard naming scheme, and usually local commands are prefixed with the mode name. And in any case, there are generally far more than fit on the menu anyway.
I'm pretty much entirely lost in a vanilla emacs installation.
This is actually one of the things which stops me from going too crazy with my emacs customizations. I have a lot (and long ago disabled toolbars, menus, etc.) but occasionally using coworkers' emacs, and using 'zile' on my OpenWRT routers and the like, means that I like to be able to remember the emacs defaults for most of the common things. :)
His secret weapon is the ability to quickly and decisively design software. I waste time tweaking and iterating to (hopefully) find a similar solution.
I never broke the habit myself, and I suspect the benefit is a lot smaller on a laptop keyboard versus an AT keyboard.
Actually, the same is true of most vim stuff: does being able to delete text 2 seconds quicker really make you more productive? Beats me. But after you get used to being able to tell the computer what you want to happen and have it happen (e.g., delete everything inside these parentheses), using the old method of moving around the cursor just feels bad.
First, you can use ctrl+[ to get out of insert, which means moving your hands less.
Even better (but requires customization), you can remap "jk" to get out of insert mode. Since "jk" is a combination that never comes up in actual writing, it works great. And it means you don't have to move your hands at all from home row.
:imap jk <Esc>
(Literally type the angle brackets.) And if you want this as a standard default, make a .vimrc file in your home folder and stick the above without the colon in there.And the only times I remember having to actually type jj are when I'm having the Vim keymapping conversation with somebody who asks "So how do you type 'jj'?
:)
(EDIT: uhh, the :) is a smiley, not part of the command)
Ctrl-O takes you to normal mode for a single command and then automatically goes back to insert mode.
Frankly, I find it easier to map Caps to Escape. Only problem is when you use other people's systems and you keep hitting caps lock when you mean to hit escape (Even if you're not in Vim)
But yeah, I /can't/ use others computers without getting utterly frustrated because of that. :)
All of this assume that you type 10-finger blind, but I guess if you can't even do that you have other priorities than learning vim.
When I help people learn vim, one of the first things I do is disable the arrow buttons in insert mode. I tell them that they should avoid using them even in normal mode. I feel that this crutch ends up hurting you in the end. On the other hand, writing text in non-vim contexts is maddening with all it's arrow-arrow-arrow-backspace-backspace-backspace pain. I don't see how 99% of people can stand to do it this way :)
http://www.viemu.com/a-why-vi-vim.html
See "misconception #4" for this particular point.
In Vim, especially the GUI version, it's perfectly possible to just press 'i' and then putter around in your text file, moving around with cursor keys and Home/End and such, deleting, typing, and only occasionally dropping back into "command mode" (as it is often called) to delete a line, or search for something, or save the document (assuming the GUI version doesn't have key bindings set up for this already). I used Vim like this for over a decade, never really understanding the point.
As the article points out, this is completely wrong. You stay in command mode (called "normal mode" here, which gives it a different feel immediately -- it's the mode you normally should be in), and switch to insert mode only to type short bursts of text. Everything else is done in command mode.
While this seems weird at first, once you start getting the hang of it, it starts paying off big time. There are a zillion commands that do something and then enter insert mode. I used to think they were completely redundant; there's already 'i' and 'a' to do that, why have more? Because, obviously, when you spend most of your time in "normal mode", this allows you to execute a command and immediately start typing text. E.g. to insert a new line below the current one, you press 'o', and Vim inserts the line, indents it properly (if you have autoindent set), and is ready for typing.
While this is hardly heavy wizardry, once you know a couple dozen of these commands, editing becomes a very different experience. You just move through the text differently.
Anyway, the article explains this, and a lot more, much better than I can do it here. :-)
Vim has other problems (like the insert mode), but even in vim you can do as the author says: always be in insert mode, and pretend it's just a normal editor.
The difference is (full disclosure, I pray at the altar of emacs now, after many years of vi), much of vim's functionality is hidden if you stay in insert mode, while in emacs, you always have everything available to you (and in many cases, it'll suggest "next time, use this shortcut").
Modal editing is unbeatable. GNU Emacs + Viper + Vimpulse is the way to go.
I agree that Emacs allowing you to access commands while inserting text is nice. However, what are you doing in Insert mode? Hit Esc as soon as possible, my friend ;-)
Writing things?
I didn't become proficient at modal editing until I followed the advice of staying in Insert mode as little as possible, just to enter short bursts of text (and then remapping the Esc key becomes a must).
I was saying something about the post I replied to, I wanted to point out that it's easier to ease into emacs without sacrificing the chance to learn about it for familiarity.
Unluckily, you feel the power of Emacs decrease!
EDIT: Added command names.
Editing text is a solved problem. vim or emacs, pick one and get back to work.
I won't run the same test with vim, because I don't think it will be much different, and the insert/command mode would drive me nuts.
Believe me, then the programming language is the issue, not the editor.
It's especially funny, if people claim that their ide is superior, because they can automatically generate boilerplate code, but never question their programming language.
Autogeneration of code is nice when I write Java code, but even Haskell has a bunch of boiler plate import codes, as does Python and Ruby.
Search for: omnicompletion + <language>
but vi keys force you to have your right hand in the wrong position. sure its more convenient than bpnf (emacs style memnonics) but i dont like it for typing, especially when using a lot of special characters, that is, coding...
One thing is for certain: Vim will never die. It's over 35 years old now, almost as old a Unix and C.
Jump to the paragraph "The Dark Side".
I remember when I first learned HTML (without CSS). It was simple to get the basics down, I memorized a few basic tags and attributes, and over time I learned more and more tags/attributes until I had a respectable catalog memorized that I could use when needed. It's similar with vim, but I find even after years of using it I can still learn new, neat features about (or packages for) it. (P.S., thanks to the article author for the ciX command.)
RTFM! ;-)
O'Reilly has good intro books on both of them that you can work through in a weekend.
Yes, I know it seems silly to have to read a book to use a text editor, but working through the book and doing the exercises the same way you would for a programming language or API makes the learning curve much, much easier.
But it's an IDE and I needed something for javascript files and html files that was in the range. So I switched for this only reason. I switched the exact same way you did, using the mouse at first, I spent time in the help for every issue I had, I learned motions, macros, etc...
Interestingly I've never found something as neat as the "of" command of VS, but I loved all the rest.
Have a look at http://www.vim.org/scripts/script.php?script_id=1984. I love it!
Perhaps you used an older version, because the version I'm using is caching (2.22.3).
I bet you he'd be happy to say 'OH YEAH SWITCH TO A MAC', but guess what - it will reduce your productivity while you're getting used to new programs, new keyboard shortcuts, etc.
That stores the yanked text into the "a" register. When you put, instead of just p, use "ap
That puts from the "a" register, and you can repeat the action since the register is never overwritten unless you tell it to. You can also use b through to z to store other things. The same registers can also be used to store macros and marks.
Usually you use the default register (I think it's ") and this register also gets various stuff saved to it automatically (eg. stuff you delete). (This is how stuff like xp to swap the current and next character works)
I hope that answers your question.
> That puts from the "a" register, and you can repeat
> the action since the register is never overwritten
> unless you tell it to. You can also use b through
> to z to store other things.
The '+' register is used to interface with the X11 (or Windows) clipboard. Example: "+P Paste from clipboard
"+y Yank to clipboard
"+gP Paste from clipboard, move cursor to end of pasted textI was excited when I saw you application hoping it added a normal mode to cocoa text fields but alas it does not.
I know I going to sound harsh and critical, but I really do want you to succeed ... you have a beautiful website but app does not do very much. The shortcuts are not standard vi(m) shortcuts.
Looks to ViEmu for inspiration: http://www.viemu.com
I would love to buy something like ViEmu for cocoa and for Microsoft Word for Mac.
Though I've switched over to emacs now. ;)
25. meeiw: What is vim doing better than emacs?
-----------------------------------------------------------------------
RMS: Sorry, I have never tried using vim.
I never felt I deserved such a large penitence ;-).
So OP, you're not alone. =PCan we move emacs vs. vi to somewhere not HN, pretty please?
These questions are asked honestly and sincerely and I'm genuinely interested in reading responses:
At the end of the day, what is the big deal about a modal editor? How does not-having-to-press-ctrl (or alt, meta, cmd, whatever) for the first key give a programmer any advantage? Is it just the number of these commands that are available - and if so, has someone done a count of commands available in products like IntelliJ and Slick-Edit vs vim? What about the stuff that seems to be missing, like contextual refactoring - or are there plugins / scripts for that?
Without any such evidence, it does seem to me that programmers want to use vim because of a reputation that hardcore hackers use it, not because it actually improves productivity.
There are lots of plugins for vim, but I'm not up on what would be specifically relevant because I do major editing in Emacs. (Also, I think when most developers need that kind of tool support to use a language it speaks volumes about it, but that's me.)
I like Emacs's extensibility and multi-buffer design, but prefer vi's modal keyboard interface. I like its brevity and orthogonality. Number of commands is less important when each combines cleanly with the others. I would love to see a synthesis of the strong parts of vi and Emacs, though I don't expect it to ever happen - Emacs's giant bundle of elisp has way too much inertia for a full rewrite.
How useful are IntelliJ and Resharper for (say) Erlang, by the way? While I haven't used either, those editors look like they're more tightly focused on Java and C#, whereas vi is for editing any kind of text, and Emacs has had at least passible support for every language I've ever used (except Joy). Comparing vi to an editor specifically designed for Java is a bit misleading.
m.foo( bar baz);
Does this foo need to be changed? You can't know without knowing what type 'm' is. Good luck writing an awk script for that. This isn't a debate about whether or not it could be done. Its about whether or not you can do it faster than I type Ctrl-F6.If such a tool exists that I can run from bash, please let me know. Otherwise you guys have advanced from type-writer to the early dedicated word-processors that existed in the 80s, but no further.
Jetbrains have refactoring tools for C#, Java, Javascript, Python, Ruby, PHP, Adobe Flex, as well as "basic" language support for most others (but no Erlang I'm afraid).
As you say, vi is about editing text. But the author is a member of the Ruby on Rails core team and a core contributor to Ruby projects, and I put it to you that most people using vim dont use it to edit just text: they edit text that happens to be a language with a formal grammar, and structure both with the file, and outside it: i.e. contextual. Hence, a good IDE will always be better than vim.
I also dispute the idea that, given a new language, vim will be better at editing it. My IDE will likely be able to do exactly the same things vim can do, using the keyboard only, and with (on average) the same number of clicks. However, the IDE will most likely be intuitive, obvious, and easy to learn (e.g. by giving visual feedback), meaning that in reality, even though vim could do as much as my IDE for an expert user, for the average user it wont and never will.
I think it's bad design to have refactoring tools be a part of the editor, proper, rather than as a standalone tool the editor calls. It's more a matter of static analysis (or runtime introspection) issue than editing per se.
You make a good point about refactoring. It's useful, and I should do it more. But this comment goes a bit too far:
> [people edit projects, not text, therefore] a good IDE will always be better than vim
This is an unassailable assertion. If anybody manages to come up with an example in which Vim is better than an IDE, it is always possible to respond with "that's not a good IDE", possibly with qualifications ("you shouldn't be editing Java in that IDE").
One possible response goes to the definition of "better": I contend that Vim is, in fact, a better environment for creating, debugging, and generally editing files. This is actually a large part of what I do, so I appreciate it. I have been using Eclipse quite a bit recently, because it's the standard IDE for Android app development, and while it provides some great refactoring tools, it is not nearly as good as Vim is for actually editing code. I don't really understand what you mean w.r.t. "formal grammar": even Vim and Emacs can be trained to do things that rely on language-specific syntactic knowledge (examples: code completion, code folding, context-specific search). What's missing in non-IDE editors is a concept of a "project", and semantic knowledge for refactoring. That is not the same as grammar.
Let me reduce "good ide" to IntelliJ or Eclipse if that helps.
By "formal grammar" I mean that both Eclipse and IntelliJ have full Java parsers. So they can successfully rename a method on an interface, all its implementations and all its uses. This can be done if and only if the tool can correctly identify which text symbols represent a class, interface, variable declaration and method invocation, and further it can infer the type the variable in a method invocation using information from that variables declaration, even though it may be in another file.
That needs a parser. So you are correct in that you don't have to write a formal grammar to do it. You can hand role your parser. I used "formal grammar" to imply a level of complexity. Does vim have a tool of such complexity?
Moreover, the command cib itself is built from composeable parts - c (not sure what the mnemonic for this is but its delete then enter insert mode), i (inner), b (block of parens). There are several commands besides c - d (delete), < (left indent), = (auto indent), etc. And these compose with any motion, eg gg (goto line 1), G (goto end), w (next word), etc.
So you have all these powerful ways to jump around the file, and you can combine them with all these powerful ways to manipulate the file. And this is just one of the really nice things about vim. The "." (repeat last command) is something I haven't found in any other text editor, and was the main reason I got hooked on vim.
( "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.
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.
You can also preface those with a quantity. As a pretty arbitrary example, 5dwelp* is "5 delete-word move-to-end-of-next-word right paste", or, "move the next five words forward one word".
In Emacs, repeat is C-x z, by the way, and then you can just keep hitting z.
Focusing on what it can do is irrelevant. I've been programming 29 years now. Can't think of a time I've needed to do that.
If I still used vi regularly, I probably could have given you a better example. Actually, I couldn't, but my fingers could have. :) It had all moved to muscle-memory.
Emacs's interface is a bit more cumbersome, but it's also easier to follow it with, "...and from now on, call that X and add it to the interface".