+++ /dev/null
-Move Caret to Word End
-~~~~~~~~~~~~~~~~~~~~~~
-
-Moves all carets to the closes word end.
-
-Action:
-* Move Caret to Next Word End
-* Move Caret to Previous Word End
-
-Shortcut:
-* Ctrl+NumPad 6 -- Move Caret to Next Word End
-* Ctrl+NumPad 4 -- Move Caret to Previous Word End
--- /dev/null
+# Move Caret to Word End
+
+Moves all carets to the closes word end.
+
+Action:
+
+* `Move Caret to Next Word End`
+* `Move Caret to Previous Word End`
+
+Shortcut:
+
+* <kbd>Ctrl</kbd>+<kbd>NumPad 6</kbd> -- Move Caret to Next Word End
+* <kbd>Ctrl</kbd>+<kbd>NumPad 4</kbd> -- Move Caret to Previous Word End
+
+When moving word-by-word, the IDE's builtin algorithm stops on word starts. Often you can reach the word end only by
+moving one word further then moving a couple of characters back. But this may not be an option when using multiple
+carets and there are different amounts of separators between the words.
--- /dev/null
+Version 0.0 -- April 2016
+~~~~~~~~~~~~~~~~~~~~~~~~~
+Initial release.
--- /dev/null
+# PrettyPrint JSON
+
+Formats the current selection as prettified JSON.
+
+Action:
+
+* `PrettyPrint JSON`
+
+Shortcut:
+
+* <kbd>Alt</kbd>+<kbd>P</kbd> -- PrettyPrint JSON
+
+Not really related to the source code, more a helper to debug AJAX communication.
--- /dev/null
+* Transform it into generic prettyprinter by handling XML, YAML and maybe Groovy.
--- /dev/null
+// plugin PrettyPrint JSON
+// version 0.0
+// release April 2016
+// author Plugin Fan
+// license GPL v 3.0
+
+// Formats the current selection as prettified JSON :
+// - Alt-P - PrettyPrint JSON
+//
+// Not really related to the source code, more a helper to debug AJAX communication.
+
+
+import com.intellij.openapi.actionSystem.AnActionEvent
+import com.intellij.notification.NotificationType
+
+import groovy.json.*
+
+import static liveplugin.PluginUtil.*
+
+registerAction('PrettyPrint JSON', 'alt P') { AnActionEvent event ->
+ runDocumentWriteAction(event.project) {
+ currentEditorIn(event.project).with {
+ if (! selectionModel.hasSelection())
+ return
+
+ def text = selectionModel.getSelectedText().trim()
+ if (! text)
+ return
+
+ try {
+ text = JsonOutput.prettyPrint(text)
+ } catch (JsonException e) {
+ return show(e.message, '', NotificationType.ERROR)
+ }
+
+ document.replaceString(selectionModel.getSelectionStart(), selectionModel.getSelectionEnd(), text)
+ }
+ }
+}
+++ /dev/null
-IntelliJ IDEA LivePlugin Plugin collection
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Plugins written in Groovy <http://groovy-lang.org/> script for IntelliJ IDEA <http://jetbrains.com/idea/> based IDE's that can be enhanced through LivePlugin <https://github.com/dkandalov/live-plugin> plugin connector.
-
-* Move Caret to Word End -- Moves all carets to the closes word end.
--- /dev/null
+# IntelliJ IDEA LivePlugin Plugin collection
+
+Plugins written in [Groovy](http://groovy-lang.org/) script for [IntelliJ IDEA](http://jetbrains.com/idea/) based IDE's that can be enhanced through [LivePlugin](https://github.com/dkandalov/live-plugin) plugin connector.
+
+* [Move Caret to Word End](https://osdn.jp/projects/ii-lp-script/scm/git/ii-lp-script/tree/master/Move%20Caret%20To%20Word%20End/) -- Moves all carets to the closes word end.
+* [PrettyPrint JSON](https://osdn.jp/projects/ii-lp-script/scm/git/ii-lp-script/tree/master/PrettyPrint%20JSON/) -- Formats the current selection as prettified JSON.