Hello,
I use vim on VMS. In VMS, "logical names" are often used to create
symbolic names for directory paths. For example, if the logical name
MY_SOURCES
translates to
PATH:[TO.MY.SOURCES]
(think of this as /path/to/my/sources/), then I can identify the
following file
PATH:[TO.MY.SOURCES]ABC.C
as
MY_SOURCES:ABC.C
Now, a logical name can have several translations, e.g. MY_SOURCES may
translate to the following list:
PATH:[TO.MY.SOURCES]
PATH:[TO.MY.HEADERS]
PATH:[TO.MY.SCRIPTS]
This way, the following two files:
PATH:[TO.MY.SOURCES]ABC.C
PATH:[TO.MY.SCRIPTS]SETUP.COM
can be referred to as
MY_SOURCES:ABC.C
MY_SOURCES:SETUP.COM
This is similar to the use of the Unix $PATH variable - all the paths
in the list are searched, and the first found is used.
Now, suppose I have (in vim)
:set path?
path=.,MY_SOURCES:
When I do
:find SETUP.COM
the file is found in MY_SOURCES:, and correctly opened with the
filename MY_SOURCES:SETUP.COM.
Now I would like to open files with their physical paths, i.e. as PATH:
[TO.MY.SCRIPTS]SETUP.COM.
Basically, I am looking for a way (an autocmd, perhaps) to change the
path to the file being opened - before it is opened. I can determine
the physical path by an external (system) command. Suppose there is a
call "translate-path" and
translate-path MY_SOURCES:SETUP.COM
returns the string
PATH:[TO.MY.SCRIPTS]SETUP.COM
I tried something like this:
autocmd BufReadPre *.* execute "e " . system("translate-path " .
expand("%"))
but I got
E201: *ReadPre autocommands must not change current buffer
Do you see a way of doing this?
Thanks,
Sam
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---