LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-21-2008, 12:34 PM   #1
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
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
 
Old 07-21-2008, 01:23 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,784

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
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.

Last edited by bigrigdriver; 07-21-2008 at 01:24 PM.
 
Old 07-21-2008, 01:42 PM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
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.
 
Old 07-21-2008, 01:57 PM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Original Poster
Rep: Reputation: 188Reputation: 188
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

-C
 
Old 07-21-2008, 02:02 PM   #5
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by custangro View Post
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

-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.
 
Old 07-21-2008, 02:33 PM   #6
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Original Poster
Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by trickykid View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"clear" and "reset" bash commands broken AviJacobson Linux - Software 1 06-29-2006 02:31 PM
"NIM thread blocked" & "Deadman Switch (DMS) close to trigger" errors sosborne Linux - Networking 1 06-28-2006 02:07 PM


All times are GMT -5. The time now is 03:58 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration