Morse is a graphical, interactive tool for browsing or inspecting Clojure data.
-
In-process and remote inspection execution modes
-
A two-pane browser/viewer system for viewing collections and their contents
-
A structured editor pane for entering expressions to be evaluated
-
The ability to capture nested values as defs in the user namespace
-
Datafy support
-
Full keyboard control via hotkeys
More about Morse
-
Morse User Interface guide this document
The Code Editor is a full-featured editor for writing clojure code. Code is evaluated and the results are immediately available inside the browser, out and tap tabs.
Numerous hotkeys are available for text editing.
Results of evaluation appear in the Browser pane. When navigating using the forward and back buttons, the current values will appear in the appropriate browser in this pane.
nav→ will navigate deeper into data while keeping the current browser view on the data that you’re acting upon.
Evaluating new code or navigating back to the root will cause the Browser Pane to return to the evaluation-history.
Data in the browser can be displayed in a variety of ways. The Browser View drop-down lists the current available views for the data displayed in the Browser.
Typing a valid clojure symbol name into the def as:
text box and pressing enter will def bind the data shown in the Data Viewer to that var in the user namespace.
Vars are def’d in the user
name space of the evaluating process.
This is often useful when navigating deep into data and you want to extract the data in the Data Viewer.
The Metadata Viewer displays the Metadata for the data currently displayed in the Data Viewer
The forward button (Command-Right
) navs into the data selected in the Data Viewer and the current value is moved to the Browser.
If launching Morse in-process, Morse will follow all REPL interactions. The Follow REPL checkbox controls whether this is active or not. This option is not available when Morse is used as a remote inspector.
Morse adds a tap and calls to tap will be displayed here.
The resulting values from Morse’s tap can be cleared, or loaded into the Data View with the browse
button.
nav→ allows you to supply a set of keys or a set of parenthesized forms to navigate forward in the currently selected collection without changing the relationship between the Current Browser and Data Viewer panes.
The Data Viewer will nav→
to the data, but the Browser will remain unchanged.
nav→
remains in effect while browsing the eval-history, so if you have a number of results which require the same navigational steps, this can be entered into nav→
and all browsing will utilize those steps.
When running in remote inspection mode, Morse will have only the evaluation context’s datafy definitions available to it. Therefore, Morse allows you to load a colocated file of datafy declarations into the remote process by evaluating the following in the code editor:
(nubank.morse/load-file "local-path-to-datafy-code-file")
The load-file
feature will evaluate each datafy form in the remote evaluation context. Subsequent data view items will render as defined by the loaded datafy declarations.
However, when run in-process Morse will automatically datafy java.io.Files that contain data to return the contents of those files, as described below:
Extension | Format | Library Required (Tested With) |
---|---|---|
.csv |
csv |
|
.edn |
edn |
(none) |
.properties |
Java properties |
|
.json |
json |
|
.yml, .yaml |
YAML |
Morse will open a WebView on java.io.Files whose name returns a text/ or image/ mimetype from the configured Java FileNameMap.
Command | Key | Command | Key |
---|---|---|---|
Add Cursor Above |
Option-Command-Up |
Expand Select |
Control-Shift-Command-Right |
Add Cursor Below |
Option-Command-Down |
Find |
Command-F |
Add Cursors to Line Ends |
Shift-Option-L |
Find Next |
Command-G |
Add Line Comment |
Command-K Command-c |
Find Next Selection |
Command-F3 |
Add To Next Find Match |
Command-D |
Find Previous |
Shift-Command-G |
Backspace |
Backspace |
Find Previous Selection |
Shift-Command-F3 |
Backward sexp |
Option-Left |
Find With Selection |
Command-E |
Backward sexp mark |
Shift-Option-Left |
Fold |
Option-Command-[ |
Backward Up sexp |
Option-Up |
Fold All |
Command-K Command-0 |
Barf sexp Backward |
Control-Option-Right |
Fold All Block Comments |
Command-K Command-/ |
Barf sexp Forward |
Control-Left |
Fold All Regions |
Command-K Command-8 |
Change All Occurrences |
Command-F2 |
Fold Level 1 |
Command-K Command-1 |
Copy |
Command-C |
Fold Level 2 |
Command-K Command-2 |
Copy Line Down |
Shift-Option-Down |
Fold Level 3 |
Command-K Command-3 |
Copy Line Up |
Shift-Option-Up |
Fold Level 4 |
Command-K Command-4 |
Cut |
Command-X |
Fold Level 5 |
Command-K Command-5 |
Delete |
Delete |
Fold Level 6 |
Command-K Command-6 |
Delete All Left |
Command-Backspace |
Fold Level 7 |
Command-K Command-7 |
Delete All Right |
Control-K |
Fold Recursively |
Command-K Command-[ |
Delete Line |
Shift-Command-K |
Format Document |
Shift-Option-F |
Evaluate Code |
Control-Enter |
Format Selection |
Command-K Command-F |
Command | Key | Command | Key |
---|---|---|---|
paredit-open-round |
( |
paredit-forward-slurp-sexp |
Control-Right |
paredit-open-square |
[ |
paredit-backward-slurp-sexp |
Control-Option-Left |
paredit-open-curly |
\{ |
backward-sexp-mark |
Option-Shift-Left |
paredit-forward |
Option-Right |
forward-sexp-mark |
Option-Shift-Right |
paredit-backward |
Option-Left |
paredit-split-sexp |
Option-Shift-S |
paredit-backward-up |
Option-Up |
paredit-splice-sexp |
Option-S |
paredit-forward-down |
Option-Down |
paredit-kill |
Control-K |
paredit-reindent-defun |
Option-Q |
paredit-kill-backward |
Control-Shift-K |
paredit-forward-barf-sexp |
Control-Left |
paredit-delete |
Delete |
paredit-backward-barf-sexp |
Control-Option-Right |
paredit-backspace |
Backspace |