Monday, August 31, 2009

Re: expand variable to command line

On 2009-08-31, Aarto Matti wrote:
> Hello,
>
> How to print an expanded variable into vim command line? For some
> reason I would like to map e.g. F12 to complete edit command with vim
> user files path. I would do something like:
>
> :map <F12> :edit expand($VIM)
>
> What it prints is
>
> :edit expand($VIM)
>
> and I want
>
> :edit /usr/share/vim

Just use this:

:map <F12> :edit $VIM

If you want to actually edit $VIM and not add more to the path
before executing that command, use this:

:map <F12> :edit $VIM<CR>

Regards,
Gary

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

No comments: