Setting properties for vi during run time.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Setting properties for vi during run time.
# 1  
Old 08-12-2008
Setting properties for vi during run time.

hi
I want to view the line numbers in /bin/rvi when i open a file to edit in a script.
The default properites of vi editor are not set to view line numbers and not allowed to change them.
So instead of doing :set nu everytime editor opens the file, how it can be set
temporarily when script is run to view line numbers and line breaks.

Please suggest.

Thanks in advance,
Ashish
# 2  
Old 08-12-2008
you can set with the help of .vimrc.

- nilesh
# 3  
Old 08-12-2008
Use the ~/.exrc file

You can set this up in your vi initialization file. Just add the line:
set number
to that file. Line numbers will be added just like you entered :set number from within vi.
# 4  
Old 08-12-2008
You can try to make an editor start-up file, .exrc and put the command to enter number lines in it!
On the other hand, the 'r' in rvi means that this is a 'restrictive' vi and you may not be able to make the changes that you want. Can you run vi, vim or gvim?

Last edited by Quintab; 08-12-2008 at 03:43 PM..
# 5  
Old 08-14-2008
Thanks for help.

but it will set line numbers everytime i use vi to open file. I just want to set line numbers when vi is run from my script.

Is there any way that i can specify which configuration for vi to be used.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading properties from file and setting variable values

I want to read properties from a file and print evaluated values of each key. I am using AIX6.1. myfile.props protocol=http siteA.host=siteAhostname pageA=pageNameA siteAURL1=${protocol}:/${siteA.host}/pagea/blabla?v1=32 siteAURL2=${protocol}:/${siteA.host}/${pageA}/blabla?v1=32... (5 Replies)
Discussion started by: kchinnam
5 Replies

2. Solaris

Time setting on Solaris 10

Hi all, Any idea please how to: -Change Time format from 24h format to 12h format (AM and PM) -Turn off DST: Daylight Save Time on a Solaris10 server Thanks in advance (1 Reply)
Discussion started by: rafikrafik09
1 Replies

3. Shell Programming and Scripting

Exit shell after setting executable to run?

Hi, I have an executable file that has a rather long and tedious process to complete. How would I launch the executable using the shell, and then exit the shell while leaving the executable to run in the background? (1 Reply)
Discussion started by: pcwiz
1 Replies

4. UNIX for Dummies Questions & Answers

Setting time from application

Hello all, I wish to set the time and date of the system from my application. (I write code in C ). How can it be done? I found the function stime() - but it gets time in seconds as a parameter, and I don't know how to convert my time & date to seconds since EPOCH. What's the best... (0 Replies)
Discussion started by: klafte
0 Replies

5. Solaris

Setting up SSH - first time

Good day to you all. I have a server (running on SunOS 5.8) that i always got into via telnet. I have eventually decided to block telnet access to it and instead look toward using SSH. The problem is, whne i establish the SSH connection via PuTTy, i get the "Log in as" prompt, but upon... (5 Replies)
Discussion started by: de049
5 Replies

6. UNIX for Dummies Questions & Answers

need help setting time!

I am trying to change the time on a Sun Solaris System, but I am having some difficulties. I thought by accessing the clock icon in the CDE would allow me to change the time. Also when I clicked the help icon I still could not fine any information. (1 Reply)
Discussion started by: wmosley2
1 Replies

7. UNIX for Dummies Questions & Answers

Setting Directory Time

How would I modify the time of a directory? The touch command appears to only work on files and I searched through the threads looking for an example on dealing with directories. I have a directory that has a recent date, but none of the files within the directory are recent. I'd like to set... (2 Replies)
Discussion started by: jgordon
2 Replies

8. UNIX for Dummies Questions & Answers

Time zone setting

Tru64 (4.0D) How to change the time zone setting for the system? Sanjay (5 Replies)
Discussion started by: sanjay_g
5 Replies

9. UNIX for Dummies Questions & Answers

setting session time

Please lemme know how & where to set the session time for ftp connection in Wu-ftp . Regards Gambhi. (5 Replies)
Discussion started by: gambhi_s
5 Replies

10. UNIX for Dummies Questions & Answers

setting date and time

how do i set the system date and time? i know i have to be root to do it but i'm new to unix--really new--and some of this stuff seems really cryptic. thanks for any help.:confused: (2 Replies)
Discussion started by: singlefin
2 Replies
Login or Register to Ask a Question