Scite Man Pages

lua-users home
wiki

Scite 的手册页

Linux:在 Scite 中打开所选单词的手册页。

注意:此功能现已内置于 Scite 中,或者我之前没注意到。只需突出显示一个关键字并按 F1。示例:在 C 程序中突出显示关键字 "printf" 并按 F1。手册页将出现在输出窗格中。

但是,如果您宁愿...

将手册页加载为一个彩色文档在新标签页中

此附加组件还提供了更多功能。它将搜索手册页的多个部分:选项 -S 3:3p:2:2p:4:5:6:7:8:0p:1:1p 告诉我们首先搜索程序员手册部分。在您的平台上,这些编号可能不同。更新:现在使用 c 风格语法高亮。

将函数插入 Scite 的启动脚本中的某个位置。

自定义启动脚本示例。 .SciTEUser.properties 应包含类似以下内容的行:

ext.lua.startup.script=$(SciteUserHome)/.SciTE/startup.lua
现在将以下函数(可能需要 Lua > 5.1?)插入 .SciTE/startup.lua

-- Compatibility: Lua-5.1
function man_select(sel)
    sel=string.gsub(sel, '[<> ,*()\n\t]','')
    local ext = props['FileExt']
    -- open lua manual on selected word
    if(ext=="lua") then -- todo: customize help for each file type
        os.execute("gnome-terminal -e 'lynx \"file:///usr/share/doc/lua-5.1.4/manual.html#pdf-"..sel.."\"'")
    else -- open c manual on selected word
        local tmpfile="/tmp/man_"..sel..".c"
        local cmd="man "..sel..">/dev/null&&man -S 3:3p:2:2p:4:5:6:7:8:0p:1:1p "..sel.."|col -b > "..tmpfile
        if Execute then
            Execute(cmd)
        else
            os.execute(cmd)
        end
        if(io.open(tmpfile)) then
            scite.Open(tmpfile)
            os.remove(tmpfile)
        end
    end
end

然后在 .SciTEUser.properties 中

command.name.11.*=Programmer's Manual (selected text)
command.11.*=man_select $(CurrentWord)
command.shortcut.11.*=Ctrl+Shift+M
command.subsystem.11.*=3

command.name.15.*=DevHelp (selected text)
command.15.*=devhelp --search $(CurrentWord) &
command.shortcut.15.*=Ctrl+Shift+G
command.subsystem.15.*=1

最后一个命令是可选的,但 DevHelp? 是一个便捷的参考,前提是安装了额外的 DevHelp? 文档。


RecentChanges · preferences
编辑 · 历史
最后编辑于 2010 年 11 月 9 日上午 4:16 GMT (差异)