The Top 7 Reasons To Give The Vim Text Editor A Chance

vim editor logo 300x300   The Top 7 Reasons To Give The Vim Text Editor A ChanceIf you do any sort of development work on your computer, you’re going to need a text editor every now and then (or all the time). And by “development” I don’t just mean programming; it can be Web development too, or even maintaining and tweaking an existing website.

For years, I’ve tried one text editor after another. You name it, I tried it – jEdit, Notepad++, SciTE, PSPad, Komodo Edit… I’m not just name-dropping here. I used each and every one of these editors for over two months as my primary day-to-day editor. I also had a brief stint with UltraEdit, a venerable (but non-free) editor. Somehow, I couldn’t find an editor that just worked right, and was customizable enough to fit my needs.

That all changed a couple of months ago, when I bit the bullet and started using Vim text editor full-time. ¬†Here’s 6 reasons why you should consider giving it a go.

Reason 1: Vim Is Old

image 30   The Top 7 Reasons To Give The Vim Text Editor A Chance

In software, we often cultivate the mindset that says “newer is better”. We’re always after the latest browser, the latest OS, the latest game. But there’s a lot to be said for ancient pieces of software that are still actively used by lots of people.

Did you know MS Office was first released in 1990? That’s 21 years ago, and look how far it has come. That’s about the time Vim was first released, too (1991). Only Vim is based on a much older editor, Vi, that got its start in 1976.

That alone should make you wonder; what makes such an ancient piece of software so compelling, that thousands of new users discover it year by year?

Reason 2: Vim Is Free & Has A Vibrant Community

Vim is actually defined as “charityware”, and is free to use and open-source. It does ask you to donate for orphans in Uganda, but there are no nags.

If you go to the Vim webpage, you will find lots of recent news items. I counted nine script updates in one day, for example. The site is constantly updated, and Vim’s main developer, Bram Moolenaar, personally posted an update on April 28.

Reason 3: Vim Is Very Customizable & Extensible

image 34   The Top 7 Reasons To Give The Vim Text Editor A Chance

Those scripts I just mentioned? They’re the key to much of Vim’s power. There are scripts for just about anything. In the screenshot above you can see FuzzyFinder, one of my all-time favorites. It’s a script that lets you type partial names of files, commands, help entries, etc. and searches for them incrementally, on-the-fly. You don’t have to type from the beginning of the name, and it’s got a lot of options – and that’s just one script!

Other notable scripts include NERD Tree that implements a file-system “tree”, SuperTab Continued for powerful tab-completion, and snipMate for replicating TextMate’s snippet functionality. There are lots, lots more.

Reason 4: Vim Works Over Telnet & SSH Connections

vimterminal   The Top 7 Reasons To Give The Vim Text Editor A Chance

I sometimes need to manually edit webpages that reside on remote servers. I used to use WinSCP to simulate local editing, but it broke every now and then. A few of the editors mentioned above also have built-in FTP clients, but navigating complex folder trees was always cumbersome and time-consuming.

With Vim Text Editor, I can just open an SSH connection to my Web server and run a remote instance of Vim right on the server. Vim is designed to work with slow terminals, so it actually feels fast. As you can see in the screenshot above, colors work just fine over SSH. Being able to work directly on the server has made a huge difference in my Web development work. Not only is it faster, but I can now search through files right on the server, and use Vim to jump between the results quickly and find exactly what I need to modify with pinpoint precision. Simply awesome.

Reason 5: Vim’s Configuration Is Portable

image 31   The Top 7 Reasons To Give The Vim Text Editor A Chance

As mentioned above, Vim is very customizable. That means I had to work quite a bit until I got it “just so” on my Windows system. Having to do all that on my remote server would have been a bit of a drag. Luckily, I simply needed to copy a few directories and one all-important “master configuration” file, called .vimrc.

This basically copied my entire configuration from my Windows computer to the remote Linux server. I then just edited my configuration file and modified a couple of things for the server, and I was basically done. Of course I couldn’t keep myself from tweaking things further, but that’s just me.

Reason 6: Vim Is Thoroughly Documented

Note that nowhere on this list does it say “Vim is intuitive”. That’s because it’s not, really. There is a learning curve when you first start using Vim, and it does require a bit of a commitment. But there are quite a few things that can help. Here are just three examples:

image 32   The Top 7 Reasons To Give The Vim Text Editor A Chance

  • PeepCode’s Smash into Vim screencasts (shown in the screenshot above): These are actually not free; they cost $12 each (there are two), but are a very worthwhile investment. When I decided I wanted to give Vim a serious spin, I bought the first one and watched it. It was enough to get me started with confidence. It wasn’t boring, either.
  • Vim’s own *:help* command leads into a treasure trove of carefully-written documentation. Every script has its own documentations; default key bindings are carefully documented, all of the commands are explained, etc.
  • Vim also has a wiki with oodles of tips, tricks and helpful code snippets for you to copy and try.

Reason 7: It’s Way Better Than Emacs

OK, so maybe I’m not entirely serious about this last one. As you may have noticed in the introduction, I’ve never actually given Emacs much of a spin (not for two months, at least). According to the scientifically-minded $EDITORs Sucks-Rules-O-Meter, Vim seems to be in the lead in the Editor War, at least for now. But I’m willing to be convinced otherwise. You’re welcome to plead Emacs’ case in the comments.

Speaking of comments: if there are any Vim users in the audience who’d like to share tips or ask questions, I am all ears. I know I’ve barely scratched the surface on Vim in this post, so if you’d like to see more detailed posts about Vim, do share your ideas and wishes.

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

35 Comments -

emacslover

Emacs rulez. VIM is practically the only editor out there where you have to constantly switch between modes. When I use a text editor I like it to actually display and change text when I press keys on my keyboard, not beep annoyingly.

jeffjose

No disrespect to Emacs, but the only reason why I would never try/use Emacs is because of that. I love my pinky finger way too much to do chorded key-bindings. Ctrl-this, Ctrl-that.

Mickey

¬†This one can be laid at the door of keyboard manufacturers. I bet your keyboard has the CAPS LOCK key, which you almost never use, in prime position on the left. If that was the CTRL key, the emacs CTRL chords would be so easy. That’s where the CTRL key is meant to be, and that’s where it was when emacs was born. I remapped it to CTRL and suddenly emacs CTRL chords are so much easier, so much more elegant. It makes an enormous difference.

Tina

Great suggestion, Mickey!

mike

¬†Vim is my #1. ¬†Tip: ¬†if it beeps when you press keys, you’re doing it wrong.
 

Anonymous

Actually this is a BIG vim feature that allows you to separate command editing mode vs editing.

Don’t think about easy stuff like delete a character or going left… If we consider only these features then you’re right, having mode-switching is useless.

But if you want to do things like “add an empty line after each line having a given pattern” *interactively* like if you were in a REPL then you will soon understand that having a command mode is a blessing and a very very very very powerful thing to have.¬†

ArtemZ

better than emacs? no way

Eriknowakowski

Where is the poll about what we use?
 

Maredsous10

¬†Derek Wyatt’s Tutorials¬†
http://www.derekwyatt.org/vim/vim-tutorial-videos/

Drew Neill’s Vimcasts
http://www.vimcasts.com

BRMatt

Vim casts is one of the best vim sites out there! The guy goes through tutorials step by step and references all the keys he’s pressing – a godsend when it comes to an editor like vim.

Matt Wilkie

 that should be http://www.vimcasts.org (or drop the www, and do just vimcasts.com, which redirects to .org anyway)

Thameera

 Vim all the way. The reason why some people hate it is that they stop learning after a few keystrokes. As mentioned in the article, you have to commit a bit at first into learning it and once mastered Vim becomes indispensable.

stan r.

Beginner Tip: The Caps Lock key is your enemy!

Jayess Aymes

 xmodmap to swap and is your friend :)

Vim on Kindle

¬†There’s a good Kindle book on Vim: http://www.amazon.com/Vim-Vi-Tips-Essential-ebook/dp/B004JF4NOQ/

Vim on Kindle

There’s a good Kindle book on Vim: http://www.amazon.com/Vim-Vi-T

p4bl0

To be more serious about the vim/emacs thing, I think five of the six (not counting #7) real reasons you gave also apply to emacs. Emacs is also old, it’s also free, it also as a vibrant community, it also works over telnet and ssh, it’s configuration is also portable and it is also thoroughly documented (with it’s own help (hey, type C-h C-h it’s the help’s help ;-p) and wiki and websites and blogs… just like vim!).

The one point where they differ is on extensibility and customizability and on this point it’s only the truth to say that emacs wins hands down. Emacs has a real programming language to build extensions, emacs lisp is very powerful.

The real choice between emacs and vim is a matter of taste. Because they both embrace different philosophies and thus different design choices: yes, it’s a design choice in vim to not be as much customizable and extensible as emacs, and some people I know and respect prefer vim over emacs for that very reason.

I’m an emacs user myself and I love my editor, I occasionaly have fun trolling on this subject but really I know vim is *also* a good editor.

Anonymous

What application is that under the fourth reason?

Garry Blackmore

Putty, but it’s a version called Puttytray with cosmetic improvements and such. You can find it here:¬†http://haanstra.eu/putty/http://haanstra.eu/putty/

Anonymous

That’s an SSH session with PuTTY and the Solarized color scheme:¬†http://ethanschoonover.com/solarizedhttp://ethanschoonover.com/solarized

Raimon Grau

Both vim and emacs have more features than you probably can remember.  I started with vim, then went to emacs, and now using emacs with vimpulse plugin, that gives you the basic modal usage, and the extensibility of elisp.

Best of both worlds? Worst of both worlds?
You decide :)

Chris Gonnerman

I tried to like emacs, I really did… but vim is just so darned efficient.¬† It’s not how you type in it, it’s how you do “ex” mode commands.¬† I REMEMBER the CTRL being where CAPS LOCK is… and I didn’t like emacs then.

Mih

+1 for emacs.

I tried using Vim when I had still not known Emacs, but found two things annoying:
– having to move my hand to hit ‘Esc’ to change mode
– need to constantly focus on the status line to see which mode I’m in after performing some text operation

Now for most people it might be second nature to do the above, but somehow my brain could not cope well with such minor tasks. 

With emacs it has been easy sailing and not to mention the commands seem to me more intuitive. + {b,f,p,n} seemed easier to remember without practice that + h,j,k,l.

David

Vim has been my programming editor of choice for years now but I *still* feel as though there is a world of vim magic that I’ve yet to really master.¬† One good example of this is the “g” command, which is powerful enough to reverse a file as simply as :g/^/m0¬†

Garry Blackmore

Putty, but it’s a version called Puttytray with cosmetic improvements and such. You can find it here:√ā¬†http://haanstra.eu/putty/http:…

B.

And yet you’re using it on windows. Why should you be taken seriously ?

mike

Because it works on Windows?  I learned vi while in university on Unix boxes, and continue to use it now at work & home on Windows machines.  Yay for cross platform software! 

Justin

¬†I use Vi/Vim quite a bit for quick editing, and managing my VPS’s. As I’ve been getting more and more used to it I keep inching towards using it over my other editor(s). You convinced me to try out the ‘Smash into Vim’.Thanks for the post :)

ezuk

That’s an SSH session with PuTTY and the Solarized color scheme:√ā¬†http://ethanschoonover.com/sol

emaniacs

 i like VIM and Emacs,,
but i usually use vim just for litle editing like viewer or customized some of code..
when i create a big project absolutelly i use Emacs.. 

Anonymous

¬†Vim is great on it’s own, but it’s true power comes from it’s highly extendable and configurable nature. Many users have benefitted from using a preconfigured (and customizable) vim distribution Spf13 Vim. It’s primarily focused on development and ease of use while sticking to established vim standards. It’s completely cross platform, so you can use the same configuration on your desktop and server.¬†

Anonymous

That’s pretty interesting. How does it compare to Cream?¬†

Anonymous

Cream’s approach is completely different. Cream attempts to make vim more like other desktop software with a set of key reamapings … like Ctrl+c for copy and a bunch of menus. I’d argue at that point, why use vim at all?¬†If you learn cream, you’ll be completely unable to use stock vim, with Spf13-vim you’ll feel right at home.

Spf13-vim’s approach is to stick to vim’s approach to things. ¬†Spf13-vim provides a richer set of features without changing the way vim works. For instance it provides snippet functionality and a rich set of code snippets for a ton of languages.. but this doesn’t alter the way vim works. It provides syntax checking for php, python, c and ruby.¬†

If you like vim and the way vim works, but feel like features like autocomplete, snippets, git support and more would make vim even better, than checkout spf13-vim. 

If you want an awkward mashup of vim and notepad, choose cream.

Anonymous

Nice take indeed. I looked at Spf13’s page and I see what you’re saying.

Vagif Verdi

vim is used mostly by unix/linux admins to edit bash/python/perl scripts and various configuration files.

But if you are a programmer, you are seriously missing for not trying emacs. For many non mainstream languages like lisps (CL, clojure, scheme), haskell etc, emacs is the most powerful IDE available today.