On 13/04/11 15:01, Alessandro Antonello wrote:
2011/4/12 Spiros Bousbouras<[email protected]>:
On Apr 10, 7:47 pm, Tim Chase<[email protected]>  wrote:
On 04/10/2011 05:39 PM, Spiros Bousbouras wrote:

On Apr 9, 6:29 pm, Tim Chase<[email protected]>    wrote:
On 04/09/2011 12:11 PM, Spiros Bousbouras wrote:
How can you insert the output of an Ex command into the
buffer at the place where the cursor is?

1) use :redir to a register and paste the register
contents:

Strange that there isn't a simpler method built-in.


I totally agree with you. Would be much more simpler if we could wrote
something like:

:<echo 25*47

And the output was directly put in the current buffer in the cursor position.
The sequence "redir 'something'", type a command and then 'redir END' is
really to much to do when we need to be fast. To get the result of the
calculation above is much more easy just "see" the value in the command window
and write it by your hand in the buffer.

This is a feature that a miss in Vim/GVim for quite sometime.

Regards.


For this particular use case (insert the value of an expression) you can do it by means of the expression register:

in Insert mode
        ^R=25 * 47
(where ^R is a Ctrl-R keystroke), followed by Enter, or in Normal mode
        "=25 * 47↓p
where ↓ represents a press on the Enter key.

See :help quote=


Best regards,
Tony.
--
Real computer scientists don't comment their code.  The identifiers are
so long they can't afford the disk space.

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