--
Noah Spurrier | email:no...@noah.org | http://www.noah.org/wiki/engineering
----------------------------------------------------------------------------
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