3

Right now I have the following line in my ~/.screenrc so I can scroll back and see the output for a screen window:

termcapinfo xterm ti@:te@

Now that I am editing in vim, I would like to use my mouse for scrolling inside vim, not in the terminal scrollback. Is there a way to disable the terminal scrollback at runtime?

The screenrc manual page mentions that termcapinfo cannot be changed once started:

You have to place these commands in one of the screenrc startup files, as they are meaningless once the terminal emulator is booted.

... so that cannot be relied on. Reasonable hacks are also fine, I am using the Konsole terminal emulator.

2

Here is a workaround specific to vim (i.e. it does not work for less for example):

Commands (:foo is a vim command, the others are shell):

mkdir /tmp/vimundo
:set undodir=/tmp/vimundo undofile
# note: `set undofile` has to be done for each tab and is saved only
# when the file itself is saved.
:mks /tmp/sess.vim
:wqa

You can put the undodir and undofile directives in your vimrc for the future so you do not have to repeat. I haven't done that yet, so to reattach my vim session and keep the undo history:

vim -S /tmp/sess.vim +set\ undodir=/tmp/vimundo\ undofile
  • I am still looking for a general approach for screen that works also for, say, git log (less pipe). – Lekensteyn Oct 11 '13 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.