9 ms·
Reasons To Give The Vim Text Editor A Chance
- 16s 15y agoMy reason for using vi/vim is that it's the lowest common denominator text editor. You'll find it by default on most any Linux or BSD system.
- surfingdino 15y agoThat's my reason too. I use it on Linux, BSD, Mac OS X, and MS Windows. I like TextMate for some tasks better than Vim, but my ratio of time spent in both is still 9:1 (Vim:TextMate).
- davidtgoldblatt 15y agoMy reasons for being a vim user a lot more practical than those I see on these "top 10 reasons for trying X": - In the long run, it's faster to learn and use an "efficiency" editor, so I need to learn one of vim, emacs, notepad++, etc. The differences between these are probably negligible for a proficient user. - Of these, only vim will be installed (or vi, which has a big enough overlap that it won't matter to me) on every system I'm going to need to use. These are, incidentally, the same reasons I use QWERTY instead of Dvorak.
- singular 15y agoDvorak has actually been shown to really be no better than QWERTY - http://reason.com/archives/1996/06/01/typing-errors/3 http://reason.com/archives/1996/06/01/typing-errors/3
- OneWhoFrogs 15y agoYou're right about that, but Dvorak is much easier on the hands. The average distance travelled by your fingers is greatly reduced. (It looks like Colemak beats both, though: http://colemak.com/Compare. http://colemak.com/Compare.)
- zcid 15y agoI type Colemak 99% of the time, but the 1% I don't, it can be a really frustrating experience. It amazes me that 20 years of typing ability was forgotten almost entirely in a month.
- aerique 15y agoI used to use Dvorak at home and QWERTY at work (as to not annoy my co-workers) and switching between them was a non-issue.
- jcromartie 15y agoThere's a big exception to the "vim will be installed" rule: Windows.
- 2muchcoffeeman 15y agoAnd what windows installation comes with any dev tools by default? You are going to have to install a bunch of stuff anyway. Install Vim.
- CJefferson 15y agoI've tried hard to love vim, but as a programmer's editor, for C++, it's just awful. Now, many of the problems are because C++ is awful (hard to parse, for indenting / formatting), and C++ compilers are awful (20 page error messages). In particular, I tried half a dozen packages and none could tame C++ template error messages, while xcode, visual studio and cde in eclipse all mastered this years ago. A shame.
- Diabeetus 15y agoCoincidentally, all the points equally apply to Emacs. Well, except the last one, I guess.
- wpinbacker 15y agoExactly. Emacs doesn't need an elaborate case for its defense; non-modal is more natural/easier-to-learn/BETTER (control-this, control-that) than modal. Not merely my 2 cents -- it's the TRUTH!
- gcr 15y agoLong time vim user here, and I'm considering learning emacs. How do you know it's the truth? And, how did you get started?
- ams6110 15y agoI've been using emacs since the 1980s, got started in school because it's the editor one of my early comp. sci. courses used. Tried vi a few times, and I still use it occasionally on systems where emacs is not available (this is one real advantage of vi[m] it tends to be on even the most bare-bones systems), but the separate input and command modes have never really felt natural to me.
- reso 15y agoWhen they started pushing Unix on us in 2nd year CS, I hated VIM with a burning passion. After a little while of using it though, I can say my typing efficiency is far, far, higher than it was before, and I can "flow" better since I don't have to interrupt my stream-of-consciousness with a mouse movement. I wouldn't use anything else nowadays.
- phatbyte 15y agoI love vim, I use it daily, but always for quick text editing. For real coding I need an IDE (netbeans). I never understood how people can code without debugging, profiling, code exploring. I'll probably get voted down, but, what Vim saves me, I wasted it on debugging. So I don't see any advantage using it as my primary editor.
- jrockway 15y agoMost people that use vim also don't use graphical debuggers. I use the "print" statement.
- dekz 15y agoThe only downside to print statements is forgetting to remove them and having some obnoxious message committed.
- jrockway 15y agoThis is rarely a problem when using tools like darcs, magit, or git-add --patch.
- angusgr 15y agoA useful trick we've had at previous workplaces which solves this (and related accidental-debug-code-checkin) problems is to put a precommit hook that denies a checkin with a certain string in the text (we used "DNCI" for Do Not Check In) So you get in the habit of annotating test tweaks & debug prints with: printf("DNCI x is %d\n", x); I use gdb as well, but sometimes dumping data directly is all you really need.
- eropple 15y agoSpewing print statements all over a piece of code is as bad as any other shotgun debugging technique. The reason breakpoints and watches were invented were to reduce reliance on bad ways of doing things.
- 15y ago
- IvarTJ 15y agoI chose it because I am under the impression that it is more ergonomic than Emacs and mainstream text editing environments. I learnt the basics of Emacs before I learnt vi/m.
- doorhammer 15y agoI've been tooling around with emacs, having plopped down vimpulse and viper on it. I get slime for clojure, the power of elisp for modifications and so on, as well as my preferred editing style, which is modal. It's not for everyone, but it works for me. It helps that my life isn't terribly busy, and I enjoy taking the time to make everything work together. Of course, caps rebinding is a must for either. It's been fun, either way. Time will tell if it ends up being practical.
- gnosis 15y agoWhen I started learning Lisp, I tried using Emacs with viper and vimpulse. Although it did make using Emacs less painful, it still required way too much knowledge of Emacs to use effectively and configure than I had time to dedicate to learning it. Emacs+SLIME+vimpulse+viper might be good enough for someone who already knows Emacs or who hasn't invested a lot of time in learning vim. But for someone fluent in vim, I just don't think huge time investment in learning Emacs well is worth it.
- doorhammer 15y agoThat's completely understandable. I really don't have a huge reason to be doing things this way. I've just been going through The Joy of Clojure and decided to give emacs a spin, and I wanted some similar editing idioms while messing with it. I've basically been translating the shortcuts and techniques I use in vim into some ugly elisp, bit by bit, assuming they don't work as expected with vimpule/viper. I wouldn't say it's an amazing solution, but mucking through the emacs docs to get things working has been a quick way to get a basic proficiency in how emacs works, and how elisp can be used. Ultimately I still end up in vim for most of my editing, and I keep tacking things onto emacs as I go, but mostly when I'm just writing some clojure. I wouldn't say it's efficient at all; it's just interesting enough to kill time with because my life isn't very busy and it seems 'nifty'.
- TheEzEzz 15y agoJust last week I was about to start learning Vim, but after perusing the shortcut list I decided I could do better, so I rolled my own. Basically it's just a multi-modal keystroke catcher/dispatcher running transparently in the background. The upshot is that most of the commands work transparently in my IDE, in notepad, and even this little textbox I'm typing in right now! Unfortunately, the original point was to increase my productivity, which I've failed at horribly... because I can't stop playing around with the code!
- sant0sk1 15y agoOpen source it and we can all waste time playing with the code!
- TheEzEzz 15y agoDefinitely. I'm gonna dogfood it a few more weeks and then throw it up on github.
- gnosis 15y ago"Basically it's just a multi-modal keystroke catcher/dispatcher running transparently in the background. The upshot is that most of the commands work transparently in my IDE, in notepad, and even this little textbox I'm typing in right now!" This sounds very interesting. I've long wanted vim integration with Opera, so I'm not stuck with its relatively primitive editing features when I'm filling out a text input box. Unfortunately, vim does not integrate with other apps very easily.[1] So something along the lines you're working on would be very welcome, even if it is primitive compared to vim. One thing I hope it can do is have an easy way to activate and deactivate it, so it doesn't interfere with editing in vim itself. [1] http://www.freehackers.org/VimIntegration http://www.freehackers.org/VimIntegration
- chernevik 15y agoReason 8: Vim keystrokes can be incorporated into ex scripts, either alone or in "here" scripts. These commands are already useful, they can do stuff like replace strings in lines that are N lines above or below lines holding another string, and they can be leveraged further via scripting. For example, a search and replace across files under the working directory: tgt_string=$1 repl_string=$2 for file_name in $(grep -rl "$tgt_str") do ex - $file_name << END_HERE_SCRIPT %s/$tgt_string/$repl_string/g wq END_HERE_SCRIPT done Yes, the indentation of the "here" script is ugly, white space before line texts can bork execution. Yes, sed or awk can do very similar things, maybe better. My point is, it's nice to get some of these capabilities just by knowing your editor. (Ed: Sorry about the formatting, if I don't double-space the script it turns into one large text clump.)
- vacri 15y agoIt's not surprising to see that the logo isn't amongst the list :) I use a mix of Elvis and Vim as I'm training up on vi-likes, and I'm not sure which I prefer yet. Vim has more-intuitive-to-me stuff like character-by character deleting (ie characters are removed when you delete, not when you leave Insert mode), but elvis has things like pressing = twice to reflow paragraphs. Vim may win in the end as Elvis is hard to google for...
- koenigdavidmj 15y agoVim can reflow too, but I will admit that 'gwap' is a bit unintuitive...
- vacri 15y agocool, thanks for that!