🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3771

Re: vi problem

#3771
From: Maarten Litmaath
Date: Thu, 01 Mar 1990 04:13
22 lines
1351 bytes
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
Technical Details
Message-ID: <5714@star.cs.vu.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!star.cs.vu.nl!maart
References: <1608@bmers58.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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