Question:
Why is vi an important Unix text editor?
Katy
2010-09-07 23:47:06 UTC
I'm curious as to why many computer science and MIS professionals consider vi to be a superior or more important editor when many others, like pico, emacs or even the Kate editor seem to be easier to use. Any thoughts?
Six answers:
Hiro
2010-09-07 23:48:36 UTC
Because they are old. Old people don't like change and new technology, it confuses and angers them. I like Kate but will use Pico if I really have to.
koppe74
2010-09-08 03:03:21 UTC
Well 'ed' (a line-based editor) and 'vi' (the screen-based editor) were for a long time the least common dominater when it came to editors on Unix-systems... sure they may also have had other better editors like emacs installed, but *at least* they would have 'ed' and perhaps 'vi' available if they needed to edit a file. These days -- at least for Linux -- they're being replaced with 'nano' on rescue-cds and such...



Emacs is pretty big, so way back when, it would simply take up too much room on a rescue-*floppy*... much better to use a smaller editor like 'ed' or 'vi'. Also, if you were working in single-user mode without any additional partitions mounted yet (perhaps your editing fstab and /usr is on seperate partition... maybe even mounted over the network), the only programs guaranteed available to you, would be those in /bin and /sbin -- no /usr/bin (ie. 'emacs') and certainly no X11... Remember many system started in single-user mode, and the administrator had explicitly bring it up fully. It was assumed that after a reboot, the administrator would have to clean-up after a crash or do other maintanace.



If you're working on a text-terminal (as one often did), then X (and thus editors like 'kate') would be out of the question anyway.



'ed' and 'vi' are utilities that were "part of" the operating-system itself (and therefor in /bin rather than /usr/bin)... 'emacs' and 'kate' are optional applications.



I would like to say a few word about the "original" editor, 'ed'... This is a purely linebased editor, where you have no arrow-keys or the likes to move up or down a line. It came from the time when one used tele-typewriters (telex-machines) -- typewriters and a roll of paper -- to log-in to a system. Here you could't move the cursor up, down, right or left; you could only type-out line after line. So 'ed' does just that -- do things like type-out lines 5 through 10 of a file.



Why is this useful today? Sometimes the terminal you work on is unknown or doesn't get identified... or maybe the list over terminal-types on your system has been broken? If that is the case, any program relying on moving the cursor -- like most editors, including 'vi' -- won't work! The only thing you can safely do, is to print-out line following line, moving only in one direction.



Originally 'vi' was actually a wrapper around another line-based editor (similar to 'ed') called 'ex'. Today we use vi-clones like 'elvis' and ViImproved ('vim'), and 'ex' and 'vi' are just links to one of those...



'vi' vs. 'emacs' is almost an religious dispute among some Unix-users -- the simple versus the the complex. Of course 'vi' is somewhat obscure and difficult to use (though so is 'emacs'), but when you first learn it, 'vi' is a *great* editor... especially for doing typical "system-admin-stuff", like editing various configuration-files. Unlike some editors, 'vi' doesn't start breaking lines and inserting lineshifts everywhere...



My advice, learn 'vi' (or 'vim') and 'ed' both!
deonejuan
2010-09-08 02:37:33 UTC
If you have mastered vi, no mouse can touch the speed of tweaking script or code.



But inasfaras linking an executable, I prefer a full-blown-out IDE such as NetBeans. There should have been a preamble section to ANSI C describing the libs and dependencies. Linking is hard work.
2017-01-21 18:51:10 UTC
vi = seen editor definite, it extremely is a text textile editor designed to paintings for the time of many diverse terminals. that's not a GUI editor. it extremely is in ordinary terms text textile based and makes use of keyboard instructions for enhancing. case in point, vi myfile will open the document named myfile interior the editor. From there, you have many, many instructions to apply: i - insert text textile o - open a line G = document status $ = end of line and much extra
2010-09-07 23:50:01 UTC
Hiro said it.



VI was the very first UNIX text editor. It is what they know.
bUsY_bandy
2010-09-07 23:56:37 UTC
forget vi !


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...