[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "man" command made easy?



D-Man uttered:
> 
> [I haven't been following most of this thread, but]
> 
> On Mon, Jul 16, 2001 at 10:59:23AM -0700, Paul Mackinney wrote:
> | Night before last I ran 'find /usr/doc -name "index.html" >foo.txt' and
> | then spent 2 hours adding links from foo.txt to my local home/start
> 
> 2 hours!?  Wow.  Learn vi(m) or some other advanced editor.  If you
> have that foo.txt with each filename on its own line the following
> will take very little time to create a web page of links out of it.
> 
Vim is indeed my editor of choice. The 2 hours was mostly because I got 
distracted reading & checking out the stuff I found. But my edits 
weren't nearly as slick as what you suggest.

Thanks to a conversation at a BAD (Bay Area Debian) meeting last week, I
was clued in to visual mode. Here's what I did:
1. At the first line, type 'v' to enter visual mode.
2. Scroll to the last line, type ':'
3. Vim starts the command text for you. Append
s/^/<a href="file:\/\//g <enter>

4. Repeat the command, this time appending
s/$/\"> DESCR <\/a>/g

This turned a line like 
/usr/share/doc/apache/manual/mod/index.html

into
<a href="file:///usr/share/doc/apache/manual/mod/index.html"> DESCR </a>

But your technique for capturing the original line & using it for the 
link description is very cool & will save me much effort for my updates.

Thanks!

Paul



Reply to: