Skip to content

Instantly share code, notes, and snippets.

@mtnygard
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtnygard/dead0c4ddfdcedd93b4e to your computer and use it in GitHub Desktop.
Save mtnygard/dead0c4ddfdcedd93b4e to your computer and use it in GitHub Desktop.
A printable table of refactor actions to help me memorize the keystrokes.
Sequence Action
ad add declaration for current top-level form
ai add import to namespace declaration, then jump back
ap add a dependency to your project depends on refactor-nrepl
ar add require to namespace declaration, then jump back (see optional setup)
au add "use" (ie require refer all) to namespace declaration, then jump back
cc cycle surrounding collection type
ci refactoring between if and if-not
cp cycle privacy of defns and defs
cs cycle between "string" -> :string -> "string"
dk destructure keys
el expand let
fu find usages depends on refactor-nrepl 0.2.0 and above
il introduce let
mf move one or more forms to another namespace, :refer any functions
ml move to let
pc run project cleaner functions on the whole project
pf promote function literal or fn, or fn to defn
rd Remove (debug) function invocations depends on refactor-nrepl
rf rename file, update ns-declaration, and then query-replace new ns in project.
rr remove unused requires
rs rename symbol depends on refactor-nrepl 0.2.0 and above
ru replace all :use in namespace with :refer :all
sn sort :use, :require and :import in the ns form
sp Sort all dependency vectors in project.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
uw unwind a threaded expression
ua fully unwind a threaded expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment