10 ms·
This feels like an article about a religion or cult, not a software program. I just don't get it. Ever since newer editors got block editing or multiple insert
by crazygringo 14y ago
This feels like an article about a religion or cult, not a software program.
I just don't get it. Ever since newer editors got block editing or multiple insertion cursors, and RegEx find & replace across multiple files, and searching filenames to open... I feel like I've already got everything I need!
What am I missing out on? I don't feel like my text editor holds back my productivity. Using something like Sublime, I never think, man, if only Sublime did x, it would save me five minutes, twenty times a week!
I've never had anyone explain to me what specific kind of code editing is so much more productive in vim than in any other editor. Can someone give me a real-world, commonly occurring example?
Or is it not about productivity? Is it an interface thing? People like the way it feels to use? The article explains the "feeling" I always hear about, how vim is so much better, but for the millionth time, fails to tell me why, in a way a non-vim-user can understand.
- heretohelp 14y agoI don't understand vimmers, but I use Emacs and I can say that having your work environment be 100% programmable is pretty damned nice.
- pfraze 14y agoI used emacs for about 6 months, and just recently switched to vim to see what I think. It's been pretty subtle so far; close enough that I don't know how much the choice matters.
- dpeck 14y agoI don't think you were using the features of emacs/vim that make them awesome in their respective ways if you think the differences are subtle.
- pfraze 14y agoYou may be right-- 6 months isn't much time. What should I look into?
- heretohelp 14y agoProgramming.
- crazygringo 14y agoSo what kind of stuff do you program inside of it? What kinds of problems do you solve? I mean, I've never really felt the need to program an add-on to text editor. I download syntax highlighting packages, and there are common macros like "remove trailing whitespace" already installed. Keyboard shortcuts can be changed in lots of editors and OS's. In the past, I've definitely been upset that a particular editor didn't support a particular feature, but by now they've progressed enough that I don't really feel that anymore.
- heretohelp 14y agohttps://github.com/bitemyapp/dotfiles https://github.com/bitemyapp/dotfiles Highlights: a Python IDE with refactoring, inference, search, etc. Some hacks for TRAMP which lets me remotely edit content on arbitrary servers transparently. A Python repl. A generic compliance checker for Python code. An undo module that presents undo/redo history as a visible tree that you can traverse arbitrarily. A git client that has some EXCELLENT features. A function to dynamically reload my environment. A macro for my python debugger injector. Code to unhtml HTML content and a whitespace cleaner-upper. An interactive environment to experiment with and test regex. A mode for CSS that highlights hex-values with the colors they represent, making their properties visual. An interactive HTTP REST client interface for testing HTTP APIs. A clone of hacker-typer in elisp. Modes for clojure, erlang, haskell, rust, etc. And a nyan-cat for my progress bar.
- Wilduck 14y agoI probably define ad-hoc macros 10-15 times a day These are for tiny things that save me a minute or two each time I use one. More than the time savings, though, is the sanity savings. I've it's rare now that I do any sort of repetitive editing task. Also, you don't have to actually program the editor yourself to reap the benefits of a programmable editor. Let's be honest, most modern editors have mostly overlapping functionality. However, one of the benefits of emacs being programmable is that it's self documenting. I can find out how to capitalize a word problematically without having to go to google by using `M-x apropos RET capitalize RET`.
- draebek 14y agoLooking through my .emacs for things I, personally, have written: - A little hook to use an external Python program (cheating, I know) to look up the definition of the word under the cursor in the OS X dictionary. - Several customizations for org-mode, which I use for anything where I want to make an outline, including and especially to-do lists. - I actually still have some code to do "smart tabs" (http://www.emacswiki.org/SmartTabs http://www.emacswiki.org/SmartTabs) for some modes, though that's now probably obsolete if I would only configure up the code mentioned in that list for C modes. (I'm already using it for e.g. Python code.) - Some configuration for LaTeX editing, like packages AUCTeX doesn't know about, converting words/phrases into \gls (glossary) references. I actually have less custom stuff in .emacs than I thought. Having a programmable editor does mean that it's relatively easy for other people to write some really useful stuff which I then get to use. I have some local modifications to other people's packages which I don't have time to enumerate right now.
- dsrguru 14y agoThat's why I use Evil (http://emacswiki.org/emacs/Evil http://emacswiki.org/emacs/Evil). I get all the programmability benefits of Emacs with the more powerful editing model of Vim. In fact, the whole of Evil is actually greater than the sum of its parts, since it provides a high level interface for extending the Vim editing model itself in Emacs Lisp. Creating new text objects, for example, becomes trivial.
- rcourtie 14y agoFor me it's the insert/command modes. The command mode allows me to do all sorts of things without contorting my fingers with combination commands, which is something that annoyed me about emacs. Also makes the macro recording easy for me to understand.
- sliverstorm 14y agoCursor navigation via the keyboard, and not just the arrow keys.
- Rudism 14y agoI'll admit that when I wrote this, I did intend it as both a tribute to my favorite text editor as well as a tongue-in-cheek response to the cult-like following that it has. For me, membership to the pseudo-cult is just another reason why I love Vim.
- jdludlow 14y agoIt's mainly about muscle memory. If you're using Sublime, emacs, TextMate, or any other "real" text editor then you're fine. I don't have to think about how to perform most tasks in vim. My fingers just execute what my brain wants to see happen. That doesn't mean that vim is the greatest thing ever, just that I'm used to it and it's fast enough to get the job done. One concrete benefit to vim is that it works very well over crappy network connections, and it's installed on most every Linux system you're going to touch.
- greyfade 14y agoOr, if Vim isn't present, at least some version of `vi` will be. (Whether it be busybox-vi, nvi, or Ritter's Traditional Vi.)
- JangoSteve 14y agoI think you don't feel it, because vim doesn't save you five minutes, twenty times a week; it saves you 0.75 seconds, eight thousand times a week. Same time savings, but much harder notice the pain before you've solved it. I never felt it either, back in my TextMate days. But one Thanksgiving holiday week, I told myself, you know there's got to be something to this if all these people I respect swear by it. I decided to use vim-only for two weeks, no matter what, and I'd switch back if I wasn't hooked. I was.
- bhamrick 14y agoI switched to vim after years of IDE use, and I find it painful to go back to the IDE when I'm working on projects that require it. The biggest advantage I find in using something like vim or emacs is that you never have to switch between the mouse and the keyboard — in fact its awkward to use the mouse and that makes it difficult to get accustomed to. It allows you to seamlessly transition between code navigation and code writing, and you develop a kind of rythme that I never felt like I achieved with a graphical text editor. Other nice features are the ability to write custom scripts and repeat actions, but these can generally also be done in other editors. One huge reason I made the switch is I end up writing code on remote machines on occasion, and I can almost always do so in my everyday editor: vim. All my personalization can be transferred over to the remote machine in a single scp command and the experience remains the same no matter where the files live that I'm working on.
- xutopia 14y agoYou really have to sit down and see a vim user work to start to understand. In vim you don't just move around with arrows, then delete and then replace the text you want. What happens is you can use noun-verb associations to do things. For example on a line like this: var foo = "bar"; I could be at the beginning of the line and type the following keys to change the inside of the quotation marks: ci"baz<esc> In sublime I would do the following: <cmd>→←←⌫⌫⌫baz The difference between the two was an epiphany for me. In vim I could actually use verbs and nouns to determine how I will edit the text in front of me. I now have a language that I can use to edit text rather than editing the text using the most manual of tools and the verbs and nouns combination are only limited by my imagination and the plugins I install.
- anextio 14y agoActually you can do it with: <cmd>-<right>, <option-left>, <option-shift-right>, baz And considering you didn't have to press <mode>: beforehand, it can be just as fast. I'm a vim user, but using it for something like Objective-C in place of the wonderful autocomplete in Xcode would be a totally dumb thing to do. It's simply not smart enough to improve my productivity, even with the slight speed increases with text-manipulation.
- andrew_k 14y agoThat's why I switched to AppCode for Objective-C code editing. It has pretty good Vim bindings plugin, and you still have an autocomplete.
- weaksauce 14y agoTry out xvim if you want to use Xcode + vim. It's still alpha but I use it for all my Xcode editing. Patches welcome. edit: link - https://github.com/JugglerShu/XVim https://github.com/JugglerShu/XVim
- recursive 14y agoIf you're into that sort of thing, you can do Ctrl + F, bar<esc> in Sublime too. Most of the comparisons in this discussion between vim and non vim demonstrate high proficiency in vim, but not as much elsewhere. Of course you are more proficient in the tool you know best.
- a3_nm 14y ago> I never think, man, if only Sublime did x, it would save me five minutes, twenty times a week! You often don't notice how useful something is until you're used to it.
- andrewtbham 14y agothe most common example is moving up or down a row. most editors you have to reach for the arrow keys or the mouse. in vim, you use j key for down, k key for up. the most commonly used functions are near the home row.
- agumonkey 14y agoNot only that, it's also a point of view on computers/computing. Automate everything. Kinda like lisp macros. When you refine these manners you gain reduce workload, boilerplate, and focus on fundamental issues.
- gcb 14y agoIt talks about nostalgia. there's nothing else besides that. either you share this or not. If you saw anything else, you are probably misreading or reading too much there.
- olalonde 14y agoA video is worth a thousand words. http://www.youtube.com/watch?v=pCiVCiku3cM http://www.youtube.com/watch?v=pCiVCiku3cM http://blog.eleutian.com/download/vimteaser.wmv http://blog.eleutian.com/download/vimteaser.wmv http://blog.eleutian.com/download/vim2.wmv http://blog.eleutian.com/download/vim2.wmv http://blog.eleutian.com/download/vim3.wmv http://blog.eleutian.com/download/vim3.wmv
- sbochins 14y agoI don't see what is bad about having religious or cult like feelings around a tool. This sort of thing already exists for various programming languages. There wouldn't be any of the advancements we consider standard today in most high level programming languages if it weren't for LISP. If people weren't fanatics about homoiconic and functional features in their languages, we would be in a much worse place. Fortunately languages gaining popularity nowadays resemble LISP much more than they do FORTRAN. This probably wouldn't be the case if there weren't very smart people evangelizing the benefits of LISP over the past half a century.
- freshhawk 14y agoPeople will get into the whole verb-noun editing language, which is great, but the biggest and first real world improvement is much simpler: You don't use your mouse to move the cursor around a document. After a while you just look at the document and your fingers move and the cursor moves, you can get anywhere in the file in just a few jumps. It's not the same as using a mouse or a touchpad where you need visual feedback to place the cursor in a specific place and the movement is continuous. It feels like it takes less mental processing to do that and it is less distracting while you are concentrating on actual work. It's hard to explain, and I'm one of those people who using vim, vimperator and vim keybindings in his shell. The only other times I've reached the same levels of muscle memory taking over complex behaviour (besides sports) is when playing video games or driving a car. You concentrate on what you want done and some lower level part of your brain and your hands just takes care of it. A pointer based system just can't compete in terms of immersion. I have a feeling I just typed a lot and didn't do any better of a job explaining it.
- danneu 14y agoI think that's exactly it. Explaining nifty Vim backflips is the wrong way to sell Vim. A 15 minute session of `vimtutor` was enough to enlighten me. If I had needed a proficiency in Vim to appreciate Vim, I would've never started.
- lelele 14y agoFor me, it's about the interface. In descending order: intuitive, consistent, modular, comfortable, portable. Intuitive: most commands resemble natural language, without awkward or arbitrary mappings. For instance: - w: (forward) word; - cw: change (forward) word; - c2w: change 2 (forward) words; - 2cw: twice change word; - ciw: change inner word; There is no intervening translation. For instance, to change a word in mainstream editors, you delete it first, then start entering the new text. In Vim, it's one command: you think "change forward word", you issue the "change forward word" command. Consistent. For instance, double letters work on lines: - cc: change line; - dd: delete line; - yy: yank line; and capital letters work till the end of the line: - C: change till the end of the line; - D: delete till the end of the line; - Y: yank till the end of the line (not so in vanilla Vim, but I've remapped it because consistency matters to me). Modular: you compose commands. For instance, / is the search command and then: - d/testo: delete until the next occurrence of "testo"; - c/testo: change until the next occurrence of "testo"; - etc. Comfortable: limited usage of modifier keys. Vim saved me from RSI. Portable: letters and Shift keys are in the same position on any keyboard, be it on a desktop, a laptop, etc. whilst each laptop manufactures has its own idea about where Control, Alt, Arrows, PageUp and PageDown should be. Hope this helps.
- msluyter 14y agoI'm sorry, but although I'd agree vim is awesome, there's no way I would call its commands "intuitive." Take 'y', for 'yank.' Would anyone really argue that the word "yank" is a natural way of expressing "copy?" "Yeah mom, just yank and paste that into an e-mail... " And there's nothing inherently intuitive about '/' for searching, unless you're already familiar with unix commands like sed. Or ":" for go to line. Or "x" for delete letter. Or "jkl;" for movement, for that matter. Etc... etc... etc... A lot of people here have made the point that vim has a steep learning curve that eventually pays off, which, to me implies that intuitiveness is either lacking or besides the point. Still, I agree with your other points. I'm thinking of going back to it to minimize hand strain.
- jgeralnik 14y agoIt's not that individual commands are intuitive. Yes, you need to learn the verb for copying is y (and is called yank), the verb for deleting is d. The "intuitive" part comes once you have a basic vocabulary. You can then learn a new action and already "intuitively" know advanced ways to use it. If I learn the new verb c, which deletes and puts me in insert mode, I already know that I can type c3w to change 3 words, or ci" to change the phrase inside quotation marks. Because all verbs work on the same set of nouns and adjectives I can intuitively know what many commands do - even though I've never tried them - as long as I understand the parts that make up the command.
- dasil003 14y agoIt's all about building up a maximally powerful keyboard text editor from potent primitives. When it comes to out-of-the-box editors, nothing gives more bang for the buck on arbitrary text files than vim. That's not to say it's the best overall. If you like to customize your environment, emacs is better. If you like tight OS integration and advanced GUI features, many editors are better. If you want the most productive environment for a specific programming language then some IDE is probably better. But when it comes to raw keyboard editing, why is vim so powerful? Well, it starts with normal vs insert mode. Because insertion is a specific mode, it means every single key on the keyboard is available for direct editing commands. Of course you can have modifier commands as well, but that's nowhere near the convenience and efficiency of plain typing. So right off the bat you start with an order of magnitude more command possibilities in an easier to access position (chordless). The commands of the basic keys are designed to be a solid fundamental set of building blocks for all common editing tasks, and they are assigned mnemonically. The power of the fundamental commands is then multiplied by the vim grammar, whereby commands are applied to objects, which again are a terse and mnemonic description of some chunk of the file. In practice this means that very short unmodified alphanumeric strings you type can produce powerful changes. It's not just keystroke-counting, it's the fact that these keystrokes are also a meaningful language that makes sense mnemonically, not just through muscle memory. The more you practice, the more different ways you start to see to effect a given change. As you become more proficient, you can do more and more with a single command. This is important because commands are atomic, and you can repeat the previous command by hitting '.'. The power of this isn't really apparent until you grok the breadth of things a single vim command can do, but have you ever wanted to do a regexp search and replace and spent a long time crafting it and still had to step through it because you were afraid it might screw something up? With vim commands you can often times use simple command repetition to avoid complex regexps ('n.n.n.n.n.n.n.n.' to find next/repeat command). Sometimes I'm surprised by the mileage I get out of that, but it's really the tip of the iceberg. Because you also have macros, which are just recorded sequences of commands. But the cool part is that commands are made up mostly of regular characters, so the macros look like plaintext, and vim treats them that way as well. Vim has 26 clipboards called registers, and these registers function both as text storage and executable macro space. Meaning you can record a macro, and then paste it into a buffer, and tweak it via normal text editing, and then pull it back in and run it. Because the commands are so simple and mnemonic, it's actually astonishingly easy to do this. Once you are comfortable with it, you find yourself recording, running and dropping macros in less than the time it takes to write a single regexp. I have spacebar bound to a specific quick-macro slot so I can record and then hold down space to mass-apply a macro (my key repeat-rate is maxed as well :), this lets me do the types of things in seconds that previously would have me busting out the sed/awk book. It's very hard to communicate the impact this has on your editing workflows to someone who doesn't get it. It's sort of like a git user telling a svn user why easy branching is so awesome, the svn user just doesn't get it because they've already convinced themselves they don't need branches precisely because they are so hard to use. In short, the vim advantage is about powerful editing primitives and easy ways to compose them. There are certainly many great editing ideas that are not in vim, but in terms of the fundamentals for keyboard editing, it's hard to imagine anything better.
- jaggederest 14y agoIt's about a text editor that you learn more about and customize until it fits you like a glove. Then you reap productivity benefits for the next couple decades.
- mixmastamyk 14y agoWhen I'm coding the bottleneck is my brain, not input speed... so vim seems like a micro-optimization to me. I use CUA and can be productive everywhere immediately, even if it may be a bit less efficient.
- flyinRyan 14y agoIt is in a sense. For some reason, vi[m] gets more play on this site, but pretty everything you can say about vim also applies to emacs, with one critical different (and the reason I switched): vi* is modal editing. Every report I've seen on the subject says that modal editing is a no-no. As a vi user, after seeing this for the first time I realized that, indeed, it had happened to me several times that I thought I was in text mode but was actually in command mode.... oops. I type 80+wpm so by the time realized the mistake I had trashed my file beyond recognition and had overran the undo buffer. There was nothing to do but lose all changes and start again. This can't happen in emacs because editing isn't modal (though commands are very contextual). vi* is certainly easier on the hands than all the cording but getting rid of modal editing means no more wasting time when your brain is out of sync with the editor. Having said all that, I'd still pick a nice IDE over either of them, since the IDE understands the language I'm editing and can e.g. change from simple minded "mass edits" to actual refactoring.