On 01/10/2011 05:22 PM, Ven Tadipatri wrote:
how do I actually *paste* the output of that on the current
line? I've tried :echo bufname("%"), which prints it on the
command line. That's not what I want.

You can use the expression register. In insert-mode, press control+R followed by "=" and type in "bufname('%')" and hit enter. It works for evaluating any expression you want. If you do it frequently, you can map it:

  :inoremap <f4> <c-r>=bufname('%')<cr>

which will allow you to press <f4> in insert-mode and get the desired text inserted.

Using the ability to insert a register's contents is pretty useful.

  :help i_CTRL-R

for more information (in this case, the tail bit about the expression-register)

-tim

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