Giter Site home page Giter Site logo

Comments (2)

molsonkiko avatar molsonkiko commented on May 24, 2024

You can achieve your goal as follows:

  1. Open %AppData%/Roaming/Notepad++/langs.xml in any text editor.
  2. Search for language name="json in the document. You should find an XML element that looks like this:
<Language name="json" ext="json" commentLine="" commentStart="" commentEnd="">
    <Keywords name="instre1">false null true</Keywords>
    <Keywords name="instre2">@id @context @type @value @language @container @list @set @reverse @index @base @vocab @graph</Keywords>
</Language>
  1. Delete the value inside the ext attribute of the Language tag, so that the opening tag now looks like <Language name="json" ext="" commentLine="" commentStart="" commentEnd="">. This will make it so that the normal JSON lexer is no longer associated with the json file extension.
  2. If a Language name="json5" element is already below the Language name="json" element, delete the json5 element.
  3. Paste in the following between the Language name="json" element and whatever element came after it:
<Language name="json5" ext="json5 jsonc json" commentLine="//" commentStart="/*" commentEnd="*/">
    <Keywords name="instre1">false null true</Keywords>
    <Keywords name="instre2">@id @context @type @value @language @container @list @set @reverse @index @base @vocab @graph</Keywords>
</Language>

This will cause the json5 lexer to be associated with json5, json, and jsonc file extensions.
6. Reopen Notepad++, and the changes will be applied. Note that this will not apply automatically to any files that you already had open, so you will need to manually change any files you already had open. Notepad++ remembers the lexer it was using for a previously open file, and applies that instead of the default lexer for its extension.

from notepad-plus-plus.

EtiTheSpirit avatar EtiTheSpirit commented on May 24, 2024

I guess this method does work. It will have to do as a workaround for now, thank you!

That aside - unless someone else deems it better to do so, I think I will leave this open since this post was originally made wrt the Style Configurator not having the option, but this is definitely a good solution as-is.

from notepad-plus-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.