On 11/11/11 18:16, Gelonida N wrote:
Hi,
I am rather new to the python scripting module of vim.
I wanted to write a small test script, which
is analyzing all text, that I yanked into named buffers. (not sure if
'named-buffer' is the correct vi term)
Small example
buf_names = 'abcd'
for buf_name in buf_names:
yank_buffer = vim.?????('a') # don't know this command
yank_buf_len = len(yank_buf) # not sure if len() would be right
print('yank buffer %s contains %d characters' %
(buf_name, yank_buf_len))
I found
vim.buffers , but this addresses the edit-buffers and not the 'yank-buffers'
Thanks a lot in advance.
To get what has just been yanked (and is in Vim register "0 ), try
yank_buffer = vim.eval('@0')
Similarly, for the contents of register "a
yank_buffer = vim_eval('@a')
See
:help python-eval
:help expr-register
:help registers
Best regards,
Tony.
--
The more we disagree, the more chance there is that at least one of us
is right.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php