home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / editors / 2813 < prev    next >
Encoding:
Text File  |  1992-11-19  |  3.3 KB  |  79 lines

  1. Newsgroups: comp.editors
  2. Path: sparky!uunet!microsoft!hexnut!georgere
  3. From: georgere@microsoft.com (George V. Reilly)
  4. Subject: Re: Arbitrary text blocks (Was: VI??? GROSS!)
  5. Message-ID: <1992Nov19.054551.26605@microsoft.com>
  6. Date: 19 Nov 92 05:45:51 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Nov17.145011.24541@Princeton.EDU>
  9.     <1992Nov17.005252@gruc19.nor.chevron.com>
  10. Lines: 67
  11.  
  12. hjiwa@gruc19.nor.chevron.com (Jeff Wang) writes:
  13. ) bvaughan@sheps.Princeton.EDU (Barbara Vaughan) writes:
  14. ) |> Back in the days when I mostly worked with MSDOS and had a good editor
  15. ) |> that handled rectangular blocks easily, I used to use it to prepare data
  16. ) |> so I COULD read it into a spreadsheet or word processor.  For instance, if
  17. ) |> I have a file  of formatted data:
  18. ) |> 
  19. ) |> 123456789
  20. ) |> 987654321
  21. ) |> 
  22. ) |> I can use my editor to insert a column of blanks in front of each field so
  23. ) |> it can be read into a spreadsheet program:
  24. ) |> 
  25. ) |> 12 34 56 78 9
  26. ) |> 98 76 54 32 1
  27.  
  28. ) You could use :%s\(..\)\(..\)\(..\)\(..\)\(.\)/\1 \2 \3 \4 \5/
  29. ) to do that.
  30.  
  31. I use vi (or VIP, a vi emulation for GNU Emacs) all the time,
  32. and I seem to spend half my life building up complex regular
  33. expressions for searches and substitutions, but I don't find
  34. the above solution to be particularly satisfactory.  It works,
  35. certainly, and I would use it if I had nothing better, but
  36. Emacs's rectangle commands, for example, would require much
  37. less thought.
  38.  
  39. There's no way a non-programmer would come up with Jeff's
  40. solution, whereas many of them would use a block/rectangle
  41. insertion---if they knew about it.
  42.  
  43. Yes, I know vi is primarily meant to be a programmers' editor,
  44. but many non-programmers end up having to use it and hating it,
  45. despite the widespread availability of other, simpler editors.
  46.  
  47. ) |> I also found this feature useful when writing programs.  Let's say I have
  48. ) |> a section of code I decide to make conditional, so I want to indent it to
  49. ) |> make an "if.. then.." block.  I just insert a column of blanks in front of
  50. ) |> that section of code.
  51.  
  52. ) You could use :'a,'bs/^/  / to shift a block to the right.
  53.  
  54. Or mark the region and do a M-x indent-region, a solution
  55. that works in more complex cases too.
  56.  
  57. I like vi: it starts up quickly, I can move around and change
  58. text much more quickly with the vi command set than with any
  59. other editor I know, and it's my editor of choice for making
  60. quick changes to a file.  But I do all my serious editing in
  61. GNU Emacs: it has multiple buffers, multiple windows, and
  62. multiple undo; it has clever indenting (I now hate to write
  63. code with real vi); it has online manuals and other forms of
  64. help; it's customizable; it has built-in text formatting; and
  65. a pile of other features which I use infrequently, if at all.
  66. It's also big, bloated, often sluggish, and I don't like the
  67. standard keybindings (which is why I use the vi emulation).
  68.  
  69. Vi can be made to do a lot of things, but it's often damned
  70. hard work.  Why pipe a block of text out to fmt when you can
  71. press M-q to reformat it?  (Actually, I usually use a vi
  72. macro which splits the line at the 65th character.)  And I
  73. like pressing Return while typing in code and having the
  74. cursor automatically being in the right column.
  75.  
  76. Keep masochism in the bedroom where it belongs.
  77. ________________
  78. George V. Reilly   <GeorgeRe@Microsoft.Com>
  79.