On 2008-11-18, Noah Spurrier <[EMAIL PROTECTED]> wrote:
> Can someone suggest a way I can do the following?
> For certain filetypes I would like to have the screen cleared before
> Vim quits back to the shell prompt. For most filetypes I DO NOT want
> Vim to clear the screen. Is this getting too tricky?

There are a couple of ways to approach this, depending on what you 
mean by "clear".  If want to restore the screen to the contents it 
had prior to executing vim, that behavior is controlled, in part, by 
the 't_ti' and 't_te' options.  See

   :help terminal-options
   :help restorescreen
   :help raw-terminal-mode
   :help xterm-save-screen

You could leave the 't_ti' and 't_te' values alone for filetypes for 
which you wanted the screen restored, and clear them for filetypes 
for which you wanted to leave the screen as it was just before 
quitting vim.  To clear them, just put this line in the appropriate 
after/ftplugin files:

   set t_ti= t_te=

If by "clear" you mean really clear the screen as though you had 
executed the "clear" command just after exiting vim, you could put a 
set of autocommands like these in your ~/.vimrc:

   au VimLeave * if &ft == "filetypeA" | !clear | endif
   au VimLeave * if &ft == "filetypeB" | !clear | endif

For those to work, you may also have to put this in your .vimrc:

   set t_ti= t_te=

HTH,
Gary


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to