Editor general shortcuts
Editor modes
Conventions
-
(foo |bar)
represents the text(foo bar)
with the cursor before theb
-
(foo |bar|)
represents the text(foo bar)
with the textbar
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.
Expand Selection Up
Expands selection to the enclosing form.
Win/Linux | OS X | Examples (repeated invocations) |
---|---|---|
Shift+Alt+Up |
Shift+Cmd+Up |
|
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 |
|
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 |
|
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 |
|
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 |
|
Split
Split enclosing form or enclosing String.
Win/Linux/OS X | Examples (repeated invocations) |
---|---|
Alt+S |
|
Join
Join two sibling forms of same type (when cursor is between the forms)
Win/Linux/OS X | Examples (repeated invocations) |
---|---|
Alt+J |
|
Splice
Splice a form into its parent form.
Win/Linux | OS X | Examples (repeated invocations) |
---|---|---|
Ctrl+S |
|
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 |
|
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 |
|
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 |
|
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 |
|
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
Wrap
Wrap the selection (or absence of selection) with parens / square brackets / curly brackets / double quotes.
Win/Linux/OS X | Examples (repeated invocations) |
---|---|
( |
|
{ |
|
[ |
|
" |
|
Jump next
Move the cursor after the nearest paren / square bracket / curly bracket.
Win/Linux/OS X | Examples (repeated invocations) |
---|---|
) |
|
} |
|
] |
|
Create empty String literal
Inside code without selection.
Win/Linux/OS X | Examples (repeated invocations) |
---|---|
" |
|
String literal auto-escape
When already inside a String literal, typing " automatically escapes it with a backslash.
Example |
---|
|
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) |
---|
|
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) |
---|
|
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 |
---|
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.