On 2006-08-14, "A.J.Mechelynck" <[EMAIL PROTECTED]> wrote: > Gary Johnson wrote: > [...] > > I've also come up with a solution for part of the problem, that of > > Vim's insistence on converting a name like > > > > /project/xyz/system/src/bar.c@@/main/42 > > > > (through chdir() and getcwd()) to a name like > > > > /view/garyjohn_main@@/project/xyz/system/main/5/src/main/2/bar.c/main > > > > Using the following autocommand seems to fix that by restoring the > > original file name. I thought I had tried this solution before and > > it didn't work, but it seems to work now, so I must have had > > something set differently before. > > > > au VimEnter /view/*@@/* silent windo > > \ exe 'file' system('cleartool des -short -cview > > "'.expand("%").'"') > > > > The windo command covers the case where vim was invoked as vimdiff > > to compare two ClearCase versions. > > > > Thanks again, > > Gary > > > > VimEnter doesn't cover the case when you ":edit" or ":view" (etc.) the > file after starting Vim. Maybe: > > :au BufReadPost /view/*@@/* silent exe 'file' system(...etc...)
Thanks, Tony. That makes sense, but so far I haven't needed to address that case. If I :edit or :view a version-extended path name, e.g., :e /project/abc/def/src/foo.c/@@main/73 Vim does not try to rename it to the /view/garyjohn_main@@/project/... form. I don't understand why, but it seems to do that only when the file name is given on the command line. So for the time being, I've just added your suggestion as a comment above the VimEnter autocommand in my ClearCase plugin in case the VimEnter solution does turn out to be insufficient. Thanks, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA