diff --git a/README.md b/README.md index 19c5017..24ecb5c 100644 --- a/README.md +++ b/README.md @@ -7,20 +7,48 @@ Provides Emacs font-lock, indentation, and some useful functions for the Jsonnet **Table of Contents** +- [jsonnet-mode](#jsonnet-mode) - [Dependencies](#dependencies) -- [Indentation](#indentation) +- [Features](#features) + - [Indentation](#indentation) + - [Formatting](#formatting) + - [Rendering](#rendering) + - [Navigation](#navigation) - [Configuration](#configuration) -- [Known Issues](#known-issues) # Dependencies -The `jsonnet-eval` method depends on the `jsonnet` binary, which should be available on your `exec-path`. Install this on OSX with Homebrew by running `brew install jsonnet`. +The `jsonnet-eval` method depends on the `jsonnet` binary, which should be +available on your `exec-path`. Install this on OSX with Homebrew by running +`brew install jsonnet`. -# Indentation +# Features -The indentation rules are a set of rules which I put together based on my experience with Jsonnet. You can see them by looking at the implementation of `jsonnet-calculate-indent`. +## Indentation + +The indentation rules are a set of rules which I put together based on my +experience with Jsonnet. You can see them by looking at the implementation of +`jsonnet-calculate-indent`. + +## Formatting + +Closely related to indentation is formatting. By running +`jsonnet-reformat-buffer` (bound to `C-c C-r`), the `jsonnet fmt` utility will +reformat your buffer and make it pretty. + +## Rendering + +To get a snapshot of what your Jsonnet file will render to, run `jsonnet-eval` +(bound to `C-c C-e`). This will popup another window and show the result of +running `jsonnet-command` on the current buffer. + +## Navigation + +`jsonnet-mode` also provides some methods to make navigation easier. In +particular, `jsonnet-jump` (bound to `C-c C-f`) allows you to jump to the +definition of a given identifier. # Configuration @@ -28,8 +56,3 @@ There are two customizable parameters which you may configure in this mode: - `jsonnet-command` allows you to indicate which Jsonnet binary should be used to render a JSON document. - `jsonnet-enable-debug-print` will cause methods in jsonnet-mode to write messages to the status bar if enabled. - -# Known Issues - -Indentation support is not perfect. Here are a couple known problems with it: -- When the parameter list to a function is multiple lines long, we should indent 2x tab-width.