4

I'm trying to edit Clojure/ClojureScript files on Light Table with paredit, but the Plugin does not seem to work. When I open a parenthesis, it is not closed.

However the plugin is installed as shows the plugins list.

Have I missed some configuration step, or is it a bug?

(At the time of writing, I just installed the last version and have not touched the config).

Valentin Waeselynck
  • 5,950
  • 26
  • 43

2 Answers2

7

Since version 0.7.0, auto-closing parens are no longer the default, because of some issues with international keyboards apparently. It is mentioned in this closed issue, as well as in the FAQ.

What I needed to do was add this form to the User behaviors configuration:

[:app :lt.objs.settings/pair-keymap-diffs]

To do so, I followed these steps:

  1. Ctrl-Space to open Commands
  2. Type "user behaviors" and click the proposed command
  3. This open a file that you can edit to add the above snippet.
Valentin Waeselynck
  • 5,950
  • 26
  • 43
  • Note for the "international" guys: at the time of writing (version, 0.7.2) this does not enable auto-closing for `{` and `[` characters, probably because you need to press another key (like ALT or MAJ) to type them. Reconfiguring my keyboard to US layout did it for me. – Valentin Waeselynck Jan 08 '15 at 13:40
2

Plugin only creates new commands and behaviors. You should configure User keybindings (Press Ctrl+Space and type keybindings) for the plugin like:

[:editor.clj "shift-alt-s" :paredit.select.parent]
[:editor.clj "cmd-shift-," :paredit.shrink.right]
[:editor.clj "alt-s" (:paredit.select.parent "(") :smart-indent-selection :paredit.select.clear]
[:editor.clj "cmd-shift-." :paredit.shrink.left]
[:editor.clj "cmd-shift-0" :paredit.grow.right]
[:editor.clj "alt-enter" (:paredit.select.parent "(") :eval-editor-form :paredit.select.clear]
[:editor.clj "cmd-shift-s" :paredit-plus.split-sexp]
[:editor.clj "cmd-shift-9" :paredit.grow.left]
[:editor.clj "cms-shift-j" :paredit-plus.join-sexps]
[:editor.clj "shift-alt-k" :paredit-plus.kill]

But paredit does not have effect on auto-closing of parens. It is default behavior of Light Table. Check Default behaviors if it contains this line:

[:editor :lt.plugins.auto-paren/close-pair]
Aleš Roubíček
  • 5,198
  • 27
  • 29