2013-03-12 19:37:37 +00:00
|
|
|
*fireplace.txt* Clojure REPL tease
|
2012-12-04 06:06:22 +00:00
|
|
|
|
|
|
|
Author: Tim Pope <http://tpo.pe/>
|
|
|
|
License: Same terms as Vim itself (see |license|)
|
|
|
|
|
|
|
|
This plugin is only available if 'compatible' is not set.
|
|
|
|
|
2013-04-16 20:59:19 +00:00
|
|
|
*fireplace*
|
2014-04-25 03:30:37 +00:00
|
|
|
While not strictly necessary, this plugin works best with the middleware
|
|
|
|
provided by <https://github.com/clojure-emacs/cider-nrepl>.
|
2012-12-04 06:06:22 +00:00
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
CONNECTING TO A REPL *fireplace-connect*
|
2012-12-04 06:06:22 +00:00
|
|
|
|
2013-03-13 22:43:01 +00:00
|
|
|
Connecting to lein repl happens automatically. If you have a different setup,
|
|
|
|
you can connect by hand.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Connect*
|
2013-02-14 05:12:45 +00:00
|
|
|
:Connect {proto}://{host}:{port} {path}
|
|
|
|
Connect to a REPL server. The path is the root of the
|
|
|
|
project that the REPL applies to.
|
2012-12-04 06:06:22 +00:00
|
|
|
|
|
|
|
:Connect Interactively prompt for the options to connect to a
|
|
|
|
REPL server.
|
|
|
|
|
|
|
|
The REPL is used for the commands below. If no REPL is found for the current
|
2014-04-29 21:33:46 +00:00
|
|
|
buffer and 'path' contains at least one jar file, java (or $JAVA_CMD) is
|
|
|
|
invoked directly, which can be quite slow depending on your setup.
|
2012-12-04 06:06:22 +00:00
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
The only adapter shipped with fireplace.vim is for nREPL. You need either
|
2014-01-07 03:41:03 +00:00
|
|
|
|if_pyth| or the python command in your PATH.
|
2012-12-04 06:06:22 +00:00
|
|
|
|
2014-01-19 22:56:32 +00:00
|
|
|
*fireplace-piggieback* *fireplace-clojurescript*
|
2014-04-24 06:13:00 +00:00
|
|
|
ClojureScript can be evaled with Piggieback if the appropriate nREPL
|
|
|
|
middleware is loaded: https://github.com/cemerick/piggieback. Be aware that
|
2014-02-08 16:09:25 +00:00
|
|
|
your ClojureScript files must be available on the classpath for this to work
|
2014-04-24 06:13:00 +00:00
|
|
|
properly, and that not all operations are supported.
|
2014-01-19 22:56:32 +00:00
|
|
|
|
|
|
|
*fireplace-:Piggieback*
|
|
|
|
:Piggieback [{env}] Create a new nREPL session and invoke
|
|
|
|
cemerick.piggieback/cljs-repl with the given or
|
|
|
|
default (Rhino) environment. This will also happen
|
|
|
|
automatically on first eval in a ClojureScript buffer
|
|
|
|
if not invoked explicitly.
|
|
|
|
|
|
|
|
:Piggieback! Terminate the most recently created piggieback
|
|
|
|
session.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
DOCUMENTATION *fireplace-documentation*
|
2012-12-04 06:06:22 +00:00
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Doc*
|
2012-12-04 06:06:22 +00:00
|
|
|
:Doc {symbol} Show the docs for the given symbol.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Javadoc*
|
2012-12-14 23:39:15 +00:00
|
|
|
:Javadoc {class} Open the java docs for the given class in a browser.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-K*
|
2012-12-04 06:06:22 +00:00
|
|
|
K Look up docs for keyword under cursor.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:FindDoc*
|
2012-12-04 06:06:22 +00:00
|
|
|
:FindDoc {arg} Wrapper around (clojure.repl/find-doc ...).
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Apropos*
|
2012-12-04 06:06:22 +00:00
|
|
|
:Apropos {arg} Wrapper around (clojure.repl/apropos ...).
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Source*
|
2012-12-04 06:06:22 +00:00
|
|
|
:Source {symbol} Show the source for the given symbol.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-[d*
|
2012-12-04 06:06:22 +00:00
|
|
|
[d Show source for keyword under cursor.
|
|
|
|
]d
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
NAVIGATING *fireplace-navigating*
|
2012-12-04 06:06:22 +00:00
|
|
|
|
|
|
|
These commands will never use a remote REPL, only a local one, as file paths
|
|
|
|
on a remote server wouldn't be very useful locally.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-[_CTRL-D*
|
2012-12-04 06:06:22 +00:00
|
|
|
[<C-D> Jump to the source of the keyword under the cursor.
|
|
|
|
]<C-D>
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-CTRL-W_CTRL-D*
|
2012-12-04 06:06:22 +00:00
|
|
|
<C-W><C-D> Jump to the source of the keyword under the cursor in
|
|
|
|
<C-W>d a split.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-gf*
|
2012-12-04 06:06:22 +00:00
|
|
|
gf Go to the file for the namespace under the cursor.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Djump*
|
2012-12-04 06:06:22 +00:00
|
|
|
:Djump {symbol} Jump to the definition for the given symbol.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Dsplit*
|
2012-12-04 06:06:22 +00:00
|
|
|
:Dsplit {symbol} Jump to the definition for the given symbol in a
|
|
|
|
split.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
EVALUATING CODE *fireplace-eval*
|
2012-12-04 06:06:22 +00:00
|
|
|
|
|
|
|
All code is evaluated in the namespace of the current file, requiring it if
|
|
|
|
necessary. If the current file sits outside the class path (project.clj, for
|
2013-01-08 03:41:04 +00:00
|
|
|
example), the user namespace is used instead. If an exception occurs, the
|
|
|
|
stack trace is loaded into the |location-list|. Use |:lopen| to view it.
|
2012-12-04 06:06:22 +00:00
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Require*
|
2012-12-04 06:06:22 +00:00
|
|
|
:Require [ns] Require :reload the given/current namespace.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Require!*
|
2012-12-04 06:06:22 +00:00
|
|
|
:Require! [ns] Require :reload-all the given/current namespace.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Eval*
|
2014-03-30 00:51:14 +00:00
|
|
|
:Eval Eval/print the outermost form for the current line.
|
2012-12-04 06:06:22 +00:00
|
|
|
|
|
|
|
:{range}Eval Eval/print the given range.
|
|
|
|
|
|
|
|
:Eval {expr} Eval/print the given expression.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Eval!*
|
2012-12-04 06:06:22 +00:00
|
|
|
:[range]Eval! Eval the given range or outermost expression and
|
|
|
|
replace it with its result.
|
|
|
|
|
|
|
|
:[range]Eval! {expr} Eval the given expression and insert it after
|
|
|
|
the given range or current line.
|
|
|
|
|
2014-04-04 03:54:20 +00:00
|
|
|
*fireplace-:RunTests*
|
|
|
|
:RunTests [ns] [...] Call clojure.test/run-tests on the given namespaces
|
|
|
|
and load the results into the quickfix list.
|
|
|
|
|
|
|
|
:RunTests! [pattern] Call clojure.test/run-all-tests with the given pattern
|
|
|
|
and load the results into the quickfix list.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-cp*
|
2012-12-04 06:06:22 +00:00
|
|
|
cp{motion} Eval/print the code indicated by {motion}.
|
|
|
|
|
2014-03-30 00:51:14 +00:00
|
|
|
cpp Eval/print the innermost form at the cursor.
|
2012-12-04 06:06:22 +00:00
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-cpr*
|
2014-04-04 04:47:46 +00:00
|
|
|
cpr :Require|RunTests
|
2012-12-08 01:15:48 +00:00
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-c!*
|
2012-12-04 06:06:22 +00:00
|
|
|
c!{motion} Eval/replace the code indicated by {motion}.
|
|
|
|
|
2013-12-26 16:16:44 +00:00
|
|
|
c!! Eval/replace the innermost form at the cursor.
|
2012-12-04 06:06:22 +00:00
|
|
|
|
2013-04-21 10:08:55 +00:00
|
|
|
*fireplace-cm*
|
|
|
|
cm{motion} Fully macroexpand the code indicated by {motion}.
|
|
|
|
|
|
|
|
*fireplace-cmm*
|
2013-12-26 16:16:44 +00:00
|
|
|
cmm Fully macroexpand the innermost form at the cursor.
|
2013-04-21 10:08:55 +00:00
|
|
|
|
|
|
|
*fireplace-c1m*
|
|
|
|
c1m{motion} Macroexpand the code indicated by {motion} once.
|
|
|
|
|
|
|
|
*fireplace-c1mm*
|
2013-12-26 16:16:44 +00:00
|
|
|
c1mm Macroexpand the innermost form at the cursor once.
|
2013-04-21 10:08:55 +00:00
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-cqp*
|
2012-12-04 06:06:22 +00:00
|
|
|
cqp Bring up a prompt for code to eval/print.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-cqc*
|
2012-12-04 06:06:22 +00:00
|
|
|
cqc Bring up a |command-line-window| for code to
|
|
|
|
eval/print. Equivalent to cqp<C-F>i.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-cq*
|
2012-12-04 06:06:22 +00:00
|
|
|
cq{motion} Bring up a |command-line-window| with text indicated
|
|
|
|
by {motion} prepopulated.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-:Last*
|
2013-01-13 15:49:54 +00:00
|
|
|
:Last Open the result of the last evaluation in the preview
|
|
|
|
window. Use :2Last to get the next-to-last result,
|
|
|
|
and so on. Once the window is open, cycle to older
|
|
|
|
and newer entries with |:lprevious| and |:lnext|.
|
|
|
|
|
2012-12-04 06:06:22 +00:00
|
|
|
And insert mode:
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
*fireplace-i_CTRL-R_(*
|
2012-12-04 06:06:22 +00:00
|
|
|
<C-R>( Evaluate the given expression and insert the result.
|
|
|
|
|
|
|
|
There's omnicomplete on |CTRL-X_CTRL-O|, which works in Clojure buffers and
|
|
|
|
in the |command-line-window|, and tab complete at the cqp prompt.
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
ABOUT *fireplace-about*
|
2012-12-04 06:06:22 +00:00
|
|
|
|
|
|
|
Grab the latest version or report a bug on GitHub:
|
|
|
|
|
2013-03-12 19:37:37 +00:00
|
|
|
http://github.com/tpope/vim-fireplace
|
2012-12-04 06:06:22 +00:00
|
|
|
|
|
|
|
vim:tw=78:et:ft=help:norl:
|