Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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/ )
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).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.