# vi, emacs or copy con foo.exe?

**URL:** <https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762>\
**Category:** In My Humble Opinion\
**Created:** [August 17, 2009, 6:34pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762 "2009-08-17T18:34:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unintentionally\_Blank](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unintentionally_blank/32/5418_2.png) [@Unintentionally\_Blank](https://boards.straightdope.com/u/Unintentionally_Blank)\
**Post date:** [August 17, 2009, 6:34pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/1 "2009-08-17T18:34:11Z")

</div>

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? 😃

---

<div class="post-metadata">

**Author:** ![Giraffe](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/giraffe/32/129_2.png) [@Giraffe](https://boards.straightdope.com/u/Giraffe)\
**Post date:** [August 17, 2009, 6:54pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/2 "2009-08-17T18:54:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Unintentionally\_Blank](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unintentionally_blank/32/5418_2.png) [@Unintentionally\_Blank](https://boards.straightdope.com/u/Unintentionally_Blank)\
**Post date:** [August 17, 2009, 7:01pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/3 "2009-08-17T19:01:09Z")

</div>

> [@Giraffe](#):
>
> 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\>

---

<div class="post-metadata">

**Author:** ![Giraffe](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/giraffe/32/129_2.png) [@Giraffe](https://boards.straightdope.com/u/Giraffe)\
**Post date:** [August 17, 2009, 7:16pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/4 "2009-08-17T19:16:21Z")

</div>

> [@Unintentionally\_Blank](#):
>
> \<grumble\>Eight Megs And Continually Swapping\</grumble\>

😕

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

---

<div class="post-metadata">

**Author:** ![Belrix](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Belrix](https://boards.straightdope.com/u/Belrix)\
**Post date:** [August 17, 2009, 7:20pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/5 "2009-08-17T19:20:12Z")

</div>

Duh. “vi”, of course.

I thought MPSIMS was the forum for witnessing, though?

Can I get a Hallelujah?

---

<div class="post-metadata">

**Author:** ![Unintentionally\_Blank](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unintentionally_blank/32/5418_2.png) [@Unintentionally\_Blank](https://boards.straightdope.com/u/Unintentionally_Blank)\
**Post date:** [August 17, 2009, 7:30pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/6 "2009-08-17T19:30:11Z")

</div>

> [@Giraffe](#):
>
> 😕
> 
> What kind of computer are you using? Some of the newer ones these days have literally _hundreds_ of megabytes of memory in them.

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

---

<div class="post-metadata">

**Author:** ![Athena](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@Athena](https://boards.straightdope.com/u/Athena)\
**Post date:** [August 17, 2009, 7:41pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/7 "2009-08-17T19:41:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [August 17, 2009, 7:42pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/8 "2009-08-17T19:42:38Z")

</div>

Real programmers use butterflies…

---

<div class="post-metadata">

**Author:** ![Unintentionally\_Blank](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unintentionally_blank/32/5418_2.png) [@Unintentionally\_Blank](https://boards.straightdope.com/u/Unintentionally_Blank)\
**Post date:** [August 17, 2009, 7:43pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/9 "2009-08-17T19:43:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Red\_Skeezix](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@Red\_Skeezix](https://boards.straightdope.com/u/Red_Skeezix)\
**Post date:** [August 17, 2009, 7:44pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/10 "2009-08-17T19:44:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Red\_Skeezix](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@Red\_Skeezix](https://boards.straightdope.com/u/Red_Skeezix)\
**Post date:** [August 17, 2009, 7:45pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/11 "2009-08-17T19:45:55Z")

</div>

> [@Jragon](#):
>
> Real programmers use butterflies…

[Oblig](http://xkcd.com/378/)

---

<div class="post-metadata">

**Author:** ![Belrix](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Belrix](https://boards.straightdope.com/u/Belrix)\
**Post date:** [August 17, 2009, 7:51pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/12 "2009-08-17T19:51:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Telemark](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/telemark/32/372_2.png) [@Telemark](https://boards.straightdope.com/u/Telemark)\
**Post date:** [August 17, 2009, 8:14pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/13 "2009-08-17T20:14:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Capt.Ridley\_s\_Shooting\_Party](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Capt.Ridley\_s\_Shooting\_Party](https://boards.straightdope.com/u/Capt.Ridley_s_Shooting_Party)\
**Post date:** [August 17, 2009, 9:07pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/14 "2009-08-17T21:07:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KneadToKnow](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kneadtoknow/32/3999_2.png) [@KneadToKnow](https://boards.straightdope.com/u/KneadToKnow)\
**Post date:** [August 17, 2009, 9:15pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/15 "2009-08-17T21:15:37Z")

</div>

> [@Capt.Ridley\_s\_Shooting\_Party](#):
>
> 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. 😉

a.k.a. **sudo gedit** for those of us on Ubuntu. 🙂

---

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [August 17, 2009, 10:00pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/16 "2009-08-17T22:00:06Z")

</div>

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:

```auto

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

```

to get

```auto

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.

---

<div class="post-metadata">

**Author:** ![Unintentionally\_Blank](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unintentionally_blank/32/5418_2.png) [@Unintentionally\_Blank](https://boards.straightdope.com/u/Unintentionally_Blank)\
**Post date:** [August 17, 2009, 10:11pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/17 "2009-08-17T22:11:43Z")

</div>

What is this “mouse” of which you speak?

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

I suppose I could start another thread:

Green or Amber?

But that doesn’t really look like amber. 😛

---

<div class="post-metadata">

**Author:** ![ZenBeam](https://avatars.discourse-cdn.com/v4/letter/z/3ab097/32.png) [@ZenBeam](https://boards.straightdope.com/u/ZenBeam)\
**Post date:** [August 17, 2009, 10:27pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/18 "2009-08-17T22:27:33Z")

</div>

> [@Unintentionally\_Blank](#):
>
> As far as the column swap…what, ya never heard of awk? 😃

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.

---

<div class="post-metadata">

**Author:** ![Red\_Skeezix](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@Red\_Skeezix](https://boards.straightdope.com/u/Red_Skeezix)\
**Post date:** [August 17, 2009, 11:00pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/19 "2009-08-17T23:00:17Z")

</div>

> [@ZenBeam](#):
>
> I’ve _heard_ of awk. Of course, I still don’t know how to swap the columns _using_ awk…

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)}

---

<div class="post-metadata">

**Author:** ![Unintentionally\_Blank](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/unintentionally_blank/32/5418_2.png) [@Unintentionally\_Blank](https://boards.straightdope.com/u/Unintentionally_Blank)\
**Post date:** [August 17, 2009, 11:17pm UTC](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762/20 "2009-08-17T23:17:20Z")

</div>

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.

[Next page](https://boards.straightdope.com/t/vi-emacs-or-copy-con-foo-exe/506762.md?page=2)
