medit/moo/mooedit/context.cfg
2007-11-27 02:08:47 -06:00

56 lines
1.3 KiB
INI

# -%- strip: false; indent-width: 2 -%-
[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
file-filter=*.tex
type=exe
name=DVI Forward Search
options=need-file
output=async
[ -f medit-env.sh ] && . medit-env.sh
doc="${LATEX_MASTER:-$DOC}"
doc_base=`basename "$doc" .tex`
if (which kdvi > /dev/null); then
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
else
xdg-open "$doc_base.dvi"
fi