- 49 名前:名無しさん@お腹いっぱい。 mailto:sage [2011/12/16(金) 23:26:26.60 ]
- gfを拡張して、環境変数(${ENV}など)を含んだパスに対しても、gfでジャンプできるように
したいですが、下記だとうまく行きません。 どうすればいいか教えてください。 ちなみに、mapを未定義のものにすればうまく行きます。。。。 function! GoFileWithEnv() try normal gf " catch /^Vim:Interrupt$/ catch let orgfilepath = expand("<cWORD>") while (orgfilepath =~ "\\${.*}") let env = matchstr(orgfilepath,"${.\\{-\\}}") let expandedenv = expand(expand(env)) let orgfilepath = substitute(orgfilepath,env,expandedenv,"") endwhile exe "edit ".orgfilepath endtry endfunc nnoremap gf :call GoFileWithEnv()<CR>
|

|