Xref: utzoo comp.unix.questions:14116 comp.sys.att:6635 Path: utzoo!attcan!uunet!ncrlnk!adds!tanya From: tanya@adds.newyork.NCR.COM (Tanya Katz) Newsgroups: comp.unix.questions,comp.sys.att Subject: Vi Keywords: Vi nroff macro Message-ID: <1103@adds.newyork.NCR.COM> Date: 7 Jun 89 16:39:36 GMT Organization: Applied Digital Data Systems Lines: 41 In article <13816@dartvax.Dartmouth.EDU> Andy Behrens write: |In article <19890@adm.BRL.MIL> thoyt@ddn-wms.arpa (Thomas Hoyt) writes: |> Can Vi reformat a paragraph, justifying it properly.... | |If you put the following line in your .exrc file, you can type "V" when |the cursor is anywhere in a paragraph, and the entire paragraph will be |rejustified by being piped through "fmt". | | map V 0}!{fmt^M} | Well I liked this idea, but I usually don't like to overwrite the vi file, and wanted to just produce an nroff file from within vi. SO... here are my macros: map M :!less %.out^M^M map V :!nroff %>%.out^M^MM^M This brought up an interesting question of file name manipulation from within vi, and passed to the shell. % = the current file name, but how can I truncate it to just the prefix if it is something like: name.1 to get: name or better yet `basename name`?? Tanya ------------------------------------------------------------------------------ ### ###### ###### ##### Tanya Katz (516) 231-5400 x430 # # # # # # # # # # # # # ##### ...uunet!ncrlnk!adds!tanya ####### # # # # # tanya.katz@adds.newyork.ncr.com # # ###### ###### ##### Applied Digital Data Systems, Inc. 100 Marcus Blvd., Hauppauge, NY 11788 ------------------------------------------------------------------------------