Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.editors Subject: Re: vi problem Message-ID: <5714@star.cs.vu.nl> Date: 1 Mar 90 04:13:25 GMT References: <1608@bmers58.UUCP> Sender: news@cs.vu.nl Reply-To: maart@cs.vu.nl (Maarten Litmaath) Distribution: comp.editors Organization: VU Informatika, Amsterdam, the Netherlands Lines: 22 In article <1608@bmers58.UUCP>, scottp@.bnr.ca (Scott Pace) writes: )I want to pass the output of the :f command (which displays filename )and line # among other things) as an argument (or input) to a shell )script or program. [...] )The entire purpose of this is so that I can pass down the current line )number and file name to a script. I don't think there's a direct way to give the current line number as an argument to a script. :-( The file name is `%', of course. An indirect way to achieve what you want, is the following hack. Example: map q :1,.w !(echo %; wc -l) > $HOME/tmp/vi.tmp^M:^A map! ^A !echo `cat $HOME/tmp/vi.tmp`^M Of course ^X stands for control-X. Modify the `^A' map to meet your goals. -- "Belfast: a sentimental journey to the Dark Ages - Crusades & Witchburning - Europe's Lebanon - Book Now!" | maart@cs.vu.nl, uunet!mcsun!botter!maart