
Vim Creep - DavidChouinard
http://www.rudism.com/s/vimcreep
======
kevinalexbrown
This is an extremely awesome, fantastic, exhilarating use of hyperbole.

What I gained from the article wasn't any explanation of why Vim is great;
indeed, there was little included in this respect, aside from moving "entire
blocks of code with the flick of a finger." Even the cool feeling of
proficiency you get from knowing a tool well, and the fun of getting to show
off a skill to a "how did he do that!?" audience was secondary.

My favorite part was the implicit reminder to relax about my tools. The most
effective use of hyperbole is not the emphasis of a particular point, but a
caution not to take ourselves too seriously, and place our self-satisfaction
in proper perspective. The most powerful instances border on satire, and in
that respect, this piece was perfect.

Addendum: I use vim and pentadactyl. They are extremely awesome, fantastic,
and exhilarating.

~~~
mun2mun
Just watch the video of the page
[http://blog.extracheese.org/2010/11/screencast-custom-vim-
re...](http://blog.extracheese.org/2010/11/screencast-custom-vim-
refactorings.html) to get the gist of "entire blocks of code with the flick of
a finger".

~~~
astrofinch
I'm pretty sure that "re-factoring" could've been accomplished equally fast
with the mouse. In most editors, you can double-click to select a token and
triple-click to select a line. So the mouse version would be: double-click 10,
copy, double-click ten, paste, triple click the line you want to delete, press
delete. Pretty fast, really; especially if you're using a laptop where the
cost of moving your hand to the mouse is negligible.

I tried Vim for several months and got reasonably competent. But then I timed
myself doing the Vim tutorial with Vim and Gedit, and Gedit won handily. For
this reason I'm convinced that Vim is only popular because using it gives you
hacker cred.

I'm open to changing my mind based on solid experimental evidence, but for now
I only use Vim occasionally, for the macros.

~~~
zephod
Your first paragraph ignores the central point of the screencast: How would
you record those mouse interactions as a general, reprogrammable macro? He
signs off the video with an important statement which hints at the 'zen' of
using Vim for a long time: "It's a nice thing to aspire to, to automate all of
your interactions with the code in this way".

------
crazygringo
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.

~~~
xutopia
You 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.

~~~
recursive
If 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.

~~~
ta12121
Does your example include the action of deleting bar with baz?

Also, not having to move away from the home row makes me feel much faster.
Having to use Alt/Control/Arrows makes me cry. (I know you can't avoid Control
in Vim, but in this example it is not required.)

ci"baz<esc> is 7 keystrokes, only one of which is a jump.

<ctl-F>bar<esc>baz is 8 strokes and two jumps. It also requires typing the
entire string in quotes. If the example were

var foo = "The quick brown fox jumps over the lazy dog";

The vim example would not change but yours would.

I'm not trying to be an a-hole, use what you like, I'm just saying, that for
me the attraction to vim is the strive toward the minimization of keystrokes,
especially ones that require me to move my hands.

~~~
recursive
No, good point. You'd then have to type "baz".

However, if I was actually faced with this problem, I'd use End, Ctrl + Left,
Ctrl + D, baz, which is a total of 7 keystrokes. (if you don't release Ctrl)

The vim example was 8 keystrokes. (" is shift + ') I have no doubt that you
could manufacture an example that shows a benefit for vim, but I think that
the advantages are overestimated by heavy vim users.

Edit: Your longer string example is a good example of a task that's more
efficient in vim.

~~~
cgs1019
A commonly overlooked aspect to the vim way of describing what you're doing in
verbs and nouns and prepositions is that the "." character in vim means
"repeat my previous edit". So if you can find a way to "phrase" your edit as a
single change (i.e., 6sasdf<esc> would delete six characters starting under
the cursor and leaving me in insert mode, then insert the letters asdf and
exit insert mode) instead of many (i.e., xxxxxxiasdf<esc>, deleting 6
characters separately, entering insert mode and entering the letters asdf)
then you can go to another spot in the text and just hit . to repeat the edit.
I've given a contrived example here, but this is enormously powerful. It's why
there are several ways to enter insert mode: "i" to enter under the cursor,
"a" for after the cursor, "I" for first non-whitespace character on the line,
"A" for after the last character on the line, "o" for opening a new line below
the cursor, "O" for above, "c"+motion for deleting through the motion and
leaving in insert mode, count+"s" for removing count characters starting from
cursor and leaving in insert mode. There are more....I'll stop :)

~~~
Scaevolus
Sublime Text supports multiple cursors, which I find to be a more natural way
to do things where you might use those tiny repetitions-- you select all the
regions you want to edit first (usually by repeatedly adding the next match to
the selection), then any typing or movements you do occur in parallel.

------
jdludlow
My first week in college a distant relative of mine at the same school pulled
me into the Sun lab. The sum-total of his instructions were:

* This is how you log in.

* This is ls.

* This is cd.

* This is man.

* This is apropos.

* Learn vi.

* Have fun.

What came from that 5 minute intro to Unix has been applied orders of
magnitude more often than anything from 5 years of an EE degree.

~~~
xutopia
Can you explain to me what apropos does?

~~~
jdludlow

      $ man apropos
      
      apropos searches a set of database files containing
      short descriptions of system commands for keywords and
      displays the result on the standard output.
    
    

It answers the question "I wonder how to do [this English word]."

For example: "I wonder how I copy a file."

    
    
      $ apropos copy
    

Dumps out all of the matching entries from the man pages for the word "copy".
If you just wanted general commands, as opposed to library functions, and
assuming your system organizes man page sections in the typical manner, you
can filter it down with:

    
    
      $ apropos copy | grep "(1)"
      cp                   (1)  - copy files and directories 
      cpio                 (1)  - copy files to and from archives

~~~
greyfade
Instead of using `grep "(1)"`, use the `-s` switch:

    
    
        $ apropos -s1 copy
        bsdcpio (1)          - copy files to and from archives
        cp (1)               - copy files and directories
        dd (1)               - convert and copy a file
        ....

~~~
barrkel
I think it's better to use grep. Knowing the options to apropos has very low
value. Knowing grep has lots and lots of value.

~~~
tomp
I agree. I have no idea how to use `find`. I always do `find . | grep
whatever`, since I know the basics of grep.

~~~
Dobbs
Learning find is a worthy investment.

    
    
        find ./ -name "*.log" -size +2G -ctime +3 | xargs -P 8 gzip
    

Will find all log files over 2 gigs and older than 3 days. Then it will gzip
them split across 8 parallel gzip processes.

------
karmajunkie
Can we all stop patting ourselves on the back for being vim badasses now?

Yes, its a fantastic editor. Yes, its probably going to make you more
productive. Yes, its every bit as capable as any other IDE or editor out
there.

No, it will not make you a better person. No, mastery of vim does not make you
fart sunshine. No, it won't make you an enlightened buddha.

~~~
pfraze
I think it's more about mastering tools with a high learning curve. It's our
trade; it's fun to feel good about it.

~~~
thetabyte
I think that's something we as a community forget. It's _ok_ to feel proud of
being good with your tools. It is _fun_. As long as we don't turn it into a
"holier than thou" situation, it's neat to have an editor that you have such
mastery over that you can control blocks of text with keystrokes _.

_ Note: I don't quite have it yet myself. I'm been using vim for about 6
months (with only 2-3 of active use) and I'm actually right on that cusp he
mentions--where you are searching less and less, and only for more powerful
and obscure commands, and things are _just_ starting to all become extremely
useful. It's beautiful.

------
SwellJoe
I've said it before, and I'll say it again...

Editing text is a solved problem: vim or emacs. Pick one and get back to work.

~~~
Androsynth
Although I agree with you, IDE fans feel the same way: "Writing code is a
solved problem: eclipse or xcode or visual studio. Pick one based on your
environment and get back to work"

An argument I hear a lot is: 'vim is fine for editing files on a remote
server, but not suitable for everyday work'. I believe it is a common belief
outside of the HN crowd.

~~~
SCdF
On IDEs: I have the 'pleasure' of being one of those chaps who spends parts of
his day job reworking massive Java projects. There is no way in hell I'm
touching that without an editor that __deeply __understands Java.

~~~
SwellJoe
There are multiple variables in your equation. You may be altering the wrong
one.

~~~
DeepDuh
What are you talking about? His job?

~~~
tikhonj
Java.

Seriously, it's a language sufficiently verbose and inexpressive to
effectively _require_ an IDE. If you're just going to be generating 70% of
your code from your IDE, why is it there in the first place?

~~~
electrograv
Languages don't just fall into two black and white categories of whether or
not it requires an IDE that understands the language. It's a spectrum, which
means that all languages should benefit from an IDE that understands the
language. If not, then you've just found the perfect holy grail of computer
languages. Until then, face the fact that language integration is nice.

Unless I'm missing something, specialized non-VIM IDEs tend to be much better
at auto completion (especially in C++), jump-to-definition, refactoring, etc.
IDE users (who typically are ignorant to VIM) can use these features with
extreme productivity. On the other hand, VIM users tend to be rather ignorant
of how incredibly productive you can be and how nice it feels to have these
powerful context-sensitive tools at your fingertips (and sorry, but CTAGS is
useless). Regardless of what IDE you use, nobody can deny IMO that having an
editor look up APIs and function lists for you in a context-relevant manner is
productivity-boosting versus the alternate of scanning headers manually.

So in this sense I think both VIM/EMACS and IDE users are ignorant to other
editor paradigms. What I don't like is how each party tries to claim that
their method is the best, without having truly tried both.

I've used both extensively (used VIM for years) and I prefer IDEs by far, but
that's just my personal preference.

~~~
tikhonj
I've used both IDEs (Eclipse, IntelliJ IDEA) and Emacs. Originally I preferred
the IDEs, but then I learned how to use Emacs properly. Besides, Emacs
actually combines the best of both worlds for some languages like Scala or any
sort of Lisp. (But, notably, _not_ Java.)

I may be crazy about Emacs, but I'd probably still use an IDE if I had to do
significant Java development. This says far less about IDEs and editors than
it does about Java: I'm going to try very hard _not_ to do any significant
Java development in the future, thank you very much!

And that's really the entire point of my earlier post: it was not in favor of
editors or IDEs, it was in favor of not using Java. Java is a poor language
cursed with a good implementation: it's too good to die but not good enough to
use.

A common argument I hear from people defending Java is that their IDE can
generate half their code for them. And that was what I was really responding
to: if you can use a tool to automatically generate all that code, it should
just not be there in the first place!

Your experiences using an IDE for Java say as little about the relative merits
of an IDE or text editor as experiences using Emacs on some Lisp: they're both
extreme cases. And, more importantly, the reason normal editors are poor for
Java, and the reason that SCdF is not touching a normal editor, are endemic to
_Java_ and not to the other tools.

~~~
gutnor
You spend as much time reading code as writing it. An IDE that can show you
context relevant info at all time and facilitate browsing is interesting in
_any_ language. (like where is this set, where else it is used, what the doc
for it, ...)

You can also see it as a "problem" of the language if you cannot create an IDE
that improve your productivity over a text editor.

------
AndyKelley
Somehow this reminds me of an Everything2 article about Nethack titled "You
have a sad feeling for a moment, and then it passes."

It inspires the same kind of nostalgia.

[http://everything2.com/title/You+have+a+sad+feeling+for+a+mo...](http://everything2.com/title/You+have+a+sad+feeling+for+a+moment%252C+then+it+passes)

------
habitmelon
I have never been moved so close to tears by an article about a text editor
before.

~~~
jdludlow
Most people have read this before, but maybe some of the kidlets here haven't
seen it.

<http://www.cryptonomicon.com/beginning.html>

464gg for the greatest chapter about an OS ever written.

------
kstenerud
I started using vi in high school. Used it extensively throughout college.
Then I had my first taste of a proper GUI IDE.

Since then, I've only used vim for editing config files on a remote unix
system.

------
gatordan
Not so subtly the author is telling the reader if you program with Vim you'll
be just like "all the really great programmers" who can write 4 line solutions
to problems that take ordinary programmers 10 pages. You'll produce
"impossible patterns of code and text manipulation", and be able to "fill
dozens of registers" (admittedly I don't know what that means). This is all
bit silly and reminds me of "hacking" in the Hollywood films.

I understand that this post was tongue in cheek. I also understand that not
all text editors are equal, if you see someone writing their first hello world
program in Notepad yes you should tell them about much better alternatives.
But this post confuses ability to program with ability to use Vim.

Being really good at using Vim will definitely let you say you're part of the
club of people who are really good at using Vim. It just might make you more
efficient at manipulating code. But let's not perpetuate the elitism that is
pervasive enough in hacking, it's a text editor. It doesn't make you more
intelligent, better at problem solving, or writing more efficient code.

~~~
thedufer
He's not saying that using Vim will make you a better hacker. You're the one
who's confusing remarks on correlation for causation.

Its probably likely that there is such a correlation; those who are willing to
put in the time learning vim/emacs are probably those who spend the most time
coding, and thus have the most practice.

------
lisper
You could do a global search and replace of "vim" with "emacs" (or pretty much
any other development tool for that matter) and it would not change the
semantic content of this article at all.

------
kator
LOL so in my early days it was "vi" but I too use "vim" now a days.

Either way the funny thing is when someone asks me "how do you do THAT in vi?"
I often find myself typing in the air to replay the muscle memory that
executes those instructions.

For better or for worse I've become muscle programmed to execute vi commands
in flashes of thought that really never reach my normal cognitive functions. I
love to watch people stunned as they see me do something I've taken for
granted for years or figured everyone else knew how to do.

All that said, all tools are not for all situations and all people. I do at
times find myself jumping into eclipse (Java I'm looking at you!!!) because of
the many additional features available in a good IDE.

I know you can run the vim extensions in eclipse but I've never bothered. I
figure if I'm going to mouse my way through an IDE I'm not sure what having vi
commands will do to make my life easier. :-)

------
ciderpunx
Nice. Very nice.

I even tweeted it. With TwitVim, naturally.
<http://vim.sourceforge.net/scripts/script.php?script_id=2204>

------
chrisdotcode
Also feels good to have vim bindings inside of emacs using evil
(<http://www.emacswiki.org/emacs/Evil>).

~~~
sea6ear
Oddly, I've found myself using vimacs (<https://github.com/andrep/vimacs>) to
have emacs keybindings available with the quick startup / easy configurability
of vim.

I make no claim that emacs keybindings are superior to vim's native
keybindings, but for whatever reason, I type more naturally using them at this
point. (Which somewhat mystifies me, since for years I used vi/vim as a
primary editor with it's normal keybindings.)

I still think that vim keybindings are faster than Emacs for actually editing
text, but the emacs keybindings feel more pleasant to me (unless I'm using
something without a dedicated control key - like a phone or tablet).

------
kennethologist
This article has changed(or at least I hope) my life. I'm installing Vim today
on my Windows Laptop. Does anyone know of a good guide for beginners?

~~~
icarus_drowning
I learn by watching and following along with examples, so the following
YouTube videos are the ones that I've found the most useful:

<http://www.youtube.com/watch?v=71YTkxUNwmg> <\--Covers the basics and helpful
commands. I had never used vim before watching this video, and now I'm
reasonably competent at basic text editing.

I needed to do find and replace on a short story I'm working on (changed a
character's name), and I found this one helpful:
<http://www.youtube.com/watch?v=J1_CfIb-3X4>

I wanted to understand/use the .vimrc file, so I googled until I hit this one,
which I found quite informative: [UPDATE: put in the wrong link, serves me
right for picking the last history item with .vimrc in it instead of watching
it. The actual video I found helpful was this one of a guy showing his .vimrc
file and what various things in it do:
<http://www.youtube.com/watch?v=xZuy4gBghho>]

Lastly, once you're comfortable using it, try going into command mode and
typing Shift-a, and notice that it moves your cursor to the end of the line
_and puts you in insert mode_. I saw this tip on HN awhile back, and I hadn't
seen it in any basic tutorials, but it is the single most useful command I've
come across.

~~~
FuzzyDunlop
Shift+I moves your cursor to the start of the line, and enters insert mode,
too.

------
jamesaguilar
I've never found that symbols -> buffer is the bottleneck for me. Instead, it
exists somewhere between problem -> symbols.

~~~
regularfry
Yeah, but having got through the problem->symbols bottleneck, it's nice not to
have another one waiting.

------
twism
looks like he forgot to switch to command mode at the end of the post.

~~~
mediocregopher
Which is the the :wq got inserted and not executed.

------
mikebell
I'm all for vim or whatever other editor you prefer.

But to somehow claim that one editor or another is going to make you a better
programmer and make your 10 pages of crap code become 4 elegant lines is
pretty nonsensical.

No matter what editor you use; if you're not good at problem solving, you're
not going to make a good programmer.

------
Xcelerate
You know, I'm doing an experiment like this with Tetris. I was looking at the
world record for 40 line clear (20.55 seconds at
<http://www.youtube.com/watch?v=WzUUKKuye24>) and I realized that the limit is
not how fast he thinks, but how fast he is pressing the keys.

So I designed my own system. One key press drops the piece instantly into the
correct spot, with the correct rotation. It's making my brain hurt practicing
because it requires so much thinking, but once I get it into muscle memory,
things are going to get really interesting. My 40 line best using the arrow
keys is 45 seconds and with my new scheme it is 2:21. But I'm dropping time
quickly and I'm sure very soon I'll beat my record.

~~~
Xcelerate
Okay, maybe you didn't see how this related. I should have made it clearer.
There are a lot of discussions on this page about how Vim's advantage comes
from the muscle memory adaptation, relegating text editing to a subconscious,
effortless activity rather than something that requires active thought.

I was expounding on this concept with an idea of my own and speculating about
its potential benefits using analogous logic to that used in the reasoning
about Vim's efficiency.

Better?

------
devin
"Knife skills" don't make you a good developer. Cook a great steak and worry
less about cutting it. Tools are boring. People are far more important. A post
like this is akin to "I LOVE BRITNEY SPEARS." Please God, make the programmer
pop culture stop.

~~~
kragen
Coincidentally, I've been working on my knife skills lately. In the past, I
often served dinner late because I took so long to chop the vegetables. (I'm
vegetarian.) Now that I'm focusing on proper knife technique to chop quickly,
I find that I can get dinner served faster — but also I have more flexibility
to respond and experiment in the kitchen, because I can, for example, put the
skillet on the stove before I start chopping the onion I'm going to sauté. And
I'm less likely to burn things, because chopping takes less of my time and
attention.

Of course, knowing how to cut isn't the same as knowing how to cook.
Vegetables chopped slowly taste the same as vegetables chopped fast. But if
you already know a thing or two about food, you can cook a little bit better
if your cutting technique is better.

------
VMG
Nope. Don't get me wrong, I love vim, but I don't need to have it
_everywhere_. It makes no sense in the browser. It's lacking some features
Eclipse has (although if Eclipse had a _proper_ Vim mode, I'd use it in a
heartbeat).

~~~
osa1
I'm using viPlugin( <http://www.viplugin.com/> ) for months now and I'm pretty
happy with it. I don't think I could use Eclipse without it.

~~~
VMG
Thanks, I'll have a look

------
kabdib
I'm like that, exactly, but with Emacs.

A long time ago I narrowly escaped being like that exactly, but with TECO :-)

I've learned not to fret about people's choice of editor. FOr instance, if
someone was happy in NotePad, as long as it didn't affect me, I learned not to
care. (I might grit my teeth in frustration, watching them flail for minutes
at something I could do in seconds with my choice of editor, but that's my
problem).

------
lukejduncan
For me pragmatism wins the day. Vim has been installed on every machine I've
ever ssh'ed into. Not true for emacs or even nano or pico.

~~~
dredmorbius
Vim, really?

Some vi variant, save but for a few instances. But not necessarily vim.

Being stuck to use old-school vi a few times in the not-to-distant past made
me realize how massive an improvement over it vim is.

Yes, I can GSD with vi, but I can _really_ GSD with vim.

------
jordo37
Fully recognize I am outing myself here but the timing seems great given the
Vim articles that have been coming up lately, as well as my Lead Engineer
keeps bugging me to really get into Vim. I have used it before, but never GOT
it. Is there an online guide that is great (and not just a story like this
one) or do I need to get the O'Reily Vi and Vim book?

------
mdonahoe
I chose vim because it was radically different than anything else.

All text editors have crazy shortcuts that do magic, but only vim has the
ironically named NORMAL mode with its verbs, movements and registers...

I treated it like a new game to learn. Sometimes I will write a macro because
it is more fun, even though it might not save me raw time.

------
pacomerh
Nice writing, this goes straight to the HN monthly. Ultra nerdy nonetheless.

------
farinasa
Being somewhere in the middle of that timeline, I'd watch that movie. This
piece reminds me that an authors vision is always more important to
communication than the subject itself.

------
wangweij
If someone can always "churned out 4 line solutions for an assignment that
took you 10 pages of code to complete", he can use any editor or maybe simply
"cat >".

------
thornofmight
How do people use Vi on large projects? Do you just manually type in the name
of the file you're looking for every time?

~~~
moconnor
I use the CommandT plugin: ,/ and then start typing fragments of the filename
/ path to open.

------
helpbygrace
I definitely save this article not for the awesome main post but for the
useful comments and replies.

Thanks all.

------
modarts
I admit that this is beautifully written, even though I strongly disagree with
the premise.

------
jonzjia
macvim for objective-c? That sounds like a PITA to set up properly.

------
m12r
why vim creep, it should be titled "ode to vim"

------
andere
What a feel-good piece.

------
rsbrown
No, I didn't.

------
moron
I still can't believe people love that damn thing so much, even after all
these years. There are way better tools in my opinion.

Of course, if you like it by all means continue using it. But if you think it
has anything to do with your talent as an engineer, you are wrong. And if you
see other engineers not using it and think it implies anything about their
talent, you are wrong.

Side note: if anyone wrote in such a breathless tone about Apple, they would
be skewered as a fanboy and a drinker of the Kool-Aid.

