How to reformat JSON in Notepad++?

前端 未结 21 1632
清酒与你
清酒与你 2020-12-04 04:20

I need Notepad++ to take a json string from this

{\"menu\": {\"id\": \"file\",\"value\": \"File\",\"popup\": {\"menuitem\": [{\"value\": \"New\", \"onclick\"         


        
相关标签:
21条回答
  • 2020-12-04 04:48

    I know you asked about NotePad++ but TextMate for OS X can do it via the JSON bundle, its called the "Reformat Document" command.

    0 讨论(0)
  • 2020-12-04 04:50

    I'm using the JSON Viewer plug-in with NPP 5.9 and it seems to work well.

    0 讨论(0)
  • 2020-12-04 04:51

    For Notepad++ v.7.6 and above Plugins Admin... is available.

    1. Open Menu Plugins > Plugins Admin...

    2. Search JSON Viewer

    3. Check JSON Viewer in List

    4. Click on Install Button

    5. Restart Notepad++

    6. Select JSON text

    7. Go to Plugins > JSON Viewer > Format JSON ( Ctrl + Alt + Shift + M )

    We can install any Notepad++ supported plugins using Plugins Admin...

    0 讨论(0)
  • 2020-12-04 04:52

    You can view in Notepad++ no problem now (maybe older versions were bugged?)

    for win64: You can find the latest plugin here: https://github.com/kapilratnani/JSON-Viewer/releases . The latest zip file contains a .dll file.

    And then follow the github priject README instructions:

    1. Paste the file "NPPJSONViewer.dll" to Notepad++ plugin folder
    2. open a document containing a JSON string
    3. Select JSON fragment and navigate to plugins/JSON Viewer/show JSON Viewer or press "Ctrl+Alt+Shift+J"
    4. Voila!! if the JSON is valid, it will be shown in a Treeview

    It should be the same process for win32 but I cannot personally verify it.

    0 讨论(0)
  • 2020-12-04 04:54

    For those of us behind a corporate firewall with no direct access to the internet, using the Plugins Admin won't work. To use the JSMinNpp plugin, you can't just "copy the dll to the plugins folder". It needs to live inside a folder called "JSMinNpp" inside the plugins folder. After doing that and restarting Notepad++, I was able to see the "JSTool" menu option under the Plugins menu.

    Tested with Notepad++ 7.8.2 and 7.8.9.

    0 讨论(0)
  • 2020-12-04 04:56

    You require a plugin to format JSON. To install the plugin do the following steps:

    1. Open notepad++ -> ALT+P -> Plugin Manager -> Selcet JSON Viewer -> Click Install
    2. Restart notepad++
    3. Now you can use shortcut to format json as CTRL + ALT +SHIFT + M or ALT+P -> Plugin Manager -> JSON Viewer -> Format JSON

    0 讨论(0)
提交回复
热议问题