我正在开发一些Firefox扩展,并尝试将我的vim设置为使用gf键打开模块。
包含看起来像这样: Components.utils.import("resource://grwmodules/EventProvider.jsm",作用域);
应该是modules/EventProvider.jsm
我创建了一个文件来设置环境。这是我到目前为止所知道的:
function! s:GetModuleName(name)
let l:output = a:name
if(a:name =~ "^resource://grwmodules")
let output = substitute(a:name, "resource://grwmodules", "modules", "")
endif
return l:output
endfunction
function! GetGrwFNName(name)
let l:output = s:GetModuleName(a:name)
return l:output
endfunction
set includeexpr=GetGrwFNName(v:fname)
set isf+=:
set include=Components.utils.import("resource[:/]\+.\+")添加了isf+=:行之后,:checkpath命令就可以工作了。但是当我在文件上按gf时,vim会打开一个新文件,它的名称是resource://grwmodules/EventProvider.jsm。因此,当我按下gf时,它看起来并没有使用GetGrwFNName来转换名称。
有什么想法吗?
发布于 2011-09-24 02:54:23
你必须创建一个自动命令FileReadCmd,例如netrw为http:// urls创建的内容:
:verbose au FileReadCmdHTH
https://stackoverflow.com/questions/7533294
复制相似问题