On Oct 28, 5:13 pm, "smu johnson" <[EMAIL PROTECTED]> wrote:
> Dear Vim users,
>
> Vim is great!  .. but you already knew that.  I do have a question though.
> After many hours of frustration, I can't seem to figure out how to "paste"
> variables into the document.  The reason is why I want to do this is to make
> some macros paste the vim global data.
>
> Let's say, for example, that I wanted to macro to paste
> "loaded_vimballPlugin" in the :let variable screen.  How would I do it?
>
> :map \Z i{echo loaded_vimballPlugin} is the value!<Esc>
>
> Any thoughts?  I have honestly read through the documents... but then again,
> as my dad says, I'm a bit "stunned" when it comes to finding relevant
> information regarding something.  Thanks!
>

Usually you can just use the variable directly.

If all you want to to is _see_ the value,

:echo g:loaded_vimballPlugin

If you want to set your own variable to the value,

:let my_var = g:loaded_vimballPlugin

If you actually want to insert the value of the variable into text,
use the expression register as Tim suggests.

Note that you can manipulate the variable in the expression, like
this:

:echo "the value of loaded_vimballPlugin is
".g:loaded_vimballPlugin."!"

If the command you want to use does not take an expression (like :set
or :map) you can use the :execute command to wrap it:

:exec 'map \Z echo '.g:loaded_vimballPlugin.' is the value!'
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to