What are the benefits of learning Vim? [closed]
Asked Answered
A

34

465

As a programmer I spend a lot of hours at the keyboard and I've been doing it for the last 12 years, more or less. If there's something I've never gotten used to during all this time, it's these annoying and almost unconscious constant micro-interruptions I experience while coding, due to some of the most common code editing tasks. Things like a simple copy & paste from a different line (or even the same line), or moving 1 or 2 lines up or down from the current position require too much typing or involve the use of the arrow keys ...and it gets worse when I want to move further - I end up using the mouse. Now imagine this same scenario but on a laptop.

I've always considered learning VIM but the amount of time needed to master it has always made me want to step back.

I'd like to hear from people who have learnt it and if it ends up being one of those things you cannot live without.

At work, I use VS2008, C# and R#, which together make editing code a lot faster and easier than ever, but even so I think I could enjoy not having to use the mouse at all.

And not even the arrow keys.

Albertson answered 27/2, 2009 at 23:27 Comment(17)
Not having to switch between keyboard and mouse is definitely nice. On the Mac, I used emacs navigation keys (ctrl-A for example) even in a GUI editor like BBEdit or Xcode, just to avoid the extra movement with the mouse.Cassaba
It is totally worth the effort. Learn vim ;)Josuejosy
You can learn basic vim (forget about vi) in couple of minutes, just type vimtutor in terminal and you'll be set with the basic - what you learn in the next 20 years is all up to you. I'm just curious how do the VS2008, C# & R# help you with the issues related to having to waste your life moving between keyboard and arrow keys/mouse?Jallier
One of the best investments I ever made.Missal
I created this game to help my seven year old nephew learn to move around quickly in Vim: kikuchiyo.org Beta version allows you to attack enemies with lightsaber, 'i' for left attack, and 'a', for right :P I learned Vim for the same reasons you did. I found moving around the most difficult part to get used to. Hope the game helps speed you up, if you need help :) Good luck! :)Thud
omg... well... I got 1 gem before the timer ran out. I just cannot get my brain to function the keys like that. It's like learning chop-sticks! :)Complicity
I suffered from shoulder aches in the right arm from overexertion during programming. (Moving between letters, arrow keys and the mouse.) That was what really MADE me learn it. After some weeks of cursing I was pain-free and every eclipse I set up gets a VRAPPER installation as one of the first actions on it. No way I can live without vim-bindings and editing styles ever again.Subtropical
@Jallier R# helps you develop without using your mouse. Arrow keys are used by shortcuts by default, but all of that can be changed as well.Elidaelidad
Nethack on a laptop will teach you how to move in vim.Tso
never, no. NO use dwelling on the past. MOVE FOREWARD!Justino
I think you should learn vim but don't use it unless you have no other reasonable alternative (for example when editing code on a remote server via SSH). I find that copying, pasting and moving code around is far more tedious in vim than GUI-based editors and IDEs.Boley
Yes it is. When you become master of it, then you gonna enjoy it.Hardener
Don't learn it! If you became good at it, you would get frustration. Because you feel everything in this world is too slow.Felspar
Can answer any more, but @topfunky's PeepCode tutorial (now owned by PluralSight) is a great way to learn it. I ran through a lot of tutorials and they all made vim seem like a waste of time, but the PeepCode version finally clicked for me.Hideaway
Questions like these should not be closed, but rather reworded such as, what are the benefits of learning Vim. Clearly with 300+ up votes it's useful to someone!Pros
@Thud Your web might have been downed.Bijou
Thanks @DDK, I moved it to kikuchiyos-vim-game.herokuapp.com - hoping to work on it, just for fun, some day.Thud
V
249

I've been using vi and vim also for some 20 years, and I'm still learning new things.

David Rayner's Best of Vim Tips site is an excellent list, though it's probably more useful once you have some familiarity with vim.

I also want to mention the ViEmu site which has some great info on vi/vim tips and especially the article Why, oh WHY, do those nutheads use vi? (archived version)

Vania answered 27/2, 2009 at 23:27 Comment(12)
Yes, I'm always learning new things in it too. Still my favorite editor too.Cassaba
I wonder if that is a good thing or a bad thing. If you constantly learn new things, the learning curve is REALLY steep, features are REALLY hidden and there is no sense of mastery. Anyway, if you wanted RISC, you went with vi instead of vim, right?Digitalize
@Paperflyer: I had the same thoughts. If you still haven't mastered it after 20 years, that's a headache I'm not sure I wantAutocade
How so? It means that while it has so much features you can keep learning, but you don't have to learn them all to be more productive.Timoteo
"Why, oh WHY, do those nutheads use vi?." - Good link, especially for the questionTazza
Personal option: Instead of learning new things "how to edit text" - better just knowing basics things DO real work - with some ide. There are so many things to learn and where one pay his attention. I do not think that one put changes so frequently in the code.. usually you are in the thinking time 80% of your working time and just sometimes do put changes to your code. Navigation is important - something that real IDEA do provide. I do not think that a Mouse is an evil in this scenario. Better to invest some time for learning how to make better code than knowing 100000 ways to edit text.Thereon
Absolutely F*** yes. But the real power of Vim comes when you learn how to script it using VimL (Vim's scripting language) to make it even more powerful than it already is by default.Faunia
Downvote for @ses's answer. Vim is my IDE.Faunia
it helps everyone eventually and should possibly be considered for standardization from schooling. little kids understand using 'j' for down and 'k' for up in sites like tumblr.Yacketyyak
if you have been using for 20 years and still learning it doesn't it SHOW that it's not the all glorious tool as some make it to be.Pell
Sheesh. You trolled me. Look, if you mastered a text-editor, and then they added a new feature that was awesome++ at some task, you'd use the new feature, right? In VIm (& Emacs, etc), you discover new features as you look to do new things, year after year, or bump into something yet more efficient than the already more efficient way you were doing things. The pushback here is like saying if you're learning new things in your programming language of choice after using it for years (or from rereading a favorite book), that lang (or book) is no good. Madness. /sighAnorexia
@Autocade it takes more than a life to master, because VIM lets you do ANYTHING you like. If your satisfied with less, thats up to youWingo
R
183

Could I live without it? Easily.

Is it useful? Yes.

Reasons for Learning

  • vi is guaranteed to exist on all Unix systems and exists on most Linux ones as well. That kind of broad coverage makes learning it worth it.

  • It's much quicker to use vi for a sudo edit:

    $ sudo vi

  • Also, GMail uses vi-ish commands for selecting & moving emails around!

You don't have to be a master.

Just learn

The basics:

  • How to switch from command mode to insert mode i
  • How to switch from insert mode to command mode Esc
  • How to navigate up a line in command mode k
  • How to navigate down a line in command mode j
  • How to navigate left a character in command mode h
  • How to navigate right a character l
  • How to save a file :wEnter (write)
  • How to exit without saving (in command mode) :q!Enter
  • How to Undo u
  • How to Redo Ctrl+r
  • You can combine writing and quitting (in command mode): :wqEnter

From there the rest will just make you faster.

Rossiter answered 27/2, 2009 at 23:27 Comment(11)
I've always used "vi is easy; you use the ell key to move the cursor right" as a humourous (I hope) way to introduce it. But I've been using it a long time and wouldn't be without. Can't claim 25+ years for another couple, yet, though, so no new answer from me.Kristinakristine
This is how I learnt it. Start with the minimum and build a little on it each day. Take the time to learn a slightly better way of achieveing a task. See the "7 habits of highly text editing" for inspiration.Cleora
Gmail, Google experimental search keyboard shortcuts, Slashdot keyboard shortcuts, man, and less all use vim-like bindings. It surprised me to discover I had accidentally learned these without knowing vim! Even Firefox uses / for incremental search (with very slightly different semantics from Ctrl+F).Pantelegraph
"It's much quicker to use vi for a sudo edit" I'm not sure about that, for example TextMate (OS X GUI application) allows you to edit system files normally (Cmd+o, or mate /etc/blah), then prompts you for your admin password when you save.. I imagine most IDE's do the same..Disembarrass
@Disembarrass sadly, I have seen nothing with that feature. Though it would be kind of nice. I did learn a trick with vi to do something similar by pushing its output through sudo tee... now where did I write that down...Joppa
[:][X][Enter] is the same as [:][W][Q][Enter]Rockweed
Since @Cleora above mentioned "progressively", I thought I'd mention this blog post: Learn Vim Progressively, which I, as a Vim newbie, find pretty helpful.Porcupine
Everyone else is commenting, so i will too!! I hated vim in the same way I hate(d) perl. It actually took a while of using other text editors, I kept needing 'features that didnt exist'. Every time I found there was a vim addon and if not I could easily write one myself. The best part was that once you are pretty familiar with vim, you've already become qualified to write your own addons since most of the addons consist of commands you would use in vim. for ones who dont like the keys, use 'behave mswin' with the normaleditor.vim, or cream, and it'll pretend to be a 'normal' editor for you :).Weiler
[Z][Z] is the same as [:][X][Enter]Sinkhole
I always think "yank" when using y to archive emails in gmail, even though that mnemonic makes no sense.Horrible
@VitaliiFedorenko No, :x will only save the file if it has been modified, whereas :wq will always save it.Sturrock
F
138

Running through vimtutor only took me 30 minutes, which was enough to get familiar with vim. It was worth every second of it.

Finished answered 27/2, 2009 at 23:27 Comment(7)
If you know of a better explanitory link, please change mine :)Finished
I hate the vimtutor, it doesn't really teach much. IMO it spends a lot of time teaching less useful stuff.Bresee
vimtutor is exactly that, a tutorial. I did it everyday for about 10 days. First time it took me about 30min, the next day 20, then 15. By the end of the week, I had most of its command imprinted in my mind. I think rather than trying to memorize, repetition is the best way to approach Vim. 15 min everyday for a week seems like a really small price.Gravure
I found vimtutor very helpful and any beginner who wants to learn vim should definitely try it out.Zloty
What about once we are done with VIMTUTOR ? What's the next step to learn more ?Bigod
@privatehuff: Read and apply Seven habits of effective text editing.Atonal
wow! this was like one of those hidden items in a game. It was right there in my system and I didn't know it existed. One of the most useful and quick tutorials of vim. Using vim for a while I still learned a couple of basic tricks I didn't know about. recommended to everyone. Also a little suggestion: if you are using vim on a laptop that has a touch pad and it supports gestures, disable it before using vim because if accidentally touched it can move the cursor to unexpected places sometimes wasting an entire good edit.Bonaire
Y
69

If you're a programmer who edits a lot of text, then it's important to learn an A Serious Text Editor. Which Serious Text Editor you learn is not terribly important and is largely dependent on the types of environments you expect to be editing in.

The reason is that these editors are highly optimized to perform the kinds of tasks that you will be doing a lot. For example, consider adding the same bit of text to the end of every line. This is trivial in A Serious Text Editor, but ridiculously cumbersome otherwise.

Usually vim's killer features are considered: A) that it's available on pretty much every Unix you'll ever encounter and B) your fingers very rarely have to leave the home row, which means you'll be able to edit text very, very quickly. It's also usually very fast and lightweight even when editing huge files.

There are plenty of alternatives, however. Emacs is the most common example, of course, and it's much more than just an advanced text editor if you really dig into it. I'm personally a very happy TextMate user now after years of using vim/gvim.

The trick to switching to any of these is to force yourself to use them the way they were intended. For example, in vim, if you're manually performing every step in a multi-step process or if you're using the arrow keys or the mouse then there's probably a better way to do it. Stop what you're doing and look it up.

If you do nothing else, learn the basic navigation controls for both vim and Emacs since they pop up all over the place. For example, you can use Emacs-style controls in any text input field in Mac OS, in most Unix shells, in Eclipse, etc. You can use vim-style controls in the less(1) command, on Slashdot, on gmail, etc.

Have fun!

Yellows answered 27/2, 2009 at 23:27 Comment(6)
This has a point in it that many people overlook. Almost any repetitive task has a shortcut. Developers love shortcuts. As rbright said, if you find yourself performing a step repeatedly, stop and see if someone's already documented a shortcut.Vinaya
A) was one of the biggest reasons for me to use VIM - I originally was an emacs guy, but not all systems had it & it was slow sometimes over the network or on busy servers. VIM is ubiquitous, small, and fast.Therefrom
My editor is constantly making bad jokes. I should switch.Ammonite
You had me at, "If you're a programmer who edits a lot of text, then it's important to learn an A Serious Text Editor." The worst part is that it seems impossible to learn two (much less more) inside and out, almost by definition. You're studying edge cases at some point, and the knowledge of how to accomplish Task X in one doesn't usually translate. And there's always things I do in "fringe" editors -- I still use JEdit for JTidy, Code2HTML, to search multiple files, eg. Your main is a roll of the dice, and there's no silver bullet, but yes, absolutely learn one and play with many. ;^)Anorexia
@Anorexia It's true, you can't really master two different editors at the same time: if you master one editor, you'll be using a lot of its commands unconsciously, and that means that you'll very likely try to use the same command when you are using the other editor. How many times have I cursed my browser for not allowing me to fix indentations with a simple <esc> >i{... It's really the same as with touch typing: you learn one keyboard layout, and you stick to it because you'll never be able to stop your fingers from typing the wrong keys on an different layout.Leaved
"B) your fingers very rarely have to leave the home row, which means you'll be able to edit text very, very quickly." - This is the first and only argument I've seen for vim that makes sense to me to prefer it over nano or emacs. Might not be enough to actually get me to sit down and really learn vim, but now I finally understand why someone might.Edition
L
36

It's definitely worth the effort.

There's one obvious reason that anyone who uses Vi(m) will tell you, and two others that people never seem to mention.

Here's the obvious one:

  1. vi is at once ubiquitous and incredibly powerful, and by learning it once, you gain the ability to exercise that power on pretty much any computer that has a keyboard.

And these are the lesser known reasons to learn Vim:

  1. It's not half as much effort as you think it's going to be. Run through the Vim tutor once (vimtutor at a shell, or in Windows run it from the Vim folder in the Start Menu), and you'll already be well on your way to competence, and it's all downhill from there. I was up to the level where I could use Vim at work without taking any noticeable productivity hit within less than a week's worth of lunchtimes.

  2. It's fun! Editing text is like a game to me now. I actively enjoy it--which is pretty ridiculous, when you think about it.

There's also two good reasons not to learn Vim:

  1. It's addictive, and you'll find yourself wishing you could use Vim commands in all your computing, and cursing whenever you can't. Fortunately, at least for some situations, there's ways to get around this.

  2. Again, it's addictive, and although you won't lose any productivity from actually using Vim, you will waste hours searching for good tips to make your Vim experience even better, and reading the Vim tag on Stack Overflow.

Lau answered 27/2, 2009 at 23:27 Comment(2)
Haha number 2 on reasons "not" to learn VIM is so right. All that time I save text editing, I spend reading about text editing. Ridiculous.Equitation
Yes, I wished I could play stardew valley using hjkl...Counterforce
D
32

It's definitely worth learning either vim or emacs. It's also worth learning to touch-type. In both cases the reasons are the same: your thinking is no longer interrupted by the mechanical process of getting your code onto the screen.

As to how to start, just dive in and start using vim for everything.

P.S. The emacs-vs-vi debate is endless. I've been using emacs for 26 years. If I started again today I'd learn vim because (a) it's gotten better and (b) there are many fewer modifier keys (Ctl-Alt-V, anyone) and vim users seem to get much less typing injury.

Dougall answered 27/2, 2009 at 23:27 Comment(4)
RSI is the one occupational hazard of developers. I never thought of it that way but I bet this is a really good point. It's a lot harder to type chords from a muscle standpoint. I knew there was a killer reason to use vi!Laureenlaurel
I've used both, I was "baptized" with vim, and learned emacs a few months ago. I prefer vim because tasks are broken up - you're either editing or inserting, not doing both. This distinction helps me think about what I'm doing, as well as makes the "normal" commands 1-2 key strokes, instead of 2-4. I just wish vim was Lisp based (and no, viper mode fails to support all my vim standard features. Yes I could roll my own, but then I'd be missing them any time I touched a new computer/system)Chuck
@WayneWerner I'm really outdated, but you could version controll all your elisp so you could sync them through computers.Nitrile
@YuriAlbuquerque, I've actually begun to think very seriously about creating an auto-environment setup script, keeping all my dotfiles on github or something.Chuck
W
17

You can get good functionality out of vim by learning the meanings of only 16 keys: ijkdbw9:q!%s/nNEsc. You can do the bare bones with just i:wqEsc.

The first two keys you need to know are: Esc takes you to command mode (the mode you start in), and i takes you to insert mode (normal typing).


To save you need to

  1. get out of typing mode (Esc)
  2. type a colon :
  3. type lowercase w then Enter

To save-and-quit you need to

  1. get out of typing mode (Esc)
  2. type a colon :
  3. type lowercase wq then Enter

To not-save-and-force-quit you need to

  1. get out of typing mode (Esc)
  2. type a colon :
  3. type lowercase q! then Enter

To learn more you can run vimtutor at the command line. It's a medium-length, well-structured lesson.

Beyond i and Esc: you can replicate or surpass some MS Word functionality with only jkwbd3:%s/nN.

  1. b takes you back a word (Ctrl+)
  2. w takes you forward a word (Ctrl+)
  3. 9w takes you forward nine words
  4. db deletes the preceding word (Ctrl+Backspace)
  5. d3b deletes three preceding words
  6. 9j moves down 9 lines
  7. / ornithopter Enter takes you to the next instance of the word "ornithopter", then n and N to the next and previous occurrence of "ornithopter" respectively.
  8. :%s/confounded/dangfangled/ Enter substitutes every "confounded" with "dangfangled" (like find and replace all in MS Word)

Any of those should be run in "command" mode (Esc), not insert mode (i).

Warrin answered 27/2, 2009 at 23:27 Comment(0)
V
16

I recently switched to VIM, and I think it's worth it. If you need to "just get something done", you can always stay in insert mode, where vim is (mostly) like a normal text editor.

I've noticed that things that didn't use to bother me, like reaching for the arrow keys, now feel wrong and too much effort. It's definitely decreased my hand motion and usage of the mouse, which is good for both ergonomics and productivity

Vinita answered 27/2, 2009 at 23:27 Comment(0)
W
12

It depends what you want to do with VIM. It doesn't make sense to learn it only because many people cannot live without it.

When I was working a lot on UNIX environments, I couldn't live without it. Even when VIM was not installed on a UNIX machine, I could at least use vi. You could always count on it -- even if the machine is not yours (that from the customer).

Now I program in C# and mostly work on windows environment. I have installed VIM on my PC ... and I don't need it.

Evaluate if you really need VIM and if it supports you in your "flow of work". Try it out. Play with it. If you think you need it, stick to it ... the learning curve is very steep.

Wellknown answered 27/2, 2009 at 23:27 Comment(1)
There is a visual studio extension for VIM users, see it at visualstudiogallery.msdn.microsoft.com/…Varga
V
10

I learnt vi because I had to.

My crazy teacher forced us to learn to program in C using a terminal to an AIX system.

It was a real pain, but worth it.

Today, I only use vi for quick edits or small programs.

When I have to go for a project, I rather use and IDE. In my case IntelliJ idea is very good at the task, because I can code for hours without grabbing the mouse.

I don't know how much shortcuts does VS2008 has, but if they are as discoverable as Eclipse, I think you are in trouble go for vi.

If you DON'T edit code outside the IDE and your IDE has good shortcuts, you better learn those, and then, go and learn vi anyway.

:)

Verrazano answered 27/2, 2009 at 23:27 Comment(2)
He asked for the benefits of VIM not an opinion.Makassar
@Makassar nope, he asked to hear about people how has learnt it (see original post here) which is exactly what I answered. This question has almost 8 years old and has been through several reviews during the years, my answer matched the original one. Take this into consideration while commenting.Verrazano
C
9

I've used vi/vim for 25+ years. If you already know some command-line editor, then maybe you don't need to learn vi/vim. But if you don't know any other command-line editors very well, it's worth learning it. It's pretty easy to be productive in vi/vim with little effort.

Cassaba answered 27/2, 2009 at 23:27 Comment(0)
E
6

I use VIM pretty much exclusively now.

I used to use Vim for editing and VS Editor for debugging. This probably seems a bit crazy, but I found the Vi paradigm (macros, home key based editing etc) such a boost to my productivity, that editing in VS was paintful.

Thanks to Viemu, I don't even have to do the switching any more. It is not the perfect solution yet (code completion is sometimes not as elegant as in native vim and the macro recording isn't perfect), but it is much better than switching back and forth constantly.

The learning curve for Vim is probably exaggerated. I think once you get into it, it is pretty intuitive.

Extraordinary answered 27/2, 2009 at 23:27 Comment(0)
R
5

My job forced me to pick up vim and it has quickly become second nature. Now my complaints are about IDE's that do not have vim emulation or plugins. I do notice that the esc key has become my enemy outside of vim.

I did find several emulators for vi within Visual Studio:

http://code.google.com/p/vim-visual-studio/

Richmound answered 27/2, 2009 at 23:27 Comment(0)
L
4

I learned Vim. It wasn't too much effort. Now I absolutely love ci" ci( cw V:s/from/to/g

Longtin answered 27/2, 2009 at 23:27 Comment(0)
R
4

I am maintaining a very big linux project on the remote computer. There is no choise to use Eclipse or similar GTK based IDE. I've been working there for 3 years. And I set my vim just for this project. And still tweaking.

Now I can do any thing from the Vim: source control, sql, debug, compile, browsing - really fast browsing over 1Gb source code.

Visual Studio or Eclipse couldn't handle all of this. And If I had a choice I would'n change Vim to other editor or IDE.

Rabe answered 27/2, 2009 at 23:27 Comment(0)
U
4

Two advantages of vi/vim:

  • it is very light-weight

  • it is installed on almost every *NIX system

Undersize answered 27/2, 2009 at 23:27 Comment(3)
why did you put * instead of U?Caryloncaryn
@kami: a tad late, but here you go: en.wikipedia.org/wiki/Unix-likeViera
Is Vim really "very light-weight" compared to most other text editors?Cleora
S
4

Firstly good vi(m) knowledge will save you the time you have to hustle to do emergency editing of config files on a server under seige. It can hold up on a laggy ssh connection.

Admin stuff aside vim's input method will be your best defence against carpal tunnel if you use it effectively with an ergonomic keyboard.

The best way to see the point of vim is to start a casual project at home, unplug your mouse and tape over your arrow keys.

And read the help

Sulfide answered 27/2, 2009 at 23:27 Comment(3)
I also find the Vi input model great to defend yourself from the carpal tunnel syndrome...Kitchens
arrow keys? try in your .vimrc: map <up> <nop> map <down> <nop> map <left> <nop> map <right> <nop> imap <up> <nop> imap <down> <nop> imap <left> <nop> imap <right> <nop>Subtropical
I'd just point out that there is nano which is so much easier to use than vim, and is almost equally widespread.Wheelhorse
S
3

Yes, definately take the time to learn at least a bit of 'vi' and 'vim'. It travels very well.

You'll never be stuck when you are faced with a customer Unix/Linux/Mac system that you don't have install capabilities for. Even on Windows (if you do have install capabilities) 'Vim' is free and easy to install. (As opposed to investing your learning curve purely in something like UltraEdit, which although an excellent editor might not be available for you all the time...).

Learning vi can set you up for learning other tools like 'sed', and regex in general: stuff that is generally transferable.

Plus if you want to be a proper geek, you just simply need to know 'vi/m' or you'll look like a faker ;-)

Superannuated answered 27/2, 2009 at 23:27 Comment(0)
W
3

I'm in the same situation as you, and as a beginner to Vim I originally found it a little daunting - the learning curve seems steep. From what I've learned in just a few hours I'm already feeling like I won't be able to live without it.

Here are a few links that I've found for useful Vim screencasts to show you what it's capable of.

A good bit of advice that Bram Moolenaar (benevolent dictator of Vim) gave in that last link is that it would be inefficient to try to learn every single command and function, just figure out what it is that you're doing that isn't working very well, look for a way to make it more efficient and then make it a habit.

Wace answered 27/2, 2009 at 23:27 Comment(0)
M
3

I'd say vim is definitely worth learning. I picked it up last summer, and it is now my editor of choice for just about everything (java is a stretch, but doable when I don't need extensive analysis support). As everyone has already affirmed, it is a wonderfully efficient tool.

For what it's worth, I only learned a fairly small subset of vim's features (which took a day or two) from a graphical tutorial, and a few odds and ends from here (long read), and the search and replace functionality, and I was hooked. I've learned things since then, but at my leisure. I'd say the learning curve flattens out at this point, but then, I was using it pretty heavily and was surrounded by others who were, too.

Minneapolis answered 27/2, 2009 at 23:27 Comment(0)
F
2

I too put off learning vi or vim for many years. Matter of fact, I use to make fun of the "vi guys" who always seemed to be doing finger aerobics. Then, as I moved away from Windows and over to Linux as my primary OS, I had to become more familiar with vim. It was a learning curve and it still is. After 9 years of using vim on a daily basis I still find myself learning new and faster ways of doing things. What I use to think of as "finger aerobics" actually turned out to be an extremely efficient way of being productive. I can now do a whole lot more code development in a whole lot less time and effort than I ever did prior to vim. And as I'm sure you know vim runs on about every platform out there so you always have it when you need it. Also, if you like GUI's they have GUI versions for most platforms. Personally, just like the mouse, I don't want to see a menu bar, scroll bars, etc. cluttering up my editing window(s).

If you decide to give vim a whirl I would highly recommend the O'Reilly "vi Editor Pocket Reference" book. It's cheap and it's great if you're just learning vi (vim). The full blown vim books are also good but the pocket reference gives you all the basics to be productive quickly.

Fastigium answered 27/2, 2009 at 23:27 Comment(0)
P
2

No. Learning vim is worth more than the effort.

Permute answered 27/2, 2009 at 23:27 Comment(0)
B
2

Vim is definitely worth learning to partly summarize what has been stated previously here are the main reasons:

  • Vi/Vim can be found on most unix systems.
  • Vim allows you to easily code without taking your hands off the keyboard.
  • If you plan you configure anything in a unix based system likelihood is you going to be editing a fair few config files, therefore you'll want to learn a terminal based editor, of which vim is one of the best (sorry emacs).
  • Vim compiles/has precompiled binaries for almost every OS out there. No need to post "I need a textmate alternative for [insert OS]", you'll have Vim instead!
  • There are a lot of good plugins out there to add alot of functionality, such as in-editor cvs diffs, although some of these require a fair amount of tinkering.

Also on a side note if you find you like the Vim key bindings, there are also IDEs which include vim bindings in their editors for simple commands, for example Komodo Edit.

For help on learning Vim, try typing 'vimtutor' into your terminal and follow the instructions. There is also a book which is particularly good Hacking Vim

Backspin answered 27/2, 2009 at 23:27 Comment(0)
B
2

Learning something new is always worth the effort, IMHO. I suggest you print out a cheat sheet and force yourself to use it day-in and day-out.

Basil answered 27/2, 2009 at 23:27 Comment(1)
There is a story in Chinese saying somebody learn from a teacher how to butcher dragons. Once he graduated from studying, he can never find any real dragons to butcher. I am not saying vi, but it is the moral of this story that sometimes learning something is just waste of time.Ransome
D
2

To learn vi(m) fast one must first understand the whole design. Vim has a great set of cursor-movement commands, check a few (X is a character, # a digit):

j k enter arrows 0 $ w W b B ctrolD crtolU ctrolE ctrolY H M L fX FX tX TX , ; % gg G n N mX 'X ''

and many more it would be boring to enumerate. Many of these support a count before the command, like 4j to move 4 lines up.

Now, back to the design, you type a command like d for delete followed by a cursor movement and the command applies to the piece of text from the cursor position till the movement end. For example H moves to the top of the screen, dH deletes to the top of the screen and cH changes (replaces) to the top of the screen.

This design is quite powerful. It also reduces, or organizes, what you need to learn. Definitively the first step is to learn a few cursor movement commands. Say,8 or 10 at first. Then you are almost done.

Dominicdominica answered 27/2, 2009 at 23:27 Comment(0)
P
2

You might want to learn vim because you might not be happy with the editors you're already using.

You might want to learn vim because many people say it is cool. Just look how many answers you've got to this question.

I will provide an additional reason for learning vim. It has a reputation for the quality and the completeness of its docs. So you will find most answers to your questions in its help system as soon as you will manage to stick the proper keywords in your help queries.

Phillis answered 27/2, 2009 at 23:27 Comment(0)
B
2

I was happy at my textpad and ecplise world until i had to start working with servers running under linux. Remote scripting and set up of config files was needed!

It was hard at the begining but now i can easily set up and tune up my servers.

Broadspectrum answered 27/2, 2009 at 23:27 Comment(0)
A
2

Don't be scared off by the number of commands, I've not met anyone who used more than a couple dozen at most. I find it indispensable, because when I'm thinking about code I'm thinking about text, moving to thinking about mice just messes me up. The big tricks, I think, are to learn it a little at a time, and don't be hesitant to play around - the undo features is great for exploring its behaviors.

Also, if you get deeply into it, vim is scriptable. The possibilities are literally endless.

(Yes, all of this applies to emacs too...)

Accumulation answered 27/2, 2009 at 23:27 Comment(0)
G
2

I learned to like vi after watching someone who was very skilled with it navigate around to make edits at an insanely fast clip. You really can code quickly with it. Another reason I like it is that sometimes I find that mousing around in an IDE really hurts my hands after a while and vi provides a nice change. As others have mentioned it's also almost always available on unix systems and works well even over lousy connections.

One thing that I haven't seen mentioned is that knowing vi has the added benefit of "geek cred" in some circles. I can think of at least a few people who chuckle when they see a new programmer fire up nedit to make some changes to a file.

Grinnell answered 27/2, 2009 at 23:27 Comment(0)
T
2

The amazing ubiquity of Vim, and the even more amazing ubiquity of Vi-clones in general, on Unix systems alone is enough to make it worth learning.

Besides that, the whole Vi-style thinking is something that I really think has made me a bit more productive. For a person not used to modes such as the command mode and insert mode, it seems a bit excessive to have to enter a mode just to insert text. But, when one has been using Vim for a few months, and has learned quite a few tips and tricks, Vim seems to be an asset that seems to be worth it.

Of course, the Emacs crowd says the same thing regarding Emacs-style thinking, but I gave up on learning Emacs because Vim was simpler and did the job for me.

Trifurcate answered 27/2, 2009 at 23:27 Comment(0)
N
2

I think it's definitely worth the time and effort to learn vim. To me, it makes typing and navigating around text so efficient, it's hard to imagine going back to emacs or ctrl/shift/alt/meta key combos.

Don't get intimidated by all the fancy features of vim. Once you've used it enough, you'll figure out which commands you use the most, and you'll figure out which things you can forget about.

Natter answered 27/2, 2009 at 23:27 Comment(0)
V
1

An investment in learning VIM (my preference) or EMACS will pay off.

I suggest visiting Derek Wyatt's site, running through the VIM Tutor, and checking out the Steve Oualine PDF book.

Vim helps me move around and edit quicker than other editors I've used. My work IDEs are quite limited in what they allow one to do and are typically devoted to a particular environment. There are tasks that still require me to revisit the IDE (such as debuggers which are a compiled part of the IDE).

Vitality answered 27/2, 2009 at 23:27 Comment(0)
F
1

Personally,

I find many of these terminal text editors incapable at times. Would I invest time picking one up? Absolutely! I would continue to learning one along side a IDE. Of course in the end, it really comes down to preference.

Futilitarian answered 27/2, 2009 at 23:27 Comment(0)
S
1

Yes: If you don't use and don't plan to use any IDE in future. And even if you use an IDE you will find yourself returning to it to do many things. In vim you van write scripts, do complex tasks like instead of individually editing 500 lines do it with a (slightly cryptic but easy to understand once you pick up) command. I initally found it difficult but later it has helped me lot. Even the best IDE's editor will lack the power of vim. Vim can work well with CVS, SVN, make, debuggers etc.

No: If you will stick to IDEs like Eclipse or Netbeans. Or if you find that editors like Kate are enough for you. Infact Kate or Notepad++ or jEdit have GUI and features you may miss in vim. e.g. Kate's symbol viewer or Notepad++'s huge menu bar.

Spoonfeed answered 27/2, 2009 at 23:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.