configuring vi

configuring vi

Post by Bobby Higgin » Sat, 25 Jan 2003 10:52:35



I have been looking for an option or some configuration magic to have vi
return the window/screen from which the vi command was called to be redrawn
when you exit vi.  This is the default action on some UNIXes, but not vi.
Is there an option, argument, or configuration parameter that will have the
calling screen/window redrawn upon exit?

I have tried Solaris 2.6 and 8 on SPARC and 2.6, 7, and 8 on Intel.

Some UNIXes may be using curses to redraw the screen to show the screen
something like:

$  ls
filea    fileb    filec
$  vi  filec
$

after the vi session is exited.  Solaris and many/most other UNIX variants
will leave the contents of the file that were displayed in the vi window and
the command and messages used to exit vi.

Is there a way to go back to the original window?

 
 
 

configuring vi

Post by Harr » Sat, 25 Jan 2003 14:15:25


Quote:Bobby Higgins wrote...

>I have been looking for an option or some configuration magic to have vi
>return the window/screen from which the vi command was called to be redrawn
>when you exit vi.  This is the default action on some UNIXes, but not vi.
>Is there an option, argument, or configuration parameter that will have the
>calling screen/window redrawn upon exit?

Do you mean .... vi doesn't clear the screen after vi session ends?

If so, this question has been asked (and answered) in the newsgroups.

The following is a quote from someone's answer...

<quote

vim's documentation says:

        You can set or reset the 't_ti' and 't_te'
        options in your .vimrc.  To disable restoring:
                set t_ti= t_te=
        To enable restoring (for an xterm):
                set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8
        (Where ^[ is an <Esc>, type CTRL-V <Esc> to insert it)

A note elsewhere says that original vi doesn't have these termcap
options, and that you'll have to edit the termcap entry manually to do
that. (I'm not an expert on this; the Text-Terminal-HOWTO for Linux is a
good reference.)

quote/>

 
 
 

configuring vi

Post by Joerg Schilli » Sat, 25 Jan 2003 19:03:42




>I have been looking for an option or some configuration magic to have vi
>return the window/screen from which the vi command was called to be redrawn
>when you exit vi.  This is the default action on some UNIXes, but not vi.
>Is there an option, argument, or configuration parameter that will have the
>calling screen/window redrawn upon exit?

>I have tried Solaris 2.6 and 8 on SPARC and 2.6, 7, and 8 on Intel.

>Some UNIXes may be using curses to redraw the screen to show the screen
>something like:

>$  ls
>filea    fileb    filec
>$  vi  filec
>$

>after the vi session is exited.  Solaris and many/most other UNIX variants
>will leave the contents of the file that were displayed in the vi window and
>the command and messages used to exit vi.

>Is there a way to go back to the original window?

This is not a matter of the vi but a matter of the content of the terminfo
database. If you like to have the old content back, you need to change the
description for your terminal type in terminfo....

--



URL:  http://www.fokus.fhg.de/usr/schilling    ftp://ftp.berlios.de/pub/schily

 
 
 

configuring vi

Post by Joerg Schilli » Sat, 25 Jan 2003 19:14:14




>>I have been looking for an option or some configuration magic to have vi
>>return the window/screen from which the vi command was called to be redrawn
>>when you exit vi.  This is the default action on some UNIXes, but not vi.
>>Is there an option, argument, or configuration parameter that will have the
>>calling screen/window redrawn upon exit?
>vim's documentation says:

>        You can set or reset the 't_ti' and 't_te'
>        options in your .vimrc.  To disable restoring:
>                set t_ti= t_te=
>        To enable restoring (for an xterm):
>                set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8
>        (Where ^[ is an <Esc>, type CTRL-V <Esc> to insert it)

This would be nonsense idea because the string depends on the terminal type you
use - a typical Linux idea :-(

Quote:>A note elsewhere says that original vi doesn't have these termcap
>options, and that you'll have to edit the termcap entry manually to do
>that. (I'm not an expert on this; the Text-Terminal-HOWTO for Linux is a
>good reference.)

It's obviousouly not (see above).

The termcap description for xterm always had a definition that restores
the old xterm content and the current /etc/termcap on Solaris still has:

        Just compile ved ftp://ftp.berlios.de/pub/ved/

and check it, it has it's complete own termcap implementation.

VI on Solaris uses TERMINFO instead and depends on the terminfo content.
This content (on Solaris) has most likely been defined by AT&T and therefore
may not be what you expect :-(

--



URL:  http://www.fokus.fhg.de/usr/schilling    ftp://ftp.berlios.de/pub/schily

 
 
 

configuring vi

Post by Thomas Dicke » Sat, 25 Jan 2003 22:17:49



> Bobby Higgins wrote...

>>I have been looking for an option or some configuration magic to have vi
>>return the window/screen from which the vi command was called to be redrawn
>>when you exit vi.  This is the default action on some UNIXes, but not vi.
>>Is there an option, argument, or configuration parameter that will have the
>>calling screen/window redrawn upon exit?
> Do you mean .... vi doesn't clear the screen after vi session ends?
> If so, this question has been asked (and answered) in the newsgroups.

frequently.

Quote:> vim's documentation says:

...

Quote:> A note elsewhere says that original vi doesn't have these termcap

the note is incorrect, though (btw much of vim's documentation regarding
termcap assumes that it is preferable to hardcode stuff inside vim
rather than make the user's environment correct).

--

http://dickey.his.com
ftp://dickey.his.com