The Python, VIM bindings give me ways of manipulating: windows, buffers and ranges but absolutely no way of messing with registers. vim.command('let @'.='%s'' % vim.current.buffer[
Solution 1:
In python you can get the value of a vim register by vim.eval("@a") for example.
If you want to count the lines (\n) in a register you can do it either in vim or python.
E.g. in vim:
len(split(@a, '\n'))
in python
#varis the variable containing @ain vim
len(re.split("\n",var))
Share
Post a Comment
for "Python, Vim: How Do I Count The Lines In A Vim Register?"
Post a Comment for "Python, Vim: How Do I Count The Lines In A Vim Register?"