Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!mayoff From: mayoff@cs.utexas.edu (Robert Mayoff) Newsgroups: comp.editors Subject: Re: vi for power users Message-ID: <1013@tokio.cs.utexas.edu> Date: 7 Dec 90 16:48:52 GMT References: <109909@convex.convex.com> Organization: Dept of Computer Sciences, UTexas, Austin Lines: 80 In article joshi@cs.uiuc.edu (Anil Joshi) writes: >tchrist@convex.COM (Tom Christiansen) writes: > >>There are books on vi available. Go to a good technical bookstore. > >Why are there no manuals? Shouldn't there be some authoritative document >somewhere that says that this is vi? Simply go, as Tom Christiansen said, to a technical bookstore and buy almost any book on vi. Most of them, I believe, have command reference lists. Additionally, for the "official" manual, by which I mean "An Introduction to Display Editing With vi" (I think that's the title) by William Joy (author of vi), you could order the document as part of the 4.3BSD Manual Set from USENIX (an extremely useful set of manuals). I don't have the ordering info right now, but I can get it for you if you want - send me e-mail. As for emacs - the GNU Emacs manual comes in softcopy as a LaTeX document (I believe) with the GNU Emacs distribution; you can print it out on whatever equipment you have available. In addition, I think it's possible to order a printed copy from the Free Software Foundation; they'll simply print it out, put on one of those plastic spines, and mail it to you. And that WILL be a complete reference manual. >1. The join should flow till the next blank line. Not just join together >two lines. If I have the margin or some such set at say 72 cols., when I >do a join, I have to reformat the entire para by going to the >appropriate word (I have to judge this visually) and then split and then >join and so on. Since you're simply trying to reflow the paragraph, use the command !}fmt which pipes from the current line through the end of the paragraph through the text filter fmt. The default fmt margin is 72 characters; you could get (for example) 100 characters by typing !}fmt -100 > >2. I want to exclude some number of line from a file I am editing. Like This you cannot do with vi. It may be possible with emacs (I don't know). You're right; this is a very useful feature at times. >3. Once you give me the above, I should be able to find say some string >only within the excluded lines, or only within the unexcluded lines. If >it is found in the excluded lines, those lines should be unexcluded. Well, it is easy to search for a pattern within a range of lines, or only on lines which match a pattern (or do NOT match a pattern); but since we don't have excluded lines in vi... >4. Is it possible to make the marks visible? No. >5. How do I get just the name of the file I am editing right now? >Because, for example if I want to say run this file through a filter and >save the output in a file with the same name but different extension, >can I do this? You can type control-g to see the current filename (and a few other tidbits of information). If you want to run a program with the current file as input (with any modifications you have made), you can use (for example, to print the file) :w !lpr If you want to filter the entire file through a program, it's easiest to use 1G!Gfilter If you want to simply write the file to a different name, use :w newfilename >"Whatever we wish ourselves to be, we have the power to make ourselves. I wish to be taller. :-) -- /_ rob /_ Fun things to do with UNIX (#72 in a series): / cat /dev/zero > /dev/null