Vim, how to scroll to bottom of a named buffer
- by Gavin Black
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