Operating System - HP-UX
1834089 Members
2469 Online
110063 Solutions
New Discussion

invoke vi always with line numbers

 
SOLVED
Go to solution
Klaus  Frank
Frequent Advisor

invoke vi always with line numbers

Hallo to all

where can I put an entry to always invoke vi with linenumbers.
I'm tired of :set nu

using ksh on 10.20

sure this is an easy one
Klaus
... we all can make it with a little help ...
6 REPLIES 6
Thierry Poels_1
Honored Contributor
Solution

Re: invoke vi always with line numbers

yep, is an easy one:

vi $HOME/.exrc
and add: set nu

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
A. Clay Stephenson
Acclaimed Contributor

Re: invoke vi always with line numbers

This is is duck soup.

Create a file .exrc in your home directory
and insert
:set number

If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: invoke vi always with line numbers

Hi Klaus:

You can be place your options in the environment EXINIT, or in an '.exrc' file in the current directory. You can put multiple commands in the EXINIT variable by separating
them using a vertical line (|).

Regards!

...JRF...
Victor_5
Trusted Contributor

Re: invoke vi always with line numbers

add a new line in your $HOME/.exrc:
se nu
If you don't have this file, create a new one.

You can find the detail description in "man vi".

Shawn
Wodisch
Honored Contributor

Re: invoke vi always with line numbers

Hello Klaus,

when you are already at it, add some more lines to your "$HOME/.exrc":
:set number
:set showmatch
:set showmode

and be careful to NOT insert any empty line - "vi" does not like that...

Viel Spass,
Wodisch
Santanu Bhadra
Advisor

Re: invoke vi always with line numbers

Hi all,

I found something interesting about this.

I am using "C shell" and my .exrc was not working. The reason was I had the EXINIT parameter set in my .cshrc and was taking precedence over the $HOME/.exrc setting.

Regards,
Santanu
Work hard and be realistically optimistic.