LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-11-2005, 04:32 PM   #1
logosys
Member
 
Registered: Jul 2005
Location: Texas
Distribution: RHEL4 - ES
Posts: 178

Rep: Reputation: 31
Why is vi the best?


I know there is a debate of vi vs. emacs, and I've used them both. My vi-using friends say vi is superior because it's always available, always consistant and you can work very fast in it. My emacs-using friends say emacs is the most versatile text editor available. I've used emacs quite a bit, and it's pretty good, and I've been trying to learn vi because it's pretty much the only option you've got in case of trouble.

My question is this - why is vi the best? Why do people use it above others? And how is it faster than any other text editor? I would be much obliged for your input.
 
Old 09-11-2005, 04:50 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
*gets out popcorn for the flamewar*

And of course, you left out nano and pico.
 
Old 09-11-2005, 04:58 PM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 473Reputation: 473Reputation: 473Reputation: 473Reputation: 473
It's all "horses for courses". Try them out and make your own decisions. For my needs, pico/nano are more than enough.
 
Old 09-11-2005, 05:09 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Well - even though I really like emacs, and particularly
for programming, I find myself using vi quite often as of
late. One reason is that vi is "universal", so to speak;
you'll have a hard time to find a linux-box without it.
It's also pretty darn small (and quick) in comparison,
and some of its features just do make more sense for
certain editing tasks. It's probably best to know both,
and as XavierP pointed out, use the right tool for the
right job. That said: if you're a C programmer using
emacs you DEFINITELY want to check out ELSE,
and emacs minor mode ( http://www.zip.com.au/~peterm/ )


Cheers,
Tink
 
Old 09-11-2005, 05:54 PM   #5
logosys
Member
 
Registered: Jul 2005
Location: Texas
Distribution: RHEL4 - ES
Posts: 178

Original Poster
Rep: Reputation: 31
Cool. What jobs would you say vi is particularly suited for?
 
Old 09-11-2005, 06:36 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Well ... if you want to do modifications to a file
that are not worth recording a macro (in other words,
it's not that many) for but are not easily solved with
a regex-replacment the . operator in vi is unbeatable.

It allows you to do the last action you did at the
current position of the cursor. So if you for instance
want to replace a given word at the beginning of some
lines, you go cw my_new_word<esc>, go to the next
word and press . ... a feature that kind of endeared vi
to me (I used to use emacs exclusively).


Cheers,
Tink
 
Old 09-11-2005, 07:33 PM   #7
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,455

Rep: Reputation: 201Reputation: 201Reputation: 201
The very best editor is the one you know.

That said, one should know at least one or two others in case of problems.
 
Old 09-11-2005, 07:35 PM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
I really need to become profficient with vi. I've been using linux for 7 years and getting by on pico (and now my preferred nano). Any good guides?
 
Old 09-11-2005, 07:43 PM   #9
mlangdn
Senior Member
 
Registered: Mar 2005
Location: Kentucky
Distribution: Slackware64-current
Posts: 1,455

Rep: Reputation: 201Reputation: 201Reputation: 201
This one seems pretty good. I am presently reading it.

http://www.washington.edu/computing/unix/vi.html
 
Old 09-11-2005, 07:45 PM   #10
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 125Reputation: 125
Thanks. Appreciate the link.
 
Old 09-11-2005, 07:47 PM   #11
jayemef
Member
 
Registered: Aug 2005
Location: Juniata College, PA
Distribution: Ubuntu, Slackware
Posts: 67

Rep: Reputation: 15
Re: Why is vi the best?

Quote:
Originally posted by logosys
Why do people use it above others?
I do for precisely the reasons you mentioned. It's incredibly fast to edit once you become familiar with the commands, and it can be found on almost any linux installation.

Quote:
Originally posted by logosys
And how is it faster than any other text editor?
The reason it is fast is because its commands are all based on the main keyboard keys. You never need to leave the home row when working in vi, whether to use arrow keys, a mouse, a menu, etc. Add that to the ability to make large changes with the combination of 2 to 4 keys makes navigation and editing very quick. But it's a tradeoff. It is not easy to pick up. You'll probably end up taking longer to edit initially. But once you know you're way around, it's hard to make things more efficient.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration