I often use gf in vim to open files under cursor. Often these file paths use environment variables but when in .tcl script files vim is unable to use the environment variable.
This works for gf:
$tcl_lib/myfile.tcl
These do NOT work for gf:
$env(tcl_lib)/myfile.tcl
$::env(tcl_lib)/myfile.tcl
These are some of the things I have tried:
:set isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=,{,},(,)
:set isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=,{,},40-41
:set includeexpr=substitute(v:fname,'\$env(\([^)]\+\))','\$\1','')
Is there a way to make vim understand the syntax for environment variables in tcl scripts (specifically for the 'gf' command)?
$tcl_lib
to your'path'
? e.g.setlocal path=.,$tcl_lib,,
– Peter Rincker'isfname'
alone and just add$tcl_lib
to'path'
. If you change'isfname'
then you are correct you will need to remove or read$env(..)
like structures. – Peter Rincker