Notepad++ 的 Go 语言插件

是否有人尝试在 Notepad++ 中使用golang(Go 编程语言)插件?

我尝试了以下链接中发布的说明,但它对我不起作用。只是想知道它是否适用于任何人:http :
//go-lang.cat-v.org/text-editors/notepad-plus-plus/



翻阅古今
浏览 250回答 2
2回答

萧十郎

如何为 golang 安装用户定义语言 Notepad++。*编辑:26/12/2018 更新方法一:在gist github上下载golang.udl.xml,然后打开Notepad++转到工具栏菜单 => 语言 -> “定义您的语言...” -> 导入。导入 golang.udl.xml 并重启 Notepad++。方法 2 是我推荐的版本,因为它会自动突出显示 go 文件。方法二(推荐版本):转到工具栏菜单 => 设置 ->“样式配置器...”。在“语言:”框中选择“C”在“样式: ”框中选择“指令字”在“用户定义的关键字”框中,复制粘贴下面的关键字。var func append utf8 nil cap close closed copy image len make new panic print println range real recover select chan defer go interface map range true false然后在“ Style: ”框中转到“ TYPE WORD ”,将下面的关键字复制粘贴到“ User-defined-keywords ”框中。string package import type uint uintptr uint8 uint16 uint32 uint64 int8 int16 int32 int64 float32 float64 complex complex64 complex128 byte rune iota将前景色样式更改为红色。重要步骤:在“用户分机: ”框中键入“go”。并单击“保存并关闭”按钮,然后重新启动 Notepad++。"English is not my mother tongue; please excuse any errors on my part."之所以选择方法二而不是方法一,是因为 Notepad++ 中的 UserDefinedLanguage 仍然存在错误,NPP 中的运算符和分隔符功能无法正确完成其工作。如果您不受分隔符的干扰,那么方法一非常好。

HUH函数

是的,它对我来说也不是开箱即用的。我没有 userDefineLang.xml完成 go.xml 的步骤后,下载go.xml并将其复制到 plugins\APIs。这是我额外做的:打开&nbsp;%APPDATA%/Notepad++从他们的链接下载userDefineLang-Anthony.xml保存到&nbsp;%APPDATA%/Notepad++a) 如果那里有文件 userDefineLang.xml - 打开它并将 userDefineLang-Anthony.xml 的内容粘贴为&nbsp;<NotepadPlus>b) 如果没有这样的文件 - 将 userDefineLang-Anthony.xml 重命名为 userDefineLang.xml 并编辑它 -> 取消注释<!-- <NotepadPlus> -->和<!-- </NotepadPlus> -->重启记事本++打开任何 .go 文件您应该在语言菜单中看到 - 在用户定义之后。一个“去”菜单项。我希望这有帮助。编辑:为方便起见,我添加了 userDefineLang.xml 的内容<NotepadPlus>&nbsp; &nbsp; <UserLang name="go" ext="go">&nbsp; &nbsp; &nbsp; &nbsp; <Settings>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Global caseIgnored="no" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <TreatAsSymbol comment="no" commentLine="no" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Prefix words1="no" words2="no" words3="no" words4="no" />&nbsp; &nbsp; &nbsp; &nbsp; </Settings>&nbsp; &nbsp; &nbsp; &nbsp; <KeywordLists>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Delimiters">&quot;`0&quot;`</Keywords>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Folder+"></Keywords>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Folder-"></Keywords>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Operators">( ) [ ] { } ... . , _ &amp; ^ %&nbsp; &gt; &lt; ! =</Keywords>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Comment"> 1/* 2*/ 0//</Keywords>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Words1">append bool break byte cap case chan close closed complex complex128 complex64 const continue copy default defer else fallthrough false float32 float64 for func go goto if iota imag import int int16 int32 int64 int8 interface len make map new nil package panic print println range real recover return select string struct switch true type uint uint16 uint32 uint64 uint8 uintptr var</Keywords>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Words2"></Keywords>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Words3"></Keywords>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <Keywords name="Words4"></Keywords>&nbsp; &nbsp; &nbsp; &nbsp; </KeywordLists>&nbsp; &nbsp; &nbsp; &nbsp; <Styles>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="FFFF00" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="0B243B" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="KEYWORD1" styleID="5" fgColor="AA0000" bgColor="FFFFFF" fontName="" fontStyle="1" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="KEYWORD2" styleID="6" fgColor="AA0000" bgColor="FFFFFF" fontName="" fontStyle="1" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="KEYWORD3" styleID="7" fgColor="AA0000" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="KEYWORD4" styleID="8" fgColor="A00000" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="COMMENT" styleID="1" fgColor="AAAAAA" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="COMMENT LINE" styleID="2" fgColor="AAAAAA" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="NUMBER" styleID="4" fgColor="A52A2A" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="OPERATOR" styleID="10" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="DELIMINER1" styleID="14" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="DELIMINER2" styleID="15" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <WordsStyle name="DELIMINER3" styleID="16" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />&nbsp; &nbsp; &nbsp; &nbsp; </Styles>&nbsp; &nbsp; </UserLang></NotepadPlus>如果那里有其他用户定义的语言,请小心。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go