On 11/12/2011 08:57 AM, Gelonida N wrote:
On 11/12/2011 02:29 PM, AK wrote:
On 11/12/2011 08:15 AM, Gelonida N wrote:
Hi,

I know how to ge the contents of a register.

reg = vim.eval('@0') fetches for example the contents of register 0



However I did not find a way to set a register to a certain value (from
python)

What would be the command?


Thanks in advance for your help.


command('let @a = "abc"')   -ak

Thanks for your answer. I was afraid it will be something like this.

Let's assume I'd like to do something like.

reg = vim.eval('@0')
reg.replace('a','A')
vim.command('let @a = "%s"' % reg)

This will fail if reg contains funny characters.

So I think I need something like

vim.command('let @a = "%s"' % vim_escape_function(reg))


What are the rules to escape characters (or is there a
commodity function)?




Try single instead of double quotes.  -ak

--
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

Reply via email to