Editor general shortcuts

Go to symbol definition

F3 will jump to the definition of the symbol where the cursor was.
This is a dynamic feature, it requires an active REPL.

Open Code Assistant / Code Completion

By default, code assistant pops up automatically when you are typing.
It is however possible to deactivate it via a preference (Clojure ▸ Editor ▸ Auto Activate code Completion). In this case, you can use the following keyboard shortcut to invoke code assistant:

Win/Linux OS X

Ctrl+Space

Ctrl+Space

Editor modes

Conventions

  • (foo |bar) represents the text (foo bar) with the cursor before the b

  • (foo |bar|) represents the text (foo bar) with the text bar selected

Switching between Strict and non-Strict modes

  • Alt+D: switch between modes

  • Esc: force the next keystroke to be passed as is to the editor buffer, without Counterclockwise interfering. After the keystroke. This can help in situations where you don’t understand why or don’t want Counterclockwise to do some unhelpful behaviour.

Default Structural Editing mode

The commands available in the default mode do not interfere with the usage of the editor: the editor will still work as a user used to a straight text editor would assume.

Auto-indentation

Enter: The editor automatically indents a new line to the right column.

Expand Selection Up

Expands selection to the enclosing form.

Win/Linux OS X Examples (repeated invocations)

Shift+Alt+Up

Shift+Cmd+Up

(foo [bar b|ar])(foo [bar |baz|])(foo [|bar baz|])(foo |[bar baz]|)(|foo [bar baz]|)

Expand Selection Left

Expand selection to the left sibling (or if no sibling form on the left, to the enclosing form).

Win/Linux OS X Examples (repeated invocations)

Shift+Alt+Left

Shift+Cmd+Left

(foo b|ar bar)(foo |bar| baz)(foo| bar| baz)(|foo bar| baz)(|foo bar baz|)|(foo bar baz)|

Expand Selection Right

Expand selection to the right sibling (or if no sibling form on the right, to the enclosing form).

Win/Linux OS X Examples (repeated invocations)

Shift+Alt+Right

Shift+Cmd+Right

(foo b|ar bar)(foo |bar| baz)(foo |bar |baz)(foo |bar baz|)(|foo bar baz)||(foo bar baz)|

Restore previous Selection

Restore selection to its state before the previous selection Up/Left/Right command.

Win/Linux OS X Examples

Shift+Alt+Down

Shift+Cmd+Down

(foo bar| baz|)Shift+Alt+Left(foo |bar baz|)Shift+Alt+Down(foo bar| baz|)

Go to beginning of top-level form

Place the cursor in front of the current or previous top-level form.

Win/Linux OS X

Ctrl+Alt+A

Command+Alt+A

Go to end of top-level form

Place the cursor behind the current or next top-level form.

Win/Linux OS X

Ctrl+Alt+E

Command+Alt+E

Select top-level form

Select the current or following top-level form

Win/Linux OS X

Ctrl+Alt+T

Command+Alt+T

Raise over parent form

Raise a form over its parent form (replace parent with current selection). Works with empty selections too.

Win/Linux/OS X Examples (repeated invocations)

Alt+R

(spy |(+ x y) z|) blah|(+ x y) z| blah but also: (spy (+ x y) |z) blah|z blah

Split

Split enclosing form or enclosing String.

Win/Linux/OS X Examples (repeated invocations)

Alt+S

(aaa |bbb)(aaa)| (bbb) but also "aaa|bbb" ⇒ `"aaa"

Join

Join two sibling forms of same type (when cursor is between the forms)

Win/Linux/OS X Examples (repeated invocations)

Alt+J

"aaa bbb"| "ccc ddd""aaa bbb|ccc ddd"`but also: `[3 4]| [5 6 7] ⇒ `[3 4

Splice

Splice a form into its parent form.

Win/Linux OS X Examples (repeated invocations)

Ctrl+S

[foo (ba|r baz) quux][foo ba|r baz quux]foo ba|r baz quux

Forward Slurp

Takes the for on the right of the current form, and moves it inside the form.

Win/Linux OS X Examples (repeated invocations)

AZERTY: Ctrl+)+S or Ctrl+)+Left QWERTY: Ctrl+0+S or Ctrl+0+Left

AZERTY: Cmd+)+S or Cmd+)+Left QWERTY: Cmd+0+S or Cmd+0+Left

(spy (+ x y) | ) blah(spy (+ x y) |blah )

Backward Slurp

Takes the form on the left of the current form, and moves it inside the form.

Win/Linux OS X Examples (repeated invocations)

AZERTY: Ctrl+(+S or Ctrl+(+Right QWERTY: Ctrl+9+S or Ctrl+9+Right

AZERTY: Cmd+(+S or Cmd+(+Right QWERTY: Cmd+9+S or Cmd+9+Right

(spy + ( x| y) ) blah(spy (+ x| y) ) blah

Backward Barf

Takes the leftmost form inside the current form, and moves it as the form preceding the current form.

Win/Linux OS X Examples (repeated invocations)

AZERTY: Ctrl+(+B or Ctrl+(+Left QWERTY: Ctrl+9+B or Ctrl+9+Left

AZERTY: Cmd+(+B or Cmd+(+Left QWERTY: Cmd+9+B or Cmd+9+Left

(spy + ( x| y) ) blah(spy + x ( | y) ) blah

Forward Barf

Takes the rightmiost form in side the current form, and moves it as the form following the current form.

Win/Linux OS X Examples (repeated invocations)

AZERTY: Ctrl+)+B or Ctrl+)+Right QWERTY: Ctrl+0+B or Ctrl+0+Right

AZERTY: Cmd+)+B or Cmd+)+Right QWERTY: Cmd+0+B or Cmd+0+Right

(spy + ( x\| y) ) blah(spy + (x|) y) blah

Toggle comments

Toggle single line comments for selected lines.

Win/Linux OS X

Ctrl+Shift+C alternatively Ctl+;

Cmd+Shift+C alternatively Cmd+;

Strict Structural Editing Mode (paredit-style)

In addition to the features of the Default Structural Editing mode, this mode does its best to prevent you from breaking the structure of your code.

Note: You’ll only feel "at home" in this mode if you know the following commands

Reindent line

Reindent the line properly

Win/Linux/OS X

Tab

Wrap

Wrap the selection (or absence of selection) with parens / square brackets / curly brackets / double quotes.

Win/Linux/OS X Examples (repeated invocations)

(

|foo|((|foo)

{

|foo|{{|foo}

[

|foo|[[|foo]

"

|foo|""|foo"

Jump next

Move the cursor after the nearest paren / square bracket / curly bracket.

Win/Linux/OS X Examples (repeated invocations)

)

(foo ([bar b|az]))(foo ([bar baz])|)

}

{:a [:b (inc |c)] :e :f}{:a [:b (inc c)] :e :f}|

]

(let [a (inc |b) c d] blah)(let [a (inc b) c d]| blah)

Create empty String literal

Inside code without selection.

Win/Linux/OS X Examples (repeated invocations)

"

foo |barfoo "|" bar

String literal auto-escape

When already inside a String literal, typing " automatically escapes it with a backslash.

Example

foo "bar |baz"\"foo "bar \"|baz"

Note that if the cursor is at the end of the String literal, just before the closing double quote, typing " will make the cursor jump outside the String literal.
You have thus to manually escape it in at this special cursor position.

Delete behaviour

Delete suppresses chars but jumps over opening and closing parens/square brackets/curly brackets if they are non-empty.+ will suppress the whole parens/brackets at once if empty and (currently) right before the closing part.

Example (repeated invocations)

foo| (bar) bazfoo|(bar) bazfoo(|bar) bazfoo(|ar) bazfoo(|r) bazfoo(|) bazfoo| baz

Baskpace behaviour

Backspace suppresses chars but jumps over closing and opening parens/square brackets/curly brackets if they are non-empty.+ Will suppress the whole parens/brackets at once if empty and (currently) right after the opening part.

Example (repeated invocations)

foo (bar)| bazfoo (bar|) bazfoo (ba|) bazfoo (b|) bazfoo (|) bazfoo | baz

Interaction with the REPL

REPL stands for "Read Eval Print Loop" an is the clojure/lisp equivalent of so called "interactive shells" of dynamic languages.

Launch new REPL

Launch a new REPL and automatically load the edited file into it.

Win/Linux OS X

Shift+Alt+X+C

Shift+Alt+X+C

Launch new REPL in debug mode

Launch a new REPL in debug mode and automatically load the edited file into it.

Win/Linux OS X

Shift+Alt+D+C

Shift+Alt+D+C

Evaluate content

Works from any editor or from the REPL, as long as there is an already open REPL.

Win/Linux OS X

Ctrl+Enter

Cmd+Enter

Macro Expand macro call

Works from any editor or from the REPL, as long as there is an already open REPL.

macroexpand-1-like:

Win/Linux/OS X Ctrl+hover over selection

macroexpand-all-like:

Win/Linux/OS X Ctrl+Shift+hover over selection

Load editor content in active REPL

Loads the editors' content into the active REPL, starting a REPL if no active REPL found.

Win/Linux OS X

Ctrl+Alt+S

Cmd+Alt+S

Switch to Editor namespace

Switches the current namespace of the active REPL to that of the current editor.

Win/Linux OS X

Ctrl+Alt+N

Cmd+Alt+N

Leiningen launcher Shortcuts

Leiningen command line

For most Leiningen projects, using the Eclipse default Clojure launcher will do what you expect, e.g. launching a new VM with an headless nREPL server, and automatically connect a REPL View to it.

Nevertheless, should you need to invoke arbitrary Leiningen commands, just type Alt+L+L.

Reset the Project Classpath computed by Eclipse

Alt+L+R resets the project classpath, using Leiningen to compute the classpath.

Update the Project Dependencies

Alt+L+U updates the project dependencies in the classpath, using Leiningen.