Live data from Hacker News

Why, oh why, do those nutheads use vi?

viemu.com

221–228 of 228 posts

Re: Why, oh why, do those nutheads use vi?

#221
post #220
post #218

Earlier quoted context omitted.

I fully realize the advantages that an IDE has over vim: http://news.ycombinator.com/item?id=2938995 If your point is that this handful of advantages is a slam dunk, and that it makes IDEs and vim+console incomparable such that whoever does so is making a categorical error, then your point has no legs to stand on.

You belittle clear advantages simply because they do not fit your taste or style while the usefulness and spreading use of IDEs is unquestionable, so this is too much of a personal preferences discussion than anything else, just like all vi vs emacs flames have always been and I find it disappointing that in 2012 this STILL keeps coming up... I thought I had FINALLY left those zealots behind me in the 90s. And I real…

Comparing vim+console to an IDE is always going to be all about personal preferences

That's been my point from the beginning. Tradeoffs between personal preferences is a hallmark of apples-apples comparisons. I mean apples-apples in the sense that both toolsets are used to accomplish the same exact things. I agree that there are the two general types of people that you describe, but I disagree that they are so irreconciliable that they shouldn't even attempt to discuss the tradeoffs. It is a perfectly reasonable discussion to have.

Re: Why, oh why, do those nutheads use vi?

#222
This article has been linked to 1,210 times on hacker news alone since it was first published 4½ years ago (according to Google: https://encrypted.google.com/#sclient=psy-ab&hl=en&s...).

It's fascinating how excited people get when given the chance to talk about their favourite editor!

Further down in the comments it always gets to the point where someone asks: "Yeah, I'm trying to learn vi, but how do you delete 3 lines?", or something like that.

Reminds me of this article: http://rachelbythebay.com/w/2012/01/16/replyall/

Re: Why, oh why, do those nutheads use vi?

#223
post #21

I use vim for about a year or more, and I like it, however I'm still having trouble with copying and pasting tiny fragments of text. Maybe someone can help me out with this? 1) If I yank a line with yy, pressing P or p will insert the text into a new line. 2) If I go to visual mode and select a region, yank it with y, then press p/P, it gets it inserted into the current line. That is, vim preserves new lines. What I…

There's no good way to do it, unfortunatly. You need to yank the contents of the line without yanking the entire line qua line. Now, if 'l' were a text object for 'line' then there would be an obvious 'yil' for just getting the inner stuff, but since there isn't you'll have to do 0y$ to go to the start of the line and yank until the end of the line. That'll store the line contents instead of the line itself, so p wil…

I have exactly this mapping defined in my .vimrc ...

  " 'Inside-line' operator-pending-mode mapping
  onoremap  il :normal! ^v$h
  onoremap  iL :normal! 0v$h

Re: Why, oh why, do those nutheads use vi?

#224
post #21

I use vim for about a year or more, and I like it, however I'm still having trouble with copying and pasting tiny fragments of text. Maybe someone can help me out with this? 1) If I yank a line with yy, pressing P or p will insert the text into a new line. 2) If I go to visual mode and select a region, yank it with y, then press p/P, it gets it inserted into the current line. That is, vim preserves new lines. What I…

[deleted]

Re: Why, oh why, do those nutheads use vi?

#225

Earlier quoted context omitted.

The goal of a new text editor shouldn't be to make things better for people who are already experts on an existing platform. It should be to make it better for beginners on the new editor (because initially, everyone is) and better for them when they become experts. Saying "I'm an expert at vi, and other editors don't work as well for me" is a pretty meaningless statement. Of course they don't. It's like saying "I sp…

But that's not what people are saying. What people are saying is that Vi is better for Vi experts than Blub editor is for Blub editor experts.

Except it's always a Vi expert making that assertion. I've yet to hear anyone say, I'm a Blub expert, but Vi is better.

Re: Why, oh why, do those nutheads use vi?

#226
post #182
post #158

Earlier quoted context omitted.

Screwdriver - quick, cheap, easy to use, intuitive. Can be learned once and carried around with you. Car assembly line - lots of initial capital, specific to one kind of car, lots of time to learn. Seems like a valid comparison.

The point is: these comparisons always try to make vi seem like the always better choice INSTEAD of an IDE and this is were I completely disagree. And you make it look just like that with adjusting the comparison in favor of vi, the screwdriver. This is just wrong. Let's see, you could also say: Screwdriver: specific to only one type of screw, limited to only a couple of similar sizes and all you can do is drive scre…

You do realize, the article is written by a guy who sells a vim emulator plugin for Visual Studio?

(It's really good, too, I use it at work.)

Re: Why, oh why, do those nutheads use vi?

#227

I really don't get how its more efficient than a modern editor! I use vi(m?) when I am working on a unix/linux/mac terminal and have done so for 10+ years. But I never bothered learning it properly so I only know a handful or two of commands. So I can't appreciate both perspectives clearly. However, how can it be faster and more efficient to edit in vi than in a modern editor? I'd assume that if you can use multi ges…

I've used Vi(m) enough to know that I'm far more efficient in an editor designed to work with my OS. Knowing Vi (or Emacs) is essential as a software developer, but using it as your local code editor has never made sense to me. What most people who pontificated about Vi/Emacs/editor-of-choice often fail to realize is that there isn't a "One True Way To Do Things Bestest". Everyone works differently. Using Vi for 30+…

[deleted]

Re: Why, oh why, do those nutheads use vi?

#228

I really don't get how its more efficient than a modern editor! I use vi(m?) when I am working on a unix/linux/mac terminal and have done so for 10+ years. But I never bothered learning it properly so I only know a handful or two of commands. So I can't appreciate both perspectives clearly. However, how can it be faster and more efficient to edit in vi than in a modern editor? I'd assume that if you can use multi ges…

To start with, the way vim keystrokes combine is pretty nifty. To move forward a word, w. To delete the next word, dw. To delete the next 6 words, 6dw. To move to the next "g" character on the line, fg. To delete everything to that character, dfg. To delete everything inside the parens surrounding the cursor, di(. Something I do a lot with viemu in ms sql: Select everything inside parens with vi(, then hit F5 to execute the subquery.

But it got really fun when I started using macros. Once you're doing everything with keystrokes and text objects, you can record a macro while you're doing it. So, keeping with sql, let's say I want an update statement.

First I use an IDE feature to give me a list of all columns in a table, comma-delimited.

qa starts recording a macro into register a

Wi advances to the next column name and inserts a carriage return

q stops recording macro

10@a plays the macro ten times

Now I've got each column on a different line. I go back to the first line.

qw starts recording a macro into register w

ia. puts "a." at the beginning of the line

yw copies the column name

A = b. goes to end of line and adds " = b."

pA, pastes the column name and adds a comma to the end

j^q moves to beginning of next line and stops macro recording

10@w does the same macro ten more times

Now with a few keystrokes, I've changed this: column1, column2, column3, ...

To this:

a.column1 = b.column1,

a.column2 = b.column2,

a.column3 = b.column3, ...

And the key point is, I did it without having to think about it much. I used the same editing techniques I would have used to make that change for just one line, and with half a dozen extra keystrokes I made it apply to as many lines as I needed.

Possibly I made small mistakes in the exact keystrokes above. When doing it for real, you see all the changes on that first line as you do them, so if something isn't quite right, just hit u to undo and keep going. It's so easy, I can record and replay new macros all the time. I almost never have to do repetitive editing.

Another trick, not available in viemu but available in vim: select a bunch of lines, then type :norm and your next editing commands after that will get applied to all the lines. For example, to add a comma to the end of every selected line, :norm A,

Post reply on HN