Vim, how to scroll to bottom of a named buffer

Posted by Gavin Black on Stack Overflow See other posts from Stack Overflow or by Gavin Black
Published on 2010-06-05T23:18:41Z Indexed on 2010/06/05 23:22 UTC
Read the original article Hit count: 203

Filed under:
|

I have a vim-script which splits output to a new window, using the following command:

below split +view foo

I've been trying to find a way from an arbitrary buffer to scroll to the bottom of foo, or a setting to keep it defaulted to showing the bottom lines of the buffer.

I'm doing most of this inside of a python block of vim script. So I have something like:

python << endpython
import vim
import time
import thread
import sys

def myfunction(string,sleeptime,*args):
    outpWindow = vim.current.window
    while 1:
        outpWindow.buffer.append("BAR")
        #vim.command("SCROLL TO BOTTOM OF foo")
        time.sleep(sleeptime) #sleep for a specified amount of time.

vim.command('below split +view foo')
thread.start_new_thread(myfunction,("Thread No:1",2))
endpython

And need to find something to put in for vim.command("SCROLL TO BOTTOM of foo") line

© Stack Overflow or respective owner

Related posts about vim

Related posts about script