On Tue, Jun 9, 2009 at 5:00 PM, Florian Breitwieser wrote:
> Thanks for the fast answers. I reread the :help xterm-screens. As I
> understand it, xterm|rxvt has a main and alternate screen. If your terminal
> supports it, and you want that, you can switch to the alternate screen for
> vim, so after exiting the main one is restored.

Right.

> My request is different. I want, after exiting, the main screen restored and
> vim to behave similar to cat: The previous shell commands are visible, the
> [file content visible when exiting vim] is just appended. Benefit: No
> anoying tilde lines.

That's not possible.  Vim takes control of a full xterm screen -
either the main screen or the altscreen.  When it exits, it leaves a
full screenful of data on whichever of those screens it was drawing
on.  It won't ever leave less than one screenful of data.  As a
*horrific* hack, you can trick vim into thinking that the screen is
smaller than it really is...  I would never actually do this, since I
would be in no way shocked if this breaks horribly somewhere, but...
this does what you want given some very limited testing:

  function! HopefullyDontBreakEverything()
    " Do nothing if vim is dying from a signal.
    if !v:dying
      " Remove all other windows
      only
      " Remove any ~ lines
      let &lines = min([ line("$"), &lines])
      " Remove the status line
      set laststatus=0
      " Force vim to redraw the screen
      redraw!
    endif
  endfunction

  autocmd VimLeave * call HopefullyDontBreakEverything()

but I really don't think it's a very good idea at all...

~Matt

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

Reply via email to