home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 15920 < prev    next >
Encoding:
Text File  |  1993-01-25  |  3.5 KB  |  68 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!gatech!destroyer!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!atlantis!aaron
  3. From: aaron@atlantis.uucp
  4. Subject: Re: So what _is_ so good about vi?
  5. Message-ID: <1993Jan25.162528.11448@atlantis.uucp>
  6. Organization: Atlantis Communications, Edmonton, AB, Canada
  7. X-Newsreader: TIN [version 1.1 PL8]
  8. References: <1993Jan18.223845.10225@ucsu.Colorado.EDU>
  9. Date: Mon, 25 Jan 1993 16:25:28 GMT
  10. Lines: 56
  11.  
  12. Wayne Radinsky (radinsky@spot.Colorado.EDU) wrote:
  13. : nudd@zikzak.apana.org.au (Nai Ying Kwok) writes:
  14. : > Hey all, I am totally confused.  Can someone explain to me why vi is so
  15. : > good?  Why does every unix system use it?  Does it have superior
  16. : > features/more powerful editing etc compared to other editors?  I myself
  17. : > find it a rather unintuitive piece of work really, and as an occassional
  18. : > unix user only, it always takes me ages to come to terms with it everytime
  19. : > I get back to using unix...
  20.  
  21. [Things sacrificed to the bandwidth demons]
  22.  
  23. : Fourth, vi is not totally counter-intuitive. i means insert, c means change,
  24. : d means delete, y means yank, p means put, a means add (after the cursor), u
  25. : means  undo,   r means replace...  sometimes  capitalizing  a  letter  means
  26. : something similar:  a means add, A means add at the end of the line, r means
  27. : replace a character,  R means typeover (replace many characters), o (meaning
  28. : "open")  lets you insert text  after the current line,  while O opens a line
  29. : above the current line.  (similarly, / means search-forward, while ?  (which
  30. : is the same key shifted) means search backward).
  31.  
  32. : w means word,  b means back (back one word),  G means goto,  a space means a
  33. : character.  Some, alas, are not-so-intuitive: ^ means beginning of a line, $
  34. : means the end of a line,   doubling  the comand letter means the whole line:
  35.  
  36. : PS Anyone know why "s" is used as an equivalent for "c "?
  37.  
  38. Of course, often vi commands are intuitive in the sense that Sign Language is
  39. intuitive--if you're shown a symbol and told what it means, then it's obvious
  40. in retrospect.  But unless your mind works the same way as the people who came
  41. up with the system in the first place, working forwards can be hit-or-miss.
  42.  
  43. Of course 'i' stands for insert.  And 'a' for add text(or append, as I learned
  44. it).  But why not 't', for type?
  45.  
  46. Is it intuitive that 'r' means "replace a single letter, and stay in command
  47. mode" while 'c' means "change specified range of text, and stay in insert
  48. mode"?  Why not the other way around?  And 's' used as a synonym for 'c'
  49. (because it means "substitute")?  Any of the above could be switched around
  50. and still seem logical.
  51.  
  52. It's not really that vi commands are intuitive, but most of them at least
  53. come with useful mnemonics.  I have yet to retain in memory any of the commands
  54. for moving intervals of text past 'w' and 'b', though.
  55.  
  56. I use vi a lot(in fact, I'm using it right now)because...well, because it's the
  57. best editor I've found so far.  As a disclaimer, I've never used emacs, but I
  58. think I might prefer vi anyway.  I don't know a lot of the "high-powered"
  59. commands--I think the most sophisticated ones I know are 'y', 'o', and 'c'.
  60. But I rarely find even my basic knowledge all that wanting.  If I do, I kermit
  61. the file home and edit it on my PC...
  62.  
  63. -- 
  64. ---Alfvaen(Still looking for "October's Baby")
  65. "Clocks don't bring tomorrow--knives don't bring good news."                       ---Bruce Cockburn
  66. Current Album--Genesis:Abacab
  67. Current Read--Sean Russell:The Initiate Brother
  68.