Two vi questions.

Blair P. Houghton bph at buengc.BU.EDU
Sun Sep 10 08:36:16 AEST 1989


In article <614 at jvncf.UUCP> saroff at jvncf.csc.org.UUCP (Steve Saroff lac00001) writes:
>I have two questions.
>
>1) Can you tell me why when I try to read in a file with the
>":r" command, it barfs for long path names?

Most vi's do globbing (filename expansion) internally, rather than
asking the system to do it.  This causes many problems, because the
do-it-yourselfers wrote a lousy globber.  I always try to use wildcards
and tildes in filenames, and get "too many filenames" as a response.
Apparently, though I've never seen it with mine, yours has a too-short
buffer for the filename.

I've always wanted to get ahold of a real vi source and fix it so
that the :r and :w commands do a system call that uses sh to do
its globbing.  Then again, for all I know it's actually passing the
ex-commands (commands that start with a colon) unglobbed to ex, and
it's ex that I need to fix.

>2) Is there any quick and dirty way of inserting a character(s) say
>at the front of lines (e.g. quick commenting out of 20 lines of code)

Quick _and_ dirty?  Well, either

I#<esc><cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.<cr>.

or

:wq<cr><ctrl-D>(pad, pad, pad, pad, pad, pad, pad, pad, thwap! flip,
page, page, page)<RTFM>.

				--Blair
				  "...and comp.editors..."



More information about the Comp.unix.questions mailing list