notepad++ Configuring the Golang development environment

Source: Internet
Author: User
Tags install go
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


    1. Running notepad++ Software
    2. Open menu, select: Plugin Manager, add-ons, Show Plugin Manager
    3. Select Plug-in GONPP, click Install, do the installation
    4. 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">&quot;&apos;0&quot;&apos;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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.