
Vim is a great text editor - try it - rudenoise
http://www.joelhughes.co.uk/blog/2009/10/vim-is-a-great-text-editor/
======
jng
You may want to check these resources I published, too:

* Why, oh why, do those nutheads use vi? <http://www.viemu.com/a-why-vi-vim.html>

* Graphical vi/vim cheatsheet & tutorial [http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...](http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html)

~~~
geocar
I have put together some suggestions/hints for vi users using vim a while back
that might be helpful as well.

<http://geocar.sdf1.org/vim-hints.html>

------
RiderOfGiraffes
Pet peeve:

    
    
        There may be a steep learning curve ...
    

Can someone explain the axes of the graph in which "steep learning curve"
equates to "takes a long time" ??

I can.

It requires that you put knowledge on the X-axis, and time on the Y-axis,
which is completely at odds with the usual way of doing things.

Like many idioms you have to read this as meaning one thing even though it
says another. You have to read this as "it takes a long time," even though
that's not what it says.

Language - I don't know how it works.

And sometimes it doesn't.

</rant>

~~~
icey
Look, it's really not that tough. Here's what you need to treat vim as a text
editor with syntax highlighting:

    
    
      esc (escape) = go to the default mode
      i (insert) = when you want to make changes to the document
      
      esc + : (escape, colon) = think of this as control + whatever
      :w = (w)rite - save your file
      :q = (q)uit - quit vim
      :wq = (w)rite, then (q)uit
      :q! = (q)uit!, discarding any changes
    

Just those few things will let you use vim well enough while you're figuring
out all the really cool stuff it can do.

Emacs can be treated similiarly: C = control M = "meta", usually the alt or
option key. You can use escape if you want.

    
    
      C-x C-f = control x (do something) + control f (find file) - open a file
      C-x C-s = save a file
      C-x C-c = quit
      C-k = (k)ill - this is similar to cut
      C-y = yank - this is similar to paste
    

For emacs, it may be easier to start with cua mode -

    
    
      M-x cua-mode 
      (btw, m-x means "run this function") 
    

Cua mode gives you a copy, cut and paste that works the same as your operating
system.

~~~
RiderOfGiraffes
You're replying to the wrong person - vim is my primary editor. I'm ranting
about the stupidity of the phrase "Steep learning curve."

~~~
icey
heh, I guess I misread what it was you were ranting about; I took it to mean
that you hate any sort of learning curve when it comes to editors. Thanks for
clarifying!

------
tezza
Good lord!

The main reason to learn _vi_ is that it is installed by default on so many
systems, including most ancient Unixes.

When your task is to edit a config file and you don't have time/permissions to
install your editor of preference.... _vi_ is the only choice.

Emacs and others may not be present on a system when you really need it.

A basic competence in _vi_ is essential if you're going to deal with Unix.
Even if you prefer Emacs (like me) or other myriad tools.

~~~
silentbicycle
Sometimes, if you're _really_ screwed, you may not be able to mount the
partition with vi. ed is almost always on Unix, though. (Knowing how to open a
file, find and change a few lines, and resave is probably good enough for
emergency situations.)

Also, it's worth learning ed because the ex prompt in vim shares most of its
functionality, and because sooner or later you'll realize how lucky you are
that you don't have to work on a teletype. :)

~~~
jcw
Ed is fun to use, and learning it makes you better at vi.

~~~
stcredzero
Your comment made me smile. I had a thought of a fictional programmer so
editor-centric, they decide on their programming language based on which one
will help them improve their skills at vi. (Which is a misinterpretation of
your comment. vi has roots in ed, so some of the cool esoteric stuff is
invoked in the same way.)

------
adriand
From what I've seen of vi (mainly as a result of editing files directly on a
server via ssh), it seems like an efficient text editor, undoubtedly. But what
about if you're constantly bouncing between different files in a project? Like
a Rails project, for example, with its many different files for models, views
and controllers?

I.e. how good is it at handling projects, as opposed to just files?

~~~
rudenoise
There are a lot of ways to use Vim on multiple-files/projects, and the
documentation is probably the best place to start.

You can also plug it into Eclipse via eclim <http://eclim.sourceforge.net/>

------
ryah
This is the top story on hacker news?

~~~
spudlyo
I am sick to death of the editor wars and editor advocacy, I wish people would
just stop. I bet most hackers have made their editing decisions long ago and
are content with their choices.

Having said that, I would like to add something positive to the discussion. I
think whichever editor you choose, you should learn to move the cursor around
without using the arrow keys. There is considerable value in keeping your
hands on home row. Every time you reach for the arrow keys you add latency to
your workflow. It adds up.

~~~
staticshock
> I bet most hackers have made their editing decisions long ago and are
> content with their choices.

I think you're completely ignoring the next generation of hackers, which is
unfortunate. I've been working on getting past vim's learning curve for over a
year, on and off. True, this submission sucks, but it lead me to find this:
<http://www.viemu.com/a-why-vi-vim.html>, which is pretty informative for a
beginner.

~~~
Semiapies
I like reading things about various editors now and then, and it certainly
serves an educational purpose.

However, this does _not_ require the spamming of "editor" advocacy posts
(where "editor" has meant "vim") recently.

------
JDigital
Today I learned that Vim began on the Amiga.

[http://cd.textfiles.com/fredfish/v1.6/FF_Disks/571-600/FF_59...](http://cd.textfiles.com/fredfish/v1.6/FF_Disks/571-600/FF_591/Contents)

~~~
moe
The Amiga was the source of many great things. It also had CygnusEd which gets
cited up to this day as inspiration for TextMate and others.

<http://texteditors.org/cgi-bin/wiki.pl?CygnusEd>

------
Hates_
Short article, but voted up simply to voice my love for Vim.

It took me a long time to finally get comfortable with Vim. I would load it up
every few weeks, learn a couple of commands or things like using split windows
and then get frustrated/held up enough that I would go back to Textmate. After
going through the process for a good few months, I then somehow managed to
make it through a day without getting frustrated once. Then on the second day
I literally felt like I was flying through my code. TBH I have never felt this
productive in an editor before.

I would constantly read people saying that watching someone in Vim is like a
work of art and never quite understood what they meant. But now I do. The
speed at which I can navigate through a file, move text around, move around my
project. Even simply never having to move my hands away from the home row
makes me feel more focused on what I'm currently working on.

~~~
silentbicycle
> voted up simply to voice my love for Vim.

Please do not do this. It leads to really banal "vote up if you like _ too"
posts on the front page.

I think a lot of people find vi unpleasant because it so unapologetically
makes the trade-off of having dozens of (composable) single-character commands
you have to memorize _upfront_ , rather than a more conventional interface
whose advanced features you can gradually learn. You can't really get an
accurate impression of vi's strengths until you've already committed to
memorizing a lot of commands - _the terseness itself_ is a major feature in
the long run. (Emacs is similar in this regard, but with very different trade-
offs.)

For most programs, this trade-off is probably hard to justify, but for
something that one spends a lot of time working with directly (such as a
structurally-aware text editor, photoshop, autocad, etc.) it's probably
reasonable.

------
tibbon
I'll sadly admit that for most quick file editing I still use pico/nano (which
is installed on most every system that I've touched in the past 3-5 years). I
used emacs around 1998, but at the time it was too big I felt and had too much
power. vi was just damn confusing. When I saw people using it, it looked
amazing, but I could just never get the handle on it.

When I'm editing big files/coding I use Cyberduck to SSH/SCP files over to
TextMate, which works well most of the time. The only time it doesn't work is
when I need to sudo edit that file, because Cyberduck can't sudo.

------
m0shen
For those of you who use Netbeans there is jVi ( <http://jvi.sourceforge.net/>
) a fairly faithful Vi emulator.

Also, Komodo Edit ( <http://www.activestate.com/komodo_edit/> ) is a modern
free, multi-platform editor which has nice Vi support.

------
WilliamLP
What I'm trying to figure out is whether vi/emacs, and the Unix command line,
is actually still a relevant way to do development.

You see, cults that are divorced from empiricism _do_ exist in CS; I'm sure of
this. But I'm not sure of whether people who feel such strong love for the
command line belong to one or not.

As a pure text editor, Vim seems really nice. However, once I start wanting to
do what I take for granted as fairly basic things, I want the mouse and
graphics more and more. For example, say I just want to have program output, a
couple of code listings, and a visual debugger all on the screen at once
across multiple monitors with integration between them. People swear that the
Unix prompt is better anyway. However, they all seem to be programmers whose
careers peaked in the 70s or 80s too! I'm a Unix neophyte but my first
impression in trying to do C programming in vi is that without all the
comforts that something like Visual Studio gives me, _it just sucks_. I'd love
to be proven wrong actually, but the people on the other side of the argument
also seem to be dinosaurs (albeit genius dinosaurs) who don't even think that
trace-through debugging is a good thing. Heck, even Linus lost that fight.

Vi-style editing inside a modern IDE like Eclipse or Visual Studio does seem
interesting though.

~~~
bct
> all the comforts that something like Visual Studio gives

What are these, anyhow? Whenever I've used Visual Studio or Eclipse it's felt
like a burden.

~~~
WilliamLP
> What are these, anyhow?

Integrated debugging. (I know gdb is incredibly powerful, but it seems too
much to have to reprogram my brain for yet another editor within an editor.)
Errors and warnings appearing _while I type_. Ctrl+click to go to source for
any function I'm viewing. Variable and function auto-complete. Integrated
documentation for functions that appears as I am typing. Quick and easy
navigation of a file hierarchy. (I know vi and emacs allow this but it
requires a level of mastery and key memorization for benefits that seem far
from clear to me.) Managing project settings. Refactoring.

For someone that has achieved mastery over Unix over many many years, these
things either seem unnecessary or they have a substitute (that's perhaps even
better). However, I guess I'm wondering if there is a group of people who
aren't old programmers from the 80s who started with something like Visual
Studio or Eclipse, used it enough to achieve a level of mastery over
programming that way (with a brain trained to use the mouse), and then after
that found a gain switching to command-line type tools, that was worth the
many many additional hours of brain re-training.

------
capablanca
Also, emacs.

~~~
silentbicycle
Could you flesh that out a little?

------
cema
I tried it. I tried vi, vim, gvim.

I now use a number of editors and IDEs. Vim is not not of them. I launch it
once in a while, just so I would not forget how it feels (and would not forget
how to :wq). That's all.

As far as the holy flame war on editors, I do not have much to say about it,
and will avoid reading much about it.

------
CrazedGeek
Is it worth learning how to use vim (well) if I already feel fairly
comfortable in another text editor? The author only touched on speed and how
you're more "involved" with the code, which were vague enough that I was left
unconvinced.

~~~
billswift
It's definitely worth learning enough to use, just in case your preferred
editor isn't available. I tried it, but couldn't get used to switching modes,
I kept messing up my file and having to backout and fix things; so I memorized
a subset of vi that would let me get any editing done that I absolutely had to
and went back to using emacs for regular use. Note that the default version of
vi is not always vim, some systems use elvis or other vi clone, some of which
have different advanced features and keybindings; for use when nothing else is
available, concentrate on the basic vi commands.

------
mdg
Sure I dont mind reading an article on Vim (or even Emacs), but please, try to
add something instead of linking to other resources.

------
akie
Oh please, here we go again. Stop advocating your love for that 30 year-old
piece of software. Please. Stop it. You don't hear ME expressing my love for
Eclipse on a daily basis, now do you? Seems like you have some convincing to
do?

Plus, I'm not buying it. If it's so great, why do you even have to market it?
Wouldn't it just sell itself? But no. Instead we get these "VI is great" vs
"Emacs is better" discussions every-f*cking-time. And I've had it. Just use
your old, old, old piece of software, be happy about, and stop trying to
convince me.

~~~
bmj
_If it's so great, why do you even have to market it?_

That's kinda silly. That's like saying "why does Apple spend jillions of
dollars marketing the iPhone if it's so great?" Some people genuinely don't
know about [pick your editor], and some people like their tools so much, they
like to tell you about them. Isn't that the whole point of blogs, anyway?

~~~
WilliamLP
> "why does Apple spend jillions of dollars marketing the iPhone if it's so
> great?"

Because it leads to massive profit. I don't think it's pure altruism motivated
by a desire to give better user experiences.

~~~
bmj
It's not just about the money, though. How is free/open source supposed to
gain traction, if not by people saying "hey, this is good!" If no one
"markets" a piece of software, how you know about? How did _you_ find out
about the tools you use?

~~~
WilliamLP
Agreed, but I was just pointing out a clear non-sequitur in the parent post.
People should use logic when making a point.

