JSON file



  • Can I open .json file in npp?



  • Yes. JSON is a plaintext data structure file, so you should be able to even read and edit what’s there.

    Was there really more to your question than that? Were you curious about syntax highlighting, or file association, or something else?



  • Sorry, I was on my phone at the time, so couldn’t check things in Notepad++.

    • syntax highlighting: if you open a file with the extension .json, Notepad++ will automatically apply JSON syntax highlighting to the text, so you can see the structure (for example, { : }) vs the strings ("label" or "data"). However, the builtin lexer doesn’t distinguish between left-side and right-side, so "label": "data" will use the same highlighting for both strings. If you want more complicated differentiation of the syntax highlighting, you might be able to use an enhanceanylexer.py pythonscript (sorry, my link is my scratchpad on another computer; search the forum for “enhanceanylexer”)

    • File association: go to Settings > Preferences > File Association, select web script, select .jsonand use the -> button to move .json to the right registered extensions. After exiting Notepad++, .json files should be properly associated with Notepad++, so you can double-click the file to open it in Notepad++)

    If your question really wanted more than that, please clarify.



  • @Eran-Blecher
    Notepad +++ opens any text files, and the * .json extension is a text format))
    Install the JSTool plugin for formatting * .JSON files, and it will become much more convenient to work with this format!

    Imgur


Log in to reply