4 ms·
Excellent comparison, thanks. It's important to note that many modern text editors do have concepts of "words" and "lines" and such that can be used in similar
by calinet6 14y ago
Excellent comparison, thanks.
It's important to note that many modern text editors do have concepts of "words" and "lines" and such that can be used in similar ways. Granted, not near the extent of Vim, but they're still useful.
In sublime for example, I can Ctrl+Shift arrow to select words before and after. This even works with multiple selection (multiple caret positions). It's pretty cool.
Again, I understand that Vim is more of a language to describe editing text and is very efficient, I'm just saying you can get close with modern editors, and personally I find their visual language to work better for me.
- solutionyogi 14y agoAs z92 mentioned in reply, you missed my point about the fact that EditPlus or Sublime will force you to move to the beginning of the word before you can select it. Try the above exercise in Sublime and then in Vim so that you can see the difference clearly. May be that will kick in that bulb in your head and you will see Vim in a whole different light. Trust me, it took me a long time before Vim 'clicked' for me.
- recursive 14y ago> Sublime will force you to move to the beginning of the word before you can select it. Only if you don't know how to use it. Ctrl + D does it in fewer keystrokes than you can in vim.
- solutionyogi 14y agoSure, there could be a short cut to make this particular example easy. But can you combine this knowledge and use it everywhere? Let's say your sentence was like this: "Why, oh WHY, do those #?@! 'nutheads' use vi?" [Notice that word 'nutheads' is enclosed in single quotes.] If I am on the letter h, I can press [ciw] to only replace nutheads word with my target word, it will keep the single quotes as it is. OR If I wanted to replace the whole word including the quote, I would press [ciW] (notice the capital W) Now, can you use that knowledge of Ctrl + D in this situation in Sublime?
- recursive 14y agoI'm by no means a sublime expert, but I'd approach those scenarios like this. For replacing the inner content, Ctrl + D still works. To also replace the quotes, I'd use Ctrl + D, Del, Del, Backspace. Yes, in the second case, Sublime is one additional keystroke. I know you could come up with examples that would show bigger advantages for vim. FWIW I do believe that vim has advantages to some editors in certain scenarios, but I think those advantages are overestimated by the vim-inati. If you've spent years learning one editor, of course it will seem more capable than editors you have used less.
- johncoltrane 14y agoWhat if it's 'so called nutheads' that you want to change? AFAIK, Sublime Text 2 doesn't provide a shortcut for that. You can do Ctrl+D to select "called" but then what? Extending selection to scope or brackets won't help and you are back to a series of Ctrl+Left -> Ctrl+Left -> Ctrl+Shift+Right -> Ctrl+Shift+Right -> Ctrl+Shift+Right. In Vim, that's ci', or ca' if you want to also remove the quotes. Hell, you don't even have to move the cursor to the quoted text to do that. This scenario happens dozens of times in a given day around here and, as for many other little things, Vim and his "awkward" language and it's "antiquated" modality rule. The irony, here, is that you actually can change the content of a pair of quotes in ST2. If you activate its Vim mode.
- calinet6 14y agoAs the other reply mentioned, it's Ctrl+D, and there are many other ways to accomplish the same things that Vim can do in general. Maybe one is slightly better or more efficient, but they're really not that different. Not to get into a holy war, but that's is one of the things I don't really like about Vim—the community is pretty religious and Vim "can do no wrong" in a sense. The process of conversion is just an epiphany and if you haven't realized that, then you must just not have used it enough, because it's factually better. Not really true. I'll leave it at that.
- solutionyogi 14y agoI am sorry if you get the impression that we are trying to suggest that Vim can do no wrong. Your original comment was exactly how I felt when I was learning Vim. I also thought that Vim is obtuse and it gets in my way. And now after using Vim for over 3 years, I now know why Vim is the way it is and I was sharing my epiphany. By all means, use the editor which makes you most productive (you are already ahead of 70% folks who don't even care to find better editor). But at the same time, if you think that Vim is crazy, at least listen to the other side of an argument with an open mind. PS: I also replied to comment by 'recursive' on the Ctrl + D shortcut.
- FuzzyDunlop 14y agoI think you just embodied the entire sentiment the GP was criticising: the whole concept that Vim is not an editor; it's a state of mind. I compel you and anyone else who is quite dogmatic about their choice of editor to try explaining it in such an objective, non-patronising way, so that the layman can think, "oh, it sounds like it's worth learning then." I'm not a Vim user per-se, but I'd find more value in something like this, possibly with a more specific follow up: Vim works a bit differently than other editors. It cares more about manipulating existing text than creating new text, and so it tries its best to let you make changes without just deleting and re-typing from scratch, or using your mouse to point and click and drag and highlight. It has a steep learning curve so it's initially hard to adapt not just to this change in perspective, but also to the commands and shortcuts that allow you to be more efficient and productive. Such is the investment of time and effort required to do be good in it, you might consider grokking Vim a commitment as big as grokking your programming language of choice. However, you will in return acquire a life-long knowledge of working in Vim, and using it will become second-nature and infinitely preferable to manipulating text by hand. As a developer, knowledge of Vim is valuable because of two things: 1. Portable configuration: what you learn, and how you personalise your editor, is transferrable to other machines, as it's just text. No modern editor has adequately replicated such basic functionality. 2. Ubiquity: you can't load Sublime Text, Textmate, Eclipse, {$gui_editor} on the VPS you routinely SSH into. You will, however, have access to Vim, or its predecessor Vi. You can thus have a somewhat familiar environment when working on remote servers, without any faff.
- z92 14y agoWhen your cursor is in the center of the word, you can't use ctrl-shift arrow to select that word [it will only select part of the word]. Therefore first you need to move cursor to a side, then start your ctrl-shift work that you described. GP highlighted this special thing. I guess you missed his main point.
- dllthomas 14y agoIn terms of finger travel, if I've already moved my right hand to the arrow keys, and my left hand to ctrl and shift, then it's simply hold-ctrl, left, start holding shift, right. While not quite as simple as ciw, my main complaint is moving my right hand all the way over to the arrows and back; complaining about the comparative complexity of the sequence seems ridiculous.
- lelele 14y agoWhat annoys me about the arrow keys is that I can't reach them without looking, and they also change position on different keyboards (standard keyboards vs laptop keyboards, for example). Having to look to the keyboard distracts me.
- dllthomas 14y agoAgreed - needing arrow keys in the middle of doing anything else is bad. My point was that, in this particular case, the fact that the arrow keys are needed is basically all of the bad, and that the parent's complaint of increased complexity/typing is certainly not strong and perhaps not valid.
- lelele 14y agoMainstream editors get close to Vim only if you use Vim as it were a mainstream editor. Yes, on a mainstream editor you can use Ctrl+Shift+Arrow to select words - which already requires you to move your hands way more than Vim would - but - among other things - how do you cut/change/copy text: - up to a specific character? - up to a specific string? - up to the beginning/end of a document? - up to the beginning/end of a sentence? - up to the beginning/end of a paragraph? Good luck ;-) Maybe these examples are lame because I haven't edited text in a while and I couldn't think of anything better, but I hope you can see what we are talking about. Read PG's essay about Blub languages and Lisp, then replace Blub with mainstream editors and Lisp with Vim and you'll understand why Vim is better. My colleagues used to ask me why I kept using a weird editor, and when I answered they replied the same way you have done, yet they always marveled at me editing texts at insane speeds. Go figure. With Vim, you also have a reduced mental load, as its command set relies on intuitive and flexible composition. Actually I don't even use Vim. I use a Vim mode for GNU Emacs, which gives me these added advantages: - learning a Lisp (ask Eric Raymond why this is advantageous); - having a powerful batch text processing tool (no need for Perl, Awk, and the likes); - a box of tools for several tasks which are more powerful than mainstream ones. Have fun.
- calinet6 14y agoI love how every Vim user speaks to non-Vim users as though they're novices that are just "not there yet." It's cute.
- lelele 14y agoNon-Vim users are novices that are just "not there yet", when it comes to text-editing. The Vim way is the most simple and effective way to edit text by means of a keyboard. Like Lisp and the Dvorak keyboard, it's alien, but it's actually simpler. Maybe, now that touch-screens are becoming commonplace, an equally or more effective new way will be developed.
- swah 14y agoMy guess is GP knows how to use Vim, and yet he's happy to use something else... but many Vim users can't imagine that scenario. I personally know and like Vim and Emacs, but I'm using ST2 because those editors lose some of their greatness on vanilla Windows. And Emacs keybindings do hurt my wrists. Also, I could never get really fast at editing multiple files inside a single Vim session. Nothing near Emacs with ido.el or vanilla ST2. I already tried Lusty* packages and Nerd* packages... It's also kinda hard to prevent :q from quitting the whole editor, which always bugged me. When I open it from the terminal for a quick fix on a single file, Vim works very naturally and I think, once more, "hey that edit was easy and fast - why not switch to it as my main editor?"...