vi, emacs or copy con foo.exe?

From another thread I didn’t want to hijack…so, which is it?

(Any answer other than vi, or perhaps vim, is wrong, btw.)

Perhaps I should opened this in GD? :smiley:

The only reason people who use vi claim to like it is because they don’t want all the time they wasted learning a bunch of archaic nonsensical commands to have been for nothing.

Emacs is better. That’s GNU emacs mind you – don’t set up a strawman bashing the bloated and stupid XEmacs, which I think we can all agree is the devil.

pish, I know all the emacs I need when having to slum it: ctrl-x, crtl-c

<grumble>Eight Megs And Continually Swapping</grumble>

:confused:

What kind of computer are you using? Some of the newer ones these days have literally hundreds of megabytes of memory in them.

Duh. “vi”, of course.

I thought MPSIMS was the forum for witnessing, though?

Can I get a Hallelujah?

Oh, you wouldn’t be QUIET so smug if you’d spent any time with a VAX dickless diskless workstation!

So you just keep being smug, wearing your smug pants. I’ll just point and laugh when your editor goes all sentient and starts calling itself SKYNET…
Hallelujah

One of the greatest achievements of my life as a programmer is that I’ve completely avoided ever having to learn VI or Emacs.

No arcane keystroke based editors for me, please.

Real programmers use butterflies…

Would you believe I looked at QUIET twice? Highlighted it, and right clicked it to make sure it was spelled right?

Sigh. QUITE living up to my username.

If you were a real programmer you’d use sed.

I prefer vi, but mostly thats because I’ve never needed to learn emacs, since vi does everything I’ve ever asked of it.

Oblig

Of course, we all know that emacs is a nifty little OS that masquerades as an editor.

MIT Rule of Software - All programs expand until they can read mail.

Emacs neatly captures everything that’s wrong with open source software.

If I’m forced to work at a command line, I’ll use vi. Otherwise, Gedit. :wink:

a.k.a. sudo gedit for those of us on Ubuntu. :slight_smile:

Emacs, hands down.

I’ve had to use vi a couple times in the last few years. It was very painful. Here are a couple things I could never figure out how to do, that I’ve kept in mind to ask if the opportunity arises.

A) Select a section of text that starts in the middle of one line, and ends in the middle of another line, then either Copy or Cut that section, and Paste it somewhere else. I can do this either using keyboard only, or using the mouse to select the region.

B) Select a Column of data (or other characters), Cut that column, and paste it into a different location. For example, in the following Swap columns 2 and 3:



Angle   Item1  Item2
  1     2    3
  2     4    2
  3     5    6
[...397 more lines...]
401     8    9


to get



Angle   Item1  Item2
  1     3    2
  2     2    4
  3     6    5
[...397 more lines...]
401     9    8


Piece of cake in Emacs, again selecting using either keyboard only, or using the mouse to select the region. Either save me an enormous amount of frustration next time I have to use vi, or admit vi is inferior.

What is this “mouse” of which you speak?

As far as the column swap…what, ya never heard of awk? :smiley:

I suppose I could start another thread:

Green or Amber?

But that doesn’t really look like amber. :stuck_out_tongue:

I’ve heard of awk. Of course, I still don’t know how to swap the columns using awk…

I should mention that in emacs, I don’t need to know how many lines of data there are, which line is the beginning or ending line, or the beginning and ending column numbers.

maybe not the most intuitive awk solution but it wont be messed up if you miss selecting a line:

1~/^[0-9]*/ {printf("%7s %7s %7s
“, $2, $3, $1)}
{printf(”%7s %7s %7s
", $1,$2,$3)}

I use awk to run through weblogs and tell me some interesting stuff, like what’s the most popular pages, and who’s most interested:

This takes the third column (requesting IP) , sorts them in revers order, then counts the number of times each one appears in a daily log, then sorts that and saves it as the file called ‘output’:
cat ex090719.log | awk ‘{print $3}’ | sort -rn | uniq -c | sort -rn > output

likewise:
cat ex090719.log | awk ‘{print $3,",", $11,",",$12}’ | sort -rn

takes the IP address, the page requested, and the payload (everything after the ? in the addressbar) and gives you the results. It’s good for seeing if people are trying to fcuk with your webapp.