medit/moo/mooedit/context.cfg

47 lines
1.0 KiB
INI

# -%- strip: false -%-
[tool]
id = SwitchHeaderAndImplementation
name = Switch _Header and Implementation
langs = c, cpp, objc, chdr, gap
type = lua
options = need-file
require("medit")
extensions = {{{[".h"] = 1, [".hh"] = 1, [".hpp"] = 1, [".hxx"] = 1, [".H"] = 1},
{[".c"] = 1, [".cc"] = 1, [".cpp"] = 1, [".cxx"] = 1, [".C"] = 1, [".m"] = 1}},
{{[".gd"] = 1}, {[".gi"] = 1}}}
new = nil
for k, p in pairs(extensions) do
if p[1][doc.ext] then
new = p[2];
break
elseif p[2][doc.ext] then
new = p[1];
break
end
end
if not new then
return
end
for e in pairs(new) do
file = doc.dir .. "/" .. doc.base .. e
if lfs.attributes(file) then
medit.open(file)
return
end
end
[tool]
id=DVI_Forward_Search
langs=latex
type=exe
name=DVI Forward Search
options=need-file
output=async
kdvi --unique file:$DOC_BASE.dvi#src:$LINE$DOC &&
dcop `dcopfind -a 'kviewshell-*'` kdvi-mainwindow#1 hide &&
dcop `dcopfind -a 'kviewshell-*'` kdvi-mainwindow#1 show