python vim中有哪些对象

418次阅读
没有评论

python

1、Tabpage对象(:h python-tabpage)

一个Tabpage对象对应vim的一个Tabpage。

2、Window对象(:h python-window)

一个Window对象对应vim的一个Window。

3、Buffer对象(:h python-buffer)

一个Buffer对象对应vim的一个buffer,Buffer对象提供了一些属性和方法,可以很方便操作buffer。

4、vim.current对象(:h python-current)

vim.current对象提供了一些属性,可以方便的访问“当前”的vim对象

python vim 使用实例

:py print b.name            # write the buffer file name
:py b[0] = "hello!!!"       # replace the top line
:py b[:] = None             # delete the whole buffer
:py del b[:]                # delete the whole buffer
:py b[0:0] = [ "a line" ]   # add a line at the top
:py del b[2]                # delete a line (the third)
:py b.append("bottom")      # add a line at the bottom
:py n = len(b)              # number of lines
:py (row,col) = b.mark('a') # named mark
:py r = b.range(1,5)        # a sub-range of the buffer
:py b.vars["foo"] = "bar"   # assign b:foo variable
:py b.options["ff"] = "dos" # set fileformat
:py del b.options["ar"]     # same as :set autoread<

以上就是python vim中提供的对象介绍,希望对大家有所帮助。

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:wuyou2021-04-28发表,共计968字。
新手QQ群:570568346,欢迎进群讨论 Python51学习