🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

4 total messages Started by Will Estes Sun, 24 Jan 1993 06:14
Need help with v -c option
#2910
Author: Will Estes
Date: Sun, 24 Jan 1993 06:14
21 lines
1182 bytes
I am having problems with vi's -c startup option.  I execute the
command:

	vi -c  "set wm=12" myfile

I was hoping that this would execute the command set wm=12 before
I started editing myfile.  What is happening instead is that the 
commands in my .exrc file execute, but the set wm=12 does not.
(Note, there is no set wm command in my .exrc file!)

What are the rules of precedence here regarding the -c startup
option and the .exrc file?  Is there some way to force a command
to execute at startup in addition to the ones found in .exrc?  I
need some way of starting vi up with a different set of startup
commands depending on my stty cols setting.

Also, while I'm here, can someone tell me how do you mark a line
in .exrc as a comment?

-- 
Will Estes		Internet: westes@netcom.com
Re: Need help with vi's -c option
#2914
Author: Will Estes
Date: Sun, 24 Jan 1993 23:38
16 lines
1002 bytes
westes@netcom.com (Will Estes) writes:
: I am having problems with vi's -c startup option.  I execute the
: command:
: 
: 	vi -c  "set wm=12" myfile
: 
: I was hoping that this would execute the command set wm=12 before
: I started editing myfile.  What is happening instead is that the 
: commands in my .exrc file execute, but the set wm=12 does not.
: (Note, there is no set wm command in my .exrc file!)

Just re-posting this with the correct title (for those who scan for
the string 'vi').  Sorry for the typo.

-- 
Will Estes		Internet: westes@netcom.com
Re: Need help with v -c option
#2917
Author: Hans Mulder
Date: Mon, 25 Jan 1993 12:25
37 lines
1686 bytes
In <1993Jan24.061447.14615@netcom.com> westes@netcom.com (Will Estes) writes:

>I am having problems with vi's -c startup option.  I execute the
>command:

>	vi -c  "set wm=12" myfile

>I was hoping that this would execute the command set wm=12 before
>I started editing myfile.  What is happening instead is that the 
>commands in my .exrc file execute, but the set wm=12 does not.

It works for me, but only if myfile exists.

>(Note, there is no set wm command in my .exrc file!)

There is one in mine.  Wm ends up being set to 12.  Apparently,
the .exrc is executed first.

>What are the rules of precedence here regarding the -c startup
>option and the .exrc file?  Is there some way to force a command
>to execute at startup in addition to the ones found in .exrc?  I
>need some way of starting vi up with a different set of startup
>commands depending on my stty cols setting.

Maybe you could make 'vi' an alias for something along the lines
of 'vi -c "set wm=$WHATEVER" /dev/null' and add a "next" to the
end of your .exrc file.

>Also, while I'm here, can someone tell me how do you mark a line
>in .exrc as a comment?

Start the line with a double quote (").

--
Hope this helps,

Hans Mulder		hansm@cs.kun.nl
Re: Need help with v -c option
#2952
Author: Philip Kizer
Date: Thu, 28 Jan 1993 04:43
23 lines
1352 bytes
Once, westes@netcom.com (Will Estes) writes:
>Also, while I'm here, can someone tell me how do you mark a line
>in .exrc as a comment?


The double quote character: '"'.  Like in this snippet from my .exrc:

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Insert nroff macro commands before the current para to do full justification.
" Leaves cursor in replace mode to change number of columns.
map \p j{wO.ad b
.ll 80
.pl 1kR
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Pipe the current document through ispell.
" Current documant must already be named. Forces a write of the file.
map \s :w!
:!ispell %

:e %


-pc

____________________________________________________________ Philip Kizer ___
Texas A&M Unix Workstation Group ( 409 862-4120 )            pckizer@tamu.edu
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads