On Sun, November 22, 2009 9:59 pm, Tarlika Elisabeth Schmitz wrote:
> I would like to insert the output of a command at cursor position
> (either in normal or insert mode) and map the key sequence for this.
>
> before
> text1 text2
>
> after
> text1 31/12/2009 text2
>
>
> command:
> :r ! zenity --calendar
>
>
> However, the result is always inserted on a new line. Do I need to copy
> the date, delete the new line and insert the date with a second command?

In insert mode press Ctrl-R, then =
and then enter
substitute(system('zenity --calendar'), '\n', '', 'g')

This should insert that expression into your text, where the cursor
resides. Read the details at :h i_CTRL-R

regards,
Christian
-- 
:wq


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to