1、Tabpage对象(:h python-tabpage)
Tabpage对应vim的Tabpage。
2、Window对象(:h python-window)
Window对应vim的Window。
3、buffer对象(:h python-buffer)
buffer对应vim的buffer,bufffer对象提供了一些属性和方法,可以方便操作buffer。
4、vim.current对象(:h python-current)
vim.current对象提供了一些可以方便访问“当前”vim对象的属性
5、实例
:pyprintb.name#writethebufferfilename :pyb[0]="hello!!!"#replacethetopline :pyb[:]=None#deletethewholebuffer :pydelb[:]#deletethewholebuffer :pyb[0:0]=["aline"]#addalineatthetop :pydelb[2]#deletealine(thethird) :pyb.append("bottom")#addalineatthebottom :pyn=len(b)#numberoflines :py(row,col)=b.mark('a')#namedmark :pyr=b.range(1,5)#asub-rangeofthebuffer :pyb.vars["foo"]="bar"#assignb:foovariable :pyb.options["ff"]="dos"#setfileformat :pydelb.options["ar"]#sameas:setautoread<
以上是python vim中提供的对象介绍,希希望对大家有所帮助。更多Python学习指南:python基础教程
本教程的操作环境:windows7系统,Python 3.9.1,DELL G3电脑。