Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Latest commit

 

History

History
48 lines (34 loc) · 1.1 KB

README.md

File metadata and controls

48 lines (34 loc) · 1.1 KB

freja-jandent

Alternative formatting for the freja editor using jandent.

Prerequisites

The freja editor.

Setup

  1. Clone this repository somewhere and cd to the resulting directory
  2. Start freja with: freja ./freja-jandent/defaults.janet
  3. Control+L to load the file

Example Usage

  1. In freja's buffer window, type some code that could use some formatting, e.g.:

    (defn my-fn
    [x]
    (+ x 1))
    
  2. Enter the key sequence Control+Shift+F.

  3. Observe the formatted code:

    (defn my-fn
      [x]
      (+ x 1))
    

Explanation

In this version, Control+Shift+F invokes the function jandent-format which formats the buffer content using jandent.

jandent acts a little differently than spork/fmt, in particular it tries NOT to:

  • alter whitespace beyond the first non-whitespace character on a line
  • put a closing delimiter in the left-most column
  • change the number of lines in the file

Note that the built in key sequence for formatting using spork/fmt is overridden.