Adding a user-defined language in Notepad++

前端 未结 8 1026
萌比男神i
萌比男神i 2021-01-31 13:58

I\'m trying to add the syntax plugin for the Go programming language in Notepad++.

There is a repository for such user-defined languages. I downloaded and unzip

相关标签:
8条回答
  • 2021-01-31 14:38

    Something other answers do not discuss: Some older versions of Notepad++ do not appear to work with any of these answers.

    I tried pretty much all the solutions before upgrading Notepad++ to version 6.4.2.

    xkcd 979

    Tested Notepad++ versions:

    • 5.9 - not working - tested by namey
    • 6.4.2 - working - tested by Elysian Fields
    • 6.6.9 - working - tested by namey

    For other versions your mileage may vary.

    0 讨论(0)
  • 2021-01-31 14:45

    I added pl/sql language syntax to Notepad++. The syntax /language was on the web. Here's how I got it to work ...

    1. Open the XML file using Notepad and added <?xml version="1.0" encoding="Windows-1252" ?> to the very beginning, as David had suggested. Then save it to userDefinedLang_plsql.xml
    2. Paste the file in the Notepad++ root directory.
    3. I also copied it into C:\Program Files (x86)\Notepad++\plugins\APIs\, and navigated to menu LanguagesUserdefined, but it did nothing.
    4. So, I then went to menu LanguagesDefine your language and selected pl/sql from the drop down, renamed it, and saved it in that dialog window.

    The new language then it appeared in the language dialog at the end.

    0 讨论(0)
  • 2021-01-31 14:49

    userDefineLang resides in C:\Users\username\AppData\Roaming\Notepad++\userDefineLang.xml.

    Make sure your Notepad++ is installed under "C:\Program Files(86)", and not under "C:\npp.#.#.#.bin" folder.

    And download from https://notepad-plus-plus.org/download. Or simply google "Download Notepad++".

    Check out a sample Scala language userDefineLang.xml file here: https://github.com/nfang/scala-syntax-highlighter

    0 讨论(0)
  • 2021-01-31 14:54

    New install of Notepad++ 6.4.5 on Windows 7 64 bit

    Download from Notepad++ site:

    http://docs.notepad-plus-plus.org/index.php?title=User_Defined_Language_Files#G

    Copy "go.xml" to C:\Program Files (x86)\Notepad++\plugins\APIs.

    The default install doesn't have any user-defined languages, so you can do this:

    • Copy "userDefineLang_Go.xml" to C:\Users\\AppData\Roaming\Notepad++
    • Remove the "_Go" from the file name, so it's "userDefineLang.xml"
    • Uncomment the opening and closing "NotepadPlus" tags.

    (If you already have a userDefineLang.xml then add the content from the _Go file.)

    Restart Notepad++.

    0 讨论(0)
  • 2021-01-31 14:56

    I share the solution I found for Notepad++ 6.5, because I had the same issue than the previous messages.

    1. If not done, do the install steps explained in go\misc\notepadplus\README (userDefineLang.xml,functionList.xml,APIs). When you don 't have useDefineLang.xml in Notepad++, create one using the file from go\misc\notepadplus\useDefineLang.xml, but don't forget to add the first line <?xml version="1.0" encoding="Windows-1252" ?> and uncomment NotepadPlus part to have <NotepadPlus> at the beginning and </NotepadPlus> at the end.

    2. Change in functionList.xml: <association ext=".go" id="go"/> BY <association userDefinedLangName="go" id="go"/>

    3. As I didn't have any userDefineLang.xml file by default in Notepad++, I imported this file using the menu LanguageDefine your language → *Import. Then stop/start Notepad++. Check that Go is in the Language menu at the end of the list. Open a .go file. If the color doesn't change automatically click on go in /Language menu

    All were OK after that for me (indentation, color, autocompletion, etc.).

    0 讨论(0)
  • 2021-01-31 14:58

    I had to put my userDefineLang.xml file in my AppData\Roaming folder:

    C:\Users\[user]\AppData\Roaming\Notepad++
    
    0 讨论(0)
提交回复
热议问题