Skip to content

rundis/ltplanck

Repository files navigation

Planck LightTable plugin

Planck plugin for Light Table

1. Installation

Install using the Light Table plugin manager. Alternatively you can clone it into $LT_USER_HOME\plugins.

2. Raison d’etre

  • The main rationale is that if you find planck useful, you might also find it useful to have some editor support when doing something a bit more involved with planck.

  • It’s the fastest way to get started evaling ClojureScript for Light Table users using OS/X

  • Super fast eval

3. Preconditions

  • OS/X only

  • LIghtTable 0.8-alpha or higher is required

  • You will need to install Planck. If you are not using homebrew, you have to make sure planck is available in your path

4. Simple eval

  • Open a new editor (cmd + n)

  • ctrl+apace → Editor: Set current editor syntax → ClojureScript

  • Select an expression or position cursor inside a top-level form

  • ctrl-space → Planck: Eval selected cljs using planck

  • Results are displayed inline (no distinction between errors and ok results as of yet)

Note
The first time you eval like this a planck instance is started, subsequent evals uses the running instance
Tip

Since Light Table already have a default binding for clojurescript eval, you need to add a shortcut of your choice

  [:editor.cljs "ctrl-cmd-p" :planck.eval-one]; modify keybinding to your liking !

5. Planck projects

If you wish to do something a bit more involved with Planck, you may define a planck project. Think lein project, but a lot simpler. In the root folder of your planck projeect define a planck-project.clj

{:name "Hello Planck"
 :src ["src" "src-extra"]
 :dependencies ["lib/test-jar.jar"]}
Warning
The concept of a planck project is not an official planck thing. It might be in the future though :)

5.1. Connect manually

  • ctrl+spaceConnect: Add Connection

  • Select Planck from the list of connection options

  • Select the directory for your project

  • Whatever you added to src and dependencies in planck-project.clj will be added to the classpath for your planck session when connecting.

5.2. Connect automagically

If you invoke Planck: Eval selected cljs using planck from any cljs file below the directory containing planck-project.clj the plugin with automatically connect (start a planck repl in the background) or reuse an existing connection for the project if one already exists.

5.3. Disconnecting

If you want to start fresh (or if you updated your planck-project.clj:

  • ctrl+spaceConnect: Show connect bar

  • Click disconnect button for your project

5.4. Evaling

To eval you need to do that via a cljs file that resides somewhere in your project directory.

6. Contributing

Pull requests are most welcome. Please do not include the transpiled files (_compiled) in the PR.

7. History

  • 0.1.0 Initial release

8. License

MIT, same as Light Table. See LICENSE.md for details.