ad
: add declaration for current top-level formai
: add import to namespace declaration, then jump backam
*: add a missing libspecap
*: add a dependency to your project.clj
and hotload into the repl.ar
: add require to namespace declaration, then jump back (see optional setup)as
*: Add stub(s) for the interface at pointau
: add "use" to namespace declaration, then jump backcc
***: cycle surrounding collection typeci
**: cycle between if
and if-not
cn
*: Clean namespace formcp
**: cycle privacy of defn
s and def
sdk
: destructure keysec
: extract constanted
: extract defef
*: extract functionel
: expand letfe
: create function from example stubfu
*: find usageshd
*: hotload dependencyil
: introduce letis
*: inline symbolmf
: move one or more forms to another namespace, :refer
any functionsml
: move to letpc
: run project clean functions on the whole projectpf
*: promote function literal to fn, or fn to defnrf
*: rename file or dir updating any affected filesrl
*: remove let, inline all variables and remove the let formrs
*: rename symbolsc
: show the changelog, to learn about recent changessp
: sort project dependencies found in project.clj
sr
: stop referring (removes :refer [...]
from current require, fixing references)tf
**: wrap in thread-first (->) and fully threadth
**: thread another expressiontl
**: wrap in thread-last (->>) and fully threadua
**: fully unwind a threaded expressionup
: update project dependencies (lein only)uw
**: unwind a threaded expression?
: describe refactoringhh
: parent menu for hydra menushn
: hydra menu namespace related refactoringshc
: hydra menu for code refactoringshp
: hydra menu for project related refactoringsht
: hydra menu for top level form refactoringshs
: hydra menu for features related to clj-refactor itself*: These functions require an active repl connection and our middleware.
**: These functions got moved to Clojure mode but aliased here with the usual memnonics.
***: These functions got removed as an improved version was added to Clojure mode.
A cheatsheat is available here (pdf version).
These functions are available, but used so rarely they're not given a keybinding default:
cljr-reify-to-defrecord
* replace a call to reify with a call to a defrecord constructor.cljr-version
Display version information for clj-refactor and the refactor-nrepl middleware.cljr-toggle-debug-mode
When something isn't working as intended debug mode can be toggled to get some more information about what's going on.To take a look at the available settings do: M-x customize-group <RET> cljr <RET>
Common namespace shorthands are automatically required when you type them:
For instance, typing (io/)
adds [clojure.java.io :as io]
to the requires.
io
is clojure.java.io
set
is clojure.set
str
is clojure.string
walk
is clojure.walk
zip
is clojure.zip
This behavior is provided by cljr-slash
using the suggest-libspecs
nREPL middleware op, which provides completion candidates for unknown aliases in a namespace by suggesting existing aliases from the project codebase. The suggestions are aware of both the language context of the file (clj,cljs,cljc), as well as any language context specified by a surrounding reader conditional. The suggestions are augmented with user mappings from the cljr-magic-require-namespaces
described below.
The namespaces in cljr-magic-require-namespaces
act like seed values, but once you start writing your own aliases those will be used as candidates in addition to the seed values. Note that since the result of looking up an alias in the project itself is considered to be more current, cljr-magic-require-namespaces
is not consulted if the alias lookup in the project provides a hit.
You can turn magic requires off with:
(setq cljr-magic-requires nil)
or set it to :prompt
if you want to confirm before it inserts a missing libspec.
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 cljr-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.
You might also like
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4