On 06/07/08 16:07, Andy Wokula wrote:
> Ben Schmidt schrieb:
>> Peng Yu wrote:
>>> Hi,
>>>
>>> $SOMEDIR/abc
>>>
>>> Suppose, I have typed something the above. Then I type ctrl-X ctrl-F
>>> to complete filename. $SOMEDIR would be expanded to the value inside
>>> it. Is it possible to keep its original form $SOMEDIR?
>> No, sorry; there isn't a built-in way.
>>
>> Ben.
>
> We can always try to hack a script (see attachment) ...
> This is only a workaround: restore the env var name when
> Insert mode finishes.  Bug reports welcome.
>

Hm. This might be a bug. I'm setting followups to the vim_dev group 
(let's hope Google Groups will let me).

Here's a summary:

In command-line completion, when the text to be completed includes an 
environment variable name, the $variable is expanded. This is normal and 
desirable.

However, in Insert-mode completion (e.g. Ctrl-X Ctrl-F) any environment 
variable name before the cursor (in the already typed text to which a 
completion is sought) is replaced by the value of the environment 
variable. This is usually not desired -- expansion is usually desired at 
runtime (when executing the script) not at edit-time (when writing it), 
even though the writer may want to take advantage of Vim's completion 
feature to (e.g.) quickly insert the desired path.

Bram, what do you think?


Best regards,
Tony.
-- 
Noncombatant, n.:
        A dead Quaker.
                -- Ambrose Bierce

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

Raspunde prin e-mail lui