1834058 Members
2541 Online
110063 Solutions
New Discussion

Re: vi editor

 
Kiat leong Len
Occasional Contributor

vi editor

Question 1:
How can i set vi NOT to wrap the text according to window size?

Question 2:
During editing a file, i press Ctrl-x and this causes vi to jump out to shell
prompt. How can i get back to vi editor?

Thanks and warm regards.
3 REPLIES 3
user not active
Frequent Advisor

Re: vi editor

In X11 Windows, how do I get vi(1) to display as many lines as will fit into my
window after I have made the window larger than its default size?

Solution

To make vi display as many lines as your window size, you need to use the
following command after changing the size of your window:

eval `resize`

The resize command is documented in the online manual pages under resize(1).
Paul Bouchie
Occasional Advisor

Re: vi editor

Answer question:

Try typing "exit" at the prompt, this should return you to vi. (don't use the double quotes)
42
Albert E. Whale, CISSP
Honored Contributor

Re: vi editor

I like using the nobeautify command.

You can set this up automatically via the EXINIT command.

Try this in your .profile

EXINIT="set noflash autoindent nobeautify shiftwidth=4"
export EXINIT

For your second question, the other gentleman was correct, use the exit command or CTRL-D.

Hope that helps.
Sr. Systems Consultant @ ABS Computer Technology, Inc. http://www.abs-comptech.com/aewhale.html & http://www.ancegroup.com