LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Disable the "clear" after you close VI (https://www.linuxquestions.org/questions/linux-general-1/disable-the-clear-after-you-close-vi-657233/)

custangro 07-21-2008 12:34 PM

Disable the "clear" after you close VI
 
Hello,

When I am in vim (on Linux), and I :wq (or anything that will exit me from the vi session) it does a "clear screen".

How do I disable this?

I've grown accustomed to vi (on Solaris) where is doesn't clear the screen when I exit (which is beneficial to be in the environment I'm in)

Thanks,

-C

bigrigdriver 07-21-2008 01:23 PM

Look in /etc/bashrc (or some file with 'bashrc' in the name) and in your home .bashrc. Specifically, look for a function that specifically clears the screen after using vim. Also look for something in your PS1 prompt that would cause a clear screen. The function would contain something like 'tput clear'.

You can find out more from the Bash Prompt HOWTO.

trickykid 07-21-2008 01:42 PM

Usually by default on some distro's there will be a clear command in the users ~/.bash_logout

This usually doesn't affect vi sessions though. But I do know some will make an alias of vi or vim to clear afterwards. Make sure you don't have an alias setup to clear after invoking vi.

Check your aliases by simply typing alias on a command prompt.

custangro 07-21-2008 01:57 PM

Solved
 
I have solved this by putting this into my ~/.vimrc file

Code:

set t_ti= t_te=
...I never thought that I would ever make VIM act more like the original VI :D

-C

trickykid 07-21-2008 02:02 PM

Quote:

Originally Posted by custangro (Post 3221832)
I have solved this by putting this into my ~/.vimrc file

Code:

set t_ti= t_te=
...I never thought that I would ever make VIM act more like the original VI :D

-C

Yeah, a lot of current distributions don't actually install the original vi, most will alias vi with vim or another clone. Like Slackware uses elvis now.

custangro 07-21-2008 02:33 PM

Quote:

Originally Posted by trickykid (Post 3221835)
Yeah, a lot of current distributions don't actually install the original vi, most will alias vi with vim or another clone. Like Slackware uses elvis now.

Which is good and bad...I like a lot of the new VIM features...but there are somethings that they "fixed" that I didn't like.

I guess this is to be expected if you run a Solaris/RHEL mixed environment...


oh well...


-C


All times are GMT -5. The time now is 11:33 AM.