This is a creation in Article, where the information may have evolved or changed.
Briefly
notepad++ does not support the Go language for immediate use and can install the GONPP plugin for it. Before installing, you need to configure the GO environment first.
- Briefly
- Install Go Development Plugin
- Configuring syntax Highlighting
- More references
Install Go Development Plugin
- Running notepad++ Software
- Open menu, select: Plugin Manager, add-ons, Show Plugin Manager
- Select Plug-in GONPP, click Install, do the installation
- Restart notepad++
Write a simple Go code to test:
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello World!")
}
Select menu: Go run, plug-in, GONPP. At this point, the results are output in the right column or directly below.
Configuring syntax Highlighting
- Download the Go.xml and copy it to the notepad++ installation directoryplugins\APIsbelow (for example: D:\Program files\notepad++\plugins\apis).
- Download Userdefinelang.xml, include its contents in<NotepadPlus>and</NotepadPlus>between, and then save to%APPDATA%\Notepad++(for example:C:\Users\[Name]\AppData\Roaming\Notepad++)
- Restart notepad++
Reopen Hello.go, select menu: Language –> go, OK.
Here the userdefinelang.xml needs to be modified under:
<NotepadPlus>
<UserLang name="go" ext="go">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">"'0"'0</Keywords>
<Keywords name="Folder+"></Keywords>
<Keywords name="Folder-"></Keywords>
<Keywords name="Operators">( ) [ ] { } ... . , ; </Keywords>
<Keywords name="Comment">1/* 1/** 2*/ 2*/ 0//</Keywords>
<Keywords name="Words1">break default func interface select case defer go map struct chan else goto package switch const fallthrough if range type true false bool uint8 uint16 uint32 uint64 int8 int16 int32 int64 float32 float64 complex64 complex128 byte uint int float complex uintptr string struct nil var</Keywords>
<Keywords name="Words2"></Keywords>
<Keywords name="Words3"></Keywords>
<Keywords name="Words4"></Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="FFFF00" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="0B243B" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="088A85" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="A4A4A4" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="A4A4A4" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="NUMBER" styleID="4" fgColor="8A0808" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
</Styles>
</UserLang>
</NotepadPlus>
Note: This is the file that is included<NotepadPlus>and</NotepadPlus>later.
More references
- notepad++ Syntax Highlight for Go
- Go.xml
- Userdefinelang.xml