-
Notifications
You must be signed in to change notification settings - Fork 112
Home
Lars Andersen expez@expez.com edited this page Jun 10, 2015
·
89 revisions
-
ad
: add declaration for current top-level form -
ai
: add import to namespace declaration, then jump back -
ar
: add require to namespace declaration, then jump back (see optional setup) -
au
: add "use" to namespace declaration, then jump back -
as
: Add interface stub(s) -
cc
: cycle surrounding collection type -
ci
: cycle betweenif
andif-not
-
cp
: cycle privacy ofdefn
s anddef
s -
dk
: destructure keys -
el
: expand let -
ef
: extract function -
fe
: create function from example stub -
il
: introduce let -
is
: inline symbol -
mf
: move one or more forms to another namespace,:refer
any functions -
ml
: move to let -
pc
: run project clean functions on the whole project -
pf
: promote function literal or fn, or fn to defn -
rf
: rename file or dir updating any affected files -
rl
: remove let, inline all variables and remove the let form -
rr
: remove unused requires -
ru
: replace use statements with equivalent require statements. -
sc
: show the changelog, to learn about recent changes -
sn
: sort the ns form.:use
,:require
and:import
clauses are sorted. -
sp
: sort project dependencies found inproject.clj
-
sr
: stop referring (removes:refer [...]
from current require, fixing references) -
tf
: wrap in thread-first (->) and fully thread -
th
: thread another expression -
tl
: wrap in thread-last (->>) and fully thread -
ua
: fully unwind a threaded expression -
uw
: unwind a threaded expression -
am
: add a missing libspec -
ap
: add a dependency to yourproject.clj
and hotload into the repl. -
cn
: Perform various cleanups on the ns form -
ef
: Extract function -
fu
: Find usages -
hd
: Hotload dependency -
rd
: Remove (debug) function invocations -
rs
: Rename symbol
These functions are available, but used so rarely they're not given a keybinding default:
-
cljr-reify-to-defercord
replace a call to reify with a call to a defrecord constructor. -
cljr-reload-configuration
Resubmit any configuration changes to the middleware. -
cljr-version
Display version information for clj-refactor and the refactor-nrepl middleware.
When you open a blank .clj
-file, clj-refactor inserts the namespace declaration for you.
It will also add the relevant :use
clauses in test files, normally using clojure.test
, but if you're depending on midje or expectations in your project.clj
it uses that instead.
Prefer to insert your own ns-declarations? Then:
(setq clj-add-ns-to-blank-clj-files nil)
With clj-refactor enabled, any keybindings for paredit-raise-sexp
is
replaced by cljr-raise-sexp
which does the same thing - except it
also removes any #
in front of function literals and sets.
To take a look at the available settings do: M-x customize-group <RET> cljr <RET>