vim-iced.txt Clojure interactive development environment for Vim8/Neovim
Version: 3.15.3283
Author : Masashi Iizuka <liquidz.uo+vim@gmail.com>
License: MIT LICENSE
==============================================================================
@CONTENTS vim-iced-contents
Introduction vim-iced-introduction
Install vim-iced-install
Iced command vim-iced-install-command
Manual Install vim-iced-install-manually
Leiningen vim-iced-manual-leiningen
Boot vim-iced-manual-boot
shadow-cljs vim-iced-manual-shadow-cljs
Rebel Readline vim-iced-manual-rebel-readline
Boost by Python vim-iced-install-python
Boost by Vim9 script vim-iced-vim9-script
Docker vim-iced-install-docker
REPL Connection vim-iced-repl-connection
ClojureScript vim-iced-clojurescript
Piggieback vim-iced-piggieback
FigwheelMain vim-iced-figwheel-main
shadow-cljs vim-iced-shadow-cljs
Evaluating vim-iced-evaluating
Stdout Buffer vim-iced-stdout-buffer
Yank the result vim-iced-yank-the-result
Evaluating in context vim-iced-eval-in-context
Evaluating spinner vim-iced-evaluating-spinner
Stacktrace vim-iced-stacktrace
Testing vim-iced-testing
Plain nREPL vim-iced-testing-plain-nrepl
Debugging vim-iced-debugging
Tracing function calls vim-iced-debugging-tracing-function-calls
Browsing tapped values vim-iced-debugging-browsing-tapped-values
Floating Window vim-iced-debugging-floating-window
Skeleton vim-iced-skeleton
Jump to definition vim-iced-jump-to-def
Editing S-exp vim-iced-editing-s-exp
Formatting vim-iced-formatting
Format on writing files vim-iced-formatting-on-writing-files
Indenting vim-iced-indenting
Refactoring vim-iced-refactoring
Static analysis vim-iced-static-analysis
clj-kondo vim-iced-static-analysis-clj-kondo
Notification vim-iced-notification
Interface vim-iced-interface
Commands vim-iced-commands
Functions vim-iced-functions
Key Mappings vim-iced-key-mappings
Customizing vim-iced-customizing
Stdout buffer vim-iced-customizing-stdout-buffer
Formatter vim-iced-customizing-formatter
Indent rules vim-iced-customizing-indents
Tonsky's rule vim-iced-customizing-tonsky-rule
Documents vim-iced-customizing-documents
Auto document vim-iced-customizing-auto-document
Auto indent vim-iced-customizing-auto-indent
Signs vim-iced-customizing-signs
Command palettes vim-iced-customizing-palette
Hooks vim-iced-customizing-hooks
Popup window vim-iced-customizing-popup-window
Notification vim-iced-customizing-notification
Default keys vim-iced-customizing-default-keys
Changelog vim-iced-changelog
==============================================================================
@INTRODUCTION vim-iced-introduction
Clojure interactive development environment for Vim8/Neovim.
Requirement:
- Vim 8.1.0614 or later, Neovim 0.4.0 or later
- Clojure 1.8 or later
1.10 or later is recommended
- For Leiningen user
2.8.2 or later
Latest Version:
- https://github.com/liquidz/vim-iced
==============================================================================
@INSTALL vim-iced-install
Vim plugin dependencies:
- vim-sexp
https://github.com/guns/vim-sexp
- selector
One of following is required when selecting multiple candidates
- ctrlp.vim
https://github.com/ctrlpvim/ctrlp.vim
- fzf
https://github.com/junegunn/fzf
- vim-clap
https://github.com/liuchengxu/vim-clap
------------------------------------------------------------------------------
@ICED COMMAND vim-iced-install-command
vim-iced provides iced
command to use vim-iced easily.
Currently supports following tools.
- Leiningen
https://github.com/technomancy/leiningen
- Boot
https://github.com/boot-clj/boot
- Clojure CLI
https://clojure.org/guides/deps_and_cli
- shadow-cljs
https://github.com/thheller/shadow-cljs
See also vim-iced-shadow-cljs
Add $PATH
environment variable to /path/to/vim-iced/bin
.
E.g. export PATH=$PATH:~/src/github.com/liquidz/vim-iced/bin
NOTE:
iced
command has a feature to detect a use of ClojureScript.
But by default, it may be a false positive because of simple string match.
In this case, you can use more accurate checks with Babashka.
(Optional and Limited for Leiningen and Clojure CLI only)
iced
command will use it automatically when bb
command exists.
WARNING:
Do not copy bin/iced
file to your $PATH
.
iced
command references /path/to/vim-iced/deps.edn
for Clojure CLI.
So the copied iced
command cannot reference it.
To show help, run iced help
.
------------------------------------------------------------------------------
@MANUAL INSTALL vim-iced-install-manually
If you don't like to use iced
command, you can set up vim-iced manually.
LEININGEN
$HOME/.lein/profile.clj
{:user
{:dependencies [[nrepl "1.1.1"]
[com.github.liquidz/iced-nrepl "1.2.480"]
[cider/cider-nrepl "0.45.0"]]
:repl-options {:nrepl-middleware [cider.nrepl/wrap-classpath
cider.nrepl/wrap-clojuredocs
cider.nrepl/wrap-complete
cider.nrepl/wrap-debug
cider.nrepl/wrap-format
cider.nrepl/wrap-info
cider.nrepl/wrap-macroexpand
cider.nrepl/wrap-ns
cider.nrepl/wrap-out
cider.nrepl/wrap-refresh
cider.nrepl/wrap-stacktrace
cider.nrepl/wrap-spec
cider.nrepl/wrap-test
cider.nrepl/wrap-trace
cider.nrepl/wrap-undef
cider.nrepl/wrap-xref
iced.nrepl/wrap-iced]}
:plugins [[refactor-nrepl "3.9.1"]]}}
BOOT
$HOME/.boot/profile.boot
(require (quote boot.repl))
(swap! boot.repl/*default-dependencies* concat
'[[refactor-nrepl "3.9.1"]
[cider/cider-nrepl "0.45.0"]
[com.github.liquidz/iced-nrepl "1.2.480"]])
(swap! boot.repl/*default-middleware* concat
'[cider.nrepl/wrap-classpath
cider.nrepl/wrap-clojuredocs
cider.nrepl/wrap-complete
cider.nrepl/wrap-debug
cider.nrepl/wrap-format
cider.nrepl/wrap-info
cider.nrepl/wrap-macroexpand
cider.nrepl/wrap-ns
cider.nrepl/wrap-out
cider.nrepl/wrap-refresh
cider.nrepl/wrap-stacktrace
cider.nrepl/wrap-spec
cider.nrepl/wrap-test
cider.nrepl/wrap-trace
cider.nrepl/wrap-undef
cider.nrepl/wrap-xref
refactor-nrepl.middleware/wrap-refactor
iced.nrepl/wrap-iced])
SHADOW-CLJS
shadow-cljs.edn
{
:dependencies [[refactor-nrepl "3.9.1"]
[cider/cider-nrepl "0.45.0"]
[com.github.liquidz/iced-nrepl "1.2.480"]]
}
.nrepl.edn (local config) or $HOME/.nrepl/nrepl.edn (global config)
{:cider false
:middleware [cider.nrepl/wrap-classpath
cider.nrepl/wrap-clojuredocs
cider.nrepl/wrap-complete
cider.nrepl/wrap-debug
cider.nrepl/wrap-format
cider.nrepl/wrap-info
cider.nrepl/wrap-macroexpand
cider.nrepl/wrap-ns
cider.nrepl/wrap-out
cider.nrepl/wrap-refresh
cider.nrepl/wrap-stacktrace
cider.nrepl/wrap-spec
cider.nrepl/wrap-test
cider.nrepl/wrap-trace
cider.nrepl/wrap-undef
cider.nrepl/wrap-xref
refactor-nrepl.middleware/wrap-refactor
iced.nrepl/wrap-iced]}
To start CLJS REPL, see vim-iced-shadow-cljs.
@ vim-iced-manual-rebel-readline
REBEL READLINE
If you use Rebel Readline or want to embed an nREPL in your application,
then one approach is to create a user.clj
with the following:
(ns user
(:require [nrepl.server :as nrepl-server]
[clojure.java.io :as io]))
(def nrepl-port 7888)
(defonce nrepl-server (atom nil))
(defn cider-middleware
"Get cider middleware, see
https://github.com/clojure-emacs/cider-nrepl/issues/447"
[]
(require 'cider.nrepl)
(map ns-resolve
['cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl 'cider.nrepl]
['wrap-classpath 'wrap-clojuredocs 'wrap-complete 'wrap-debug 'wrap-format 'wrap-info 'wrap-macroexpand 'wrap-ns 'wrap-out 'wrap-refresh 'wrap-stacktrace 'wrap-spec 'wrap-test 'wrap-trace 'wrap-undef 'wrap-xref]))
(defn dev-middleware []
(mapcat (fn [[ns syms]] (require ns) (map (partial ns-resolve ns) syms))
[['refactor-nrepl.middleware ['wrap-refactor]] ['iced.nrepl ['wrap-iced]]]))
(defn nrepl-handler
"Re-implement cider-nrepl-handler so we can add middleware to the default list"
[]
(apply nrepl-server/default-handler (concat (cider-middleware) (dev-middleware))))
(defn start-nrepl-server! []
(reset!
nrepl-server
(nrepl-server/start-server :port nrepl-port :handler (nrepl-handler)))
(println "Cider nREPL server started on port" nrepl-port)
(spit ".nrepl-port" nrepl-port))
(defn stop-nrepl-server! []
(when (not (nil? @nrepl-server))
(nrepl-server/stop-server @nrepl-server)
(println "Cider nREPL server on port" nrepl-port "stopped")
(reset! nrepl-server nil)
(io/delete-file ".nrepl-port" true)
(System/exit 0)))
Start the Rebel Readline REPL and from it's prompt start the nREPL server
using start-nrepl-server!
, then in Vim do :IcedConnect
.
==============================================================================
@BOOST BY PYTHON vim-iced-install-python
vim-iced does not require if_python3
basically,
and all communication with nrepl is done by pure vim script.
But pure vim script is slow.
So vim-iced uses if_python3
to boost process if it is enabled.
==============================================================================
BOOST BY VIM9 SCRIPT vim-iced-vim9-script
With Vim8, all communication with nrepl is done by pure vim script,
and it is slow.
With Vim9, vim-iced uses vim9script automatically,
and it leads to boost communication between nREPL.
vim-iced requires Vim 9.0.297 or later to boost.
==============================================================================
@DOCKER vim-iced-install-docker
When you are connecting to nREPL in docker container, various paths will be
paths in the docker container.
There is a g:iced#nrepl#path_translation option to translate these paths.
In actual use, it is recommended to define the option
in the project-specific configuration file by vim-localrc
.
https://github.com/thinca/vim-localrc
E.g. /path/to/your/project/root/.local.vimrc
let g:iced#nrepl#path_translation = {
\ '/tmp': expand('<sfile>:p:h'),
\ '/root': $HOME,
\ }
==============================================================================
@REPL CONNECTION vim-iced-repl-connection
REPL needs to be activated beforehand.
- nREPL
- iced repl
to start REPL
iced
command must be installed.
- pREPL
- clj -J-Dclojure.server.repl="{:port 5555 :accept clojure.core.server/io-prepl}"
- Socket REPL
- e.g. Babashka
- bb --socket-repl 5555
If you don't want to launch REPL externally,
vim-iced provides following ways to launch REPL internally.
- :IcedJackIn to launch iced repl
internally
- :IcedInstantConnect to launch a REPL internally.
:IcedConnect to connect nREPL.
:IcedConnectPrepl to connect pREPL.
:IcedConnectSocketRepl to connect Socket REPL.
If not connected at the time of evaluation,
vim-iced will connect automatically using '.nrepl-port' file.
:IcedDisconnect to disconnect from REPL.
==============================================================================
@CLOJURE SCRIPT vim-iced-clojurescript
Supports following environment currently.
- figwheel-main
0.2.0 or later is required.
- figwheel-sidecar
- shadow-cljs
:IcedStartCljsRepl to start cljs-repl.
:IcedQuitCljsRepl to quit it.
:IcedCycleSession to cycle clj/cljs session.
For other environments, you can use :IcedCljsRepl command.
------------------------------------------------------------------------------
@PIGGIEBACK vim-iced-piggieback
Supporting ClojureScript requires nrepl/piggieback
.
- https://github.com/nrepl/piggieback
iced
command will inject piggieback dependency automatically,
when project configuration files contains org.clojure/clojurescript
.
Or you can use --with-cljs
option to inject piggieback explicitly.
iced repl --with-cljs
------------------------------------------------------------------------------
@FIGWHEEL MAIN vim-iced-figwheel-main
To start CLJS REPL with figwheel-main, you need to specify {build-id}.
E.g. :IcedCljsRepl (figwheel.main.api/repl-env "build-id")
Via :IcedStartCljsRepl
command, you can specify {build-id} as follows.
:IcedStartCljsRepl figwheel-main build-id
------------------------------------------------------------------------------
@SHADOW-CLJS vim-iced-shadow-cljs
To start CLJS REPL with shadow-cljs, you need following steps.
1. Start to watch
$ iced repl {YOUR-BUILD-ID}
In this case, iced
command will start watching project instead of
starting REPL.
You need a nREPL configuration file to start watching,
but iced
command can generate it automatically.
https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL
2. Access shadow-cljs's HTTP server in your browser
3. Connect to nREPL
For shadow-cljs, cljs-repl will be started automatically
after connection.
You don't need to specify your build ID anymore.
If you would like to start CLJS REPL by hand, you can do it as follows.
:IcedEvalRepl (shadow.cljs.devtools.api/repl :build-id)
==============================================================================
@EVALUATING vim-iced-evaluating
:IcedEval is the simplest way to evaluate forms.
But working with {vim-sexp} is the best.
See details to work with {vim-sexp}: <Plug>(iced_eval)
There are 3 default key bindings to evaluate s-expression.
- <Leader>ei
: Evaluate inner element
- <Leader>ee
: Evaluate outer list
- <Leader>et
: Evaluate outer top list
cf. vim-iced-customizing-default-keys
Specific evaluation range(|
means cursor position):
;; <------------et----------->
(defn greet []
(println "|hello world"))
;; <-----ei----->
;; <----------ee---------->
See https://liquidz.github.io/vim-iced/#configuration_evaluation
------------------------------------------------------------------------------
@STDOUT BUFFER vim-iced-stdout-buffer
Standard outputs will be outputted to dedicated buffer
or displayed on popup notification (when the buffer is invisible).
For stdout buffer:
:IcedStdoutBufferOpen to open it.
:IcedStdoutBufferClear to clear all outputted lines.
:IcedStdoutBufferToggle to toggle visibility.
For notification:
See vim-iced-notification for more information.
If you don't use notification for standard output,
see g:iced#buffer#stdout#enable_notify option.
For delimiters:
It is useful to have a delimited line in the unit of output
to limit the range of what you want to see.
See g:iced#buffer#stdout#enable_delimiter for more information.
If you show buffer content in another application or display,
g:iced#buffer#stdout#file option is available for writing file.
------------------------------------------------------------------------------
@YANK THE RESULT vim-iced-yank-the-result
The evaluated result is yanked to numbered registers.
cf. quote_number
Like vim's behavior, iced shifts the previous result of register 1 into
register 2, 2 into 3, and so forth.
If you have values you don't want to store,
See g:iced#eval#values_to_skip_storing_register.
When you specify a {register} like yank,
<Plug>(iced_eval) operator will yank the result.
E.g. "x<Leader>ee
will yank a result to register x
.
WARNING:
Yanking to "
register is skipped for now.
If you'd like to define a custom mapping, try below.
" mapping for "xee
nmap <silent> ee <Plug>(iced_eval)<Plug>(sexp_outer_list)``
------------------------------------------------------------------------------
@EVALUATING IN CONTEXT vim-iced-eval-in-context
There are times when you want to evaluate the contents of a function
for confirmation.
(defn greet [s]
(str "hello " s))
It is tired to bind arguments separately, (e.g. (def s "iced")
)
or to write function calls in the comment form every time.
(e.g. (comment (greet "iced"))
)
This is where evaluating codes in context help you.
There is a default key bindings to evaluate code in a context.
- <Leader>ece
: Evaluate outer list in a context
cf. vim-iced-customizing-default-keys
See <Plug>(iced_eval_in_context) for more information.
------------------------------------------------------------------------------
@EVALUATING SPINNER vim-iced-evaluating-spinner
vim-iced supports to display spinners while code is evaluating.
Evaluating spinner requires:
- Vim 9.0.297 or later
- Neovim
See also:
- g:iced#eval#popup_spinner_texts
- g:iced#eval#popup_spinner_interval
------------------------------------------------------------------------------
@STACKTRACE vim-iced-stacktrace
When exceptions are thrown, vim-iced will show stacktraces in stdout buffer.
See also:
- g:iced#nrepl#eval#ignoring_vars_in_stacktrace
==============================================================================
@TESTING vim-iced-testing
vim-iced provides following test commands.
When tests are failed, vim-iced sets error positions to quickfix.
:cwindow command enables you to show this information.
To show quickfix automatically, following autocmd is useful.
aug VimIcedAutoOpenQuickfix
au!
au QuickFixCmdPost vim-iced cwindow
aug END
------------------------------------------------------------------------------
@PLAIN NREPL vim-iced-testing-plain-nrepl
vim-iced basically requires nREPL with some middlewares.
But in some case, you may need to use plain nREPL such as babashka.nrepl.
- https://book.babashka.org/#_nrepl
In this case, vim-iced provides simple test integration which has less
functionality than cider-nrepl's one.
To use this simple test integration, you don't need to recognize whether
your nREPL is plain or not.
Following commands are also support simple test integration,
so you just execute these commands as usual.
NOTE: :IcedTestAll
depends on current namespace.
(e.g. foo.core
will search all vars in foo.*
).
So it's still not really the whole test.
==============================================================================
@DEBUGGING vim-iced-debugging
vim-iced supports cider's #dbg
and #break
reader literals.
The easiest way is to put #dbg
to your code, and evaluate it.
(defn fib [n]
#dbg (loop [a 0 b 1 n n]
(if (<= n 0)
a
(recur b (+ a b) (dec n)))))
Related options:
- g:iced#debug#value_max_length
------------------------------------------------------------------------------
@TRACING FUNCTION CALLS vim-iced-debugging-tracing-function-calls
vim-iced provides 2 ways for tracing function calls.
Traced result will be displayed in stdout buffer.
------------------------------------------------------------------------------
@BROWSING TAPPED VALUES vim-iced-debugging-browsing-tapped-values
WARNING: To use tap>
, Clojure 1.10.0 or later is required
If you have a big data structure and want to dig into it,
browsing tapped values is useful.
When you evaluate (tap> YOUR_DATA)
, :IcedBrowseTapped shows tapped values.
Select the value you want to dig into, then browsing value start.
See :IcedBrowseTapped for browsing key details.
All tapped values are stored in memory.
So if you would like to delete them, execute following commands.
- :IcedDeleteTapped (delete one)
- :IcedClearTapped (delete all)
------------------------------------------------------------------------------
@FLOATING WINDOW vim-iced-debugging-floating-window
vim-iced supports both of popup window in Vim
and floating window in Neovim.
This feature is very experimental, but works.
If your environment meets followings,
debugging information will be shown in floating window automatically.
- Vim 8.1 patch 1-1408 or later
- Neovim 0.4.0 or later
Related options:
- g:iced#popup#neovim#winhighlight
==============================================================================
@SKELETON vim-iced-skeleton
vim-iced provides code skeleton when you open new clojure files.
Currently, these extensions are supported.
- *.clj
- *.cljs
- *.cljc
==============================================================================
JUMP TO DEFINITION vim-iced-tag-jump vim-iced-jump-to-def
:IcedDefJump to jump to definition.
It is also supported to jump to qualified keywords and local vars.
If the jump destination for keyword is inaccurate or the jump is slow,
enabling clj-kondo feature may improve the result.
- vim-iced-static-analysis-clj-kondo
To jump back, you can use default key mapping(<C-t>).
See also:
- g:iced#navigate#prefer_local_jump
- g:iced#navigate#jump_fallback_command
------------------------------------------------------------------------------
@JUMP TO PROTOCOL vim-iced-protocol-jump
WARNING: This feature requires clj-kondo v2022.02.09 or later.
:IcedDefJump also supports jumping to protocol implementations.
If there is only one implementation, jump to the implementation immediately.
If there are multiple implementations, iced set them to the location-list.
==============================================================================
@EDITING S-EXP vim-iced-editing-s-exp
Provides slurp and barf function.
------------------------------------------------------------------------------
@FORMATTING vim-iced-formatting
Provides following functions.
vim-sexp also provides formatting codes function.
If you want to use vim-iced's formatting function,
you should define {g:sexp_mappings} as follows.
let g:sexp_mappings = {'sexp_indent': '', 'sexp_indent_top': ''}
See also vim-iced-customizing-formatter.
@ vim-iced-formatting-on-writing-files
FORMAT ON WRITING FILES
vim-iced also provides following sync commands.
These commands are useful to format on writing files.
aug VimIcedAutoFormatOnWriting
au!
" Format whole buffer on writing files
au BufWritePre *.clj,*.cljs,*.cljc,*.edn execute ':IcedFormatSyncAll'
" Format only current form on writing files
" au BufWritePre *.clj,*.cljs,*.cljc,*.edn execute ':IcedFormatSync'
aug END
------------------------------------------------------------------------------
@INDENTING vim-iced-indenting
vim-iced provides auto indentation feature,
and it is enabled by default.
Indent level is calculated by the set formatter,
so cljfmt
formatter which is used by default may lead slow down vim/nvim.
If you don't use vim-iced's auto indentation,
you can disable it by g:iced_enable_auto_indent variable.
let g:iced_enable_auto_indent = v:false
------------------------------------------------------------------------------
@REFACTORING vim-iced-refactoring
Provides following functions powered by refactor-nrepl.
- :IcedCleanNs (<Plug>(iced_clean_ns))
- :IcedCleanAll (<Plug>(iced_clean_all))
- :IcedAddMissing (<Plug>(iced_add_missing))
- :IcedThreadFirst (<Plug>(iced_thread_first))
- :IcedThreadLast (<Plug>(iced_thread_last))
- :IcedExtractFunction (<Plug>(iced_extract_function))
- :IcedAddArity (<Plug>(iced_add_arity))
- :IcedMoveToLet (<Plug>(iced_move_to_let))
- :IcedRenameSymbol (<Plug>(iced_rename_symbol))
See also:
- g:iced#refactor#insert_newline_after_require
==============================================================================
@STATIC ANALYSIS vim-iced-static-analysis
Currently vim-iced supports static analysis by clj-kondo.
- https://github.com/borkdude/clj-kondo
------------------------------------------------------------------------------
@CLJ-KONDO vim-iced-static-analysis-clj-kondo
This feature is disabled by default.
To enable, see g:iced_enable_clj_kondo_analysis.
Analysis process is run at BufWritePost autocmd.
Analyzed data is cached at g:iced_cache_directory, and used in followings:
LOCAL ANALYSIS
From clj-kondo v2021.01.20, local analysis is supported.
This can be used to support jumping to local vars.
To enable, see g:iced_enable_clj_kondo_local_analysis.
ANALYSIS DIRECTORIES
vim-iced uses the project root directory for analysis by default.
If you want to analyze files only in specific directories,
see g:iced_clj_kondo_analysis_dirs.
TIPS
- Cached files will be separated to var definition/usage and
ns definition/usage automatically if you have jq
or jet
.
- https://github.com/stedolan/jq
- https://github.com/borkdude/jet
- For more advance, if you have jq
and sqlite3
,
vim-iced will store analyzed result into SQLite database.
- The performance will improve dramatically.
- https://www.sqlite.org/index.html
- This leads to make :IcedAddMissing and :IcedAddNs more faster.
==============================================================================
@NOTIFICATION vim-iced-notification
A simple area to show some notification messages.
Notification area is popuped at {topright} or {bottomright}
(closer to the cursor to minimize eye movement).
Area size is calculated by the ratio to the current window size.
To customize the size, see vim-iced-customizing-notification.
==============================================================================
@INTERFACE vim-iced-interface
------------------------------------------------------------------------------
@COMMANDS vim-iced-commands
:IcedConnect [{port}]
Make connection to nREPL.
If {port} is not passed, {port} is detected by '.nrepl-port' automatically.
See also following commands:
- g:iced#nrepl#connect#auto_connect_timeout_ms
Key is mapped to <Plug>(iced_connect).
:IcedConnectSocketRepl {port}
Make connection to socket REPL.
{port} is required.
:IcedConnectPrepl {port}
Make connection to pREPL.
{port} is required.
This connection is based on socket repl connection.
:IcedDisconnect
Disconnect from nREPL.
Automatically disconnected at leaving vim.
Key is mapped to <Plug>(iced_disconnect).
:IcedReconnect
Disconnect from nREPL, and make connection to nREPL again.
Previous sessions are closed.
Key is mapped to <Plug>(iced_reconnect).
:IcedInterrupt
Interrupt some code evaluation in current session.
Key is mapped to <Plug>(iced_interrupt).
:IcedInterruptAll
Interrupt code evaluation in all sessions.
Key is mapped to <Plug>(iced_interrupt_all).
:IcedJackIn
Start REPL and connect to it.
REPL is launched as job internally.
See g:iced#nrepl#connect#jack_in_command for the concrete command
to start REPL.
Key is mapped to <Plug>(iced_jack_in).
:IcedInstantConnect [{target}]
Start instant REPL and connect to it.
REPL is launched as job internally.
Supports follows {target}:
- nrepl
or empty
Launch iced repl --instant
.
- babashka
Launch babashka REPL.
bb
command is required.
See also g:iced#repl#babashka_repl_type option.
- nbb
Launch nbb REPL.
nbb
or deno
is required.
deno
must be 1.28 or later.
Key is mapped to <Plug>(iced_instant_connect).
:IcedCljsRepl {form}
Start CLJS REPL via user specified code.
The code will be passed to cider.piggieback/cljs-repl
.
E.g.
;; figwheel-main
:IcedCljsRepl (figwheel.main.api/repl-env "app")
;; figwheel-sidecar
:IcedCljsRepl (figwheel-sidecar.repl-api/repl-env)
:IcedStartCljsRepl [{env}]
Start CLJS REPL with specified environment.
REPL session changes to 'cljs.user' namespace.
If {env} is not passed, g:iced#cljs#default_env is used.
Supports following environment currently.
- figwheel-sidecar
- figwheel-main
- shadow-cljs
Key is mapped to <Plug>(iced_start_cljs_repl).
:IcedQuitCljsRepl
Quit CLJS REPL.
REPL session changes to initial namespace.
Key is mapped to <Plug>(iced_quit_cljs_repl).
:IcedCycleSession
Cycle clj/cljs session.
Error occurs when CLJS session does not exist.
:IcedEval {form}
Evaluate {form} in current session.
See details: <Plug>(iced_eval)
:IcedEvalNs
Evaluate ns
form in current session.
Key is mapped to <Plug>(iced_eval_ns)
:IcedEvalVisual
Evaluate selected form in current session.
Key is mapped to <Plug>(iced_eval_visual)
:IcedEvalIsolatedly {form}
Evaluate {form} in a isolated(ephemeral) session.
cf. https://nrepl.org/nrepl/design/middleware.html#sessions
This is useful if you wouldn't like to block other evaluations.
:IcedRequire
Load current file in current session.
Key is mapped to <Plug>(iced_require).
:IcedRequireAll
Require and reload current file in current session.
Key is mapped to <Plug>(iced_require_all).
:IcedUndef [{symbol}]
Undefine {symbol} in current namespace.
If {symbol} is not passed, symbol under cursor is used.
Key is mapped to <Plug>(iced_undef).
:IcedUndefAllInNs [{ns}]
Undefine all symbols in {ns}.
If {ns} is not passed, current namespace is used.
Key is mapped to <Plug>(iced_undef_all_in_ns).
:IcedEvalOuterTopList
Evaluate topmost form that is not a comment where the cursor currently is.
See also https://liquidz.github.io/vim-iced/#configuration_evaluation
Key is mapped to <Plug>(iced_eval_outer_top_list).
:IcedEvalAtMark
NOTE: Type a key to specify the mark after executing this command.
Evaluate the outer list (not outer top list) on the specified mark.
Key is mapped to <Plug>(iced_eval_at_mark).
:IcedEvalLastOuterTopList
Re-evaluate the outer top list which is evaluated last.
Last evaluated list is marked to g:iced#eval#mark_at_last.
Key is mapped to <Plug>(iced_eval_last_outer_top_list).
:IcedPrintLast
Open a window, and show last evaluated value.
Key is mapped to <Plug>(iced_print_last).
:IcedPrintLastStackTrace
Print the last full stacktraces in vim-iced-stdout-buffer.
Key is mapped to <Plug>(iced_print_last_stacktrace).
:IcedMacroExpandOuterList
Work same as <Plug>(iced_macroexpand)<Plug>(sexp_outer_list)
,
without scrolling.
Key is mapped to <Plug>(iced_macroexpand_outer_list).
:IcedMacroExpand1OuterList
Work same as <Plug>(iced_macroexpand_1)<Plug>(sexp_outer_list)
,
without scrolling.
Key is mapped to <Plug>(iced_macroexpand_1_outer_list).
:IcedRefresh
Reload all changed files in all directories on the classpath.
Key is mapped to <Plug>(iced_refresh).
See also:
- g:iced#nrepl#ns#refresh_before_fn
- g:iced#nrepl#ns#refresh_after_fn
:IcedRefreshAll
Reload all files in all directories on the classpath.
Key is mapped to <Plug>(iced_refresh_all).
:IcedRefreshClear
Clear refreshing status.
Key is mapped to <Plug>(iced_refresh_clear).
:IcedTestUnderCursor
Run test under cursor.
If the var under cursor does not contain :test
metadata
and current ns doesn't end with "-test",
vim-iced searches test vars in corresponding test ns and run them.
Target test vars include original var name in its name.
Key is mapped to <Plug>(iced_test_under_cursor).
:IcedTestRerunLast
Run last test again.
Key is mapped to <Plug>(iced_test_rerun_last).
:IcedTestSpecCheck [{num-tests}]
Run clojure.spec.test.alpha/check
for the function under cursor.
NOTE: Adding test.check
dependency is required.
https://github.com/clojure/test.check
If {num-tests} is not passed, g:iced#test#spec_num_tests is used.
Key is mapped to <Plug>(iced_test_spec_check).
:IcedTestBufferOpen
Open test result buffer.
Key is mapped to <Plug>(iced_test_buffer_open).
:IcedTestBufferClose
Close test result buffer.
Key is mapped to <Plug>(iced_test_buffer_close).
:IcedTestNs
Run tests in current namespace.
Key is mapped to <Plug>(iced_test_ns).
:IcedTestAll
Run all tests in current project.
Key is mapped to <Plug>(iced_test_all).
:IcedTestRedo
Re run failed tests.
Key is mapped to <Plug>(iced_test_redo).
:IcedStdoutBufferOpen
Open stdout buffer.
Key is mapped to <Plug>(iced_stdout_buffer_open).
:IcedStdoutBufferClear
Clear all lines in stdout buffer.
Key is mapped to <Plug>(iced_stdout_buffer_clear).
:IcedStdoutBufferClose
Close stdout buffer window.
Key is mapped to <Plug>(iced_stdout_buffer_close).
:IcedStdoutBufferToggle
Toggle stdout buffer window.
Key is mapped to <Plug>(iced_stdout_buffer_toggle).
:IcedDefJump [{symbol}, {jump-cmd}]
Jump cursor to definition of {symbol} (default to symbol under cursor).
{jump-cmd} is used to specify how to open the new buffer, default to edit.
To specify {jump-cmd} while still use symbol under cursor automatically,
pass '.' as first argument.
E.g.
:nmap <buffer> g<C-]> :<C-u>IcedDefJump . tabedit<CR>
Key is mapped to <Plug>(iced_def_jump).
:IcedOpenNs {ns-name}
Open a file corresponding to the specified {ns-name}.
If {ns-name} does not exist, make sure you open a file with a pseudo path.
:IcedBrowseReferences
Browse positions referencing the form under cursor.
Results are set to location-list.
:IcedBrowseDependencies
Browse positions depending on the form under cursor.
Results are set to location-list.
:IcedBrowseVarReferences
Browse positions referencing the var under cursor.
Results are set to location-list.
:IcedBrowseVarDependencies
Browse positions depending on the var under cursor.
Results are set to location-list.
:IcedDocumentOpen [{symbol}]
Open a window, and show documents for {symbol}.
If {symbol} is not passed, symbol under cursor is used.
Key is mapped to <Plug>(iced_document_open).
:IcedDocumentPopupOpen [{symbol}]
Open a popup window, and show documents for {symbol}.
If {symbol} is not passed, symbol under cursor is used.
If popup is not supported, :IcedDocumentOpen is called.
Key is mapped to <Plug>(iced_document_popup_open).
:IcedFormDocument
Echo one-line document for form under cursor.
This is useful to show document while editing codes.
See details <Plug>(iced_form_document).
:IcedUseCaseOpen [{symbol}]
Open a window, and show usecase for {symbol}.
If {symbol} is not passed, symbol under cursor is used.
When several usecases are found, :IcedNextUseCase and :IcedPrevUseCase
commands are useful to show next or previous usecases.
Key is mapped to <Plug>(iced_use_case_open).
:IcedNextUseCase
Show next usecase in a window if there is.
See also :IcedUseCaseOpen command.
Key is mapped to <Plug>(iced_next_use_case).
:IcedPrevUseCase
Show previous usecase in a window if there is.
See also :IcedUseCaseOpen command.
Key is mapped to <Plug>(iced_prev_use_case).
:IcedDocumentClose
Close document window.
Key is mapped to <Plug>(iced_document_close).
:IcedJavaDocument [{class_name}]
Opens a browser window displaying the javadoc for {class_name}.
cf. https://clojuredocs.org/clojure.java.javadoc/javadoc
If {class_name} is not passed,
the result of clojure.core/class
for the form under cursor is used.
For example, running this command over (clojure.java.io/resource "...")
will open a document page for java.net.URL
.
Key is mapped to <Plug>(iced_java_document).
:IcedSourceShow [{symbol}]
Open a window, and show source codes for {symbol}
If {symbol} is not passed, symbol under cursor is used.
See also g:iced_enable_enhanced_definition_extraction.
Key is mapped to <Plug>(iced_source_show).
:IcedSourcePopupShow [{symbol}]
Open a popup window, and show source codes for {symbol}
If {symbol} is not passed, symbol under cursor is used.
If popup is not supported or codes are too long to show in popup window,
:IcedSourceShow is called.
See also g:iced_enable_enhanced_definition_extraction.
Key is mapped to <Plug>(iced_source_popup_show).
:IcedCommandPalette
Select command from palette.
ctrlp.vim
, fzf
or vim-clap
is required to select namespace.
Key is mapped to <Plug>(iced_command_palette).
:IcedSpecForm [{keyword}]
Open a window, and show the form of the spec.
If {keyword} is not passed, keyword under cursor is used.
Key is mapped to <Plug>(iced_spec_form).
:IcedSpecExample [{keyword}]
Open a window, and show the example of the spec.
If {keyword} is not passed, keyword under cursor is used.
Key is mapped to <Plug>(iced_spec_example).
:IcedClojureDocsOpen [{symbol}]
Open a window, and show documents for {symbol} in ClojureDocs.
If {symbol} is not passed, symbol under cursor is used.
A cache file will be created at the following path.
- macOS : $HOME/Library/Caches/orchard/clojuredocs/export.edn
- Windows: FOLDERID_LocalAppData\\cache\orchard\clojuredocs\export.edn
- Others : $XDG_CACHE_HOME or $HOME/.cache/orchard/clojuredocs/export.edn
See also:
- g:iced#clojuredocs#export_edn_url
- g:iced#clojuredocs#use_clj_docs_on_cljs
Key is mapped to <Plug>(iced_clojuredocs_open).
:IcedClojureDocsRefresh
Clean a ClojureDocs cache file, and reload documents.
See also g:iced#clojuredocs#export_edn_url.
Key is mapped to <Plug>(iced_clojuredocs_refresh).
:IcedSlurp
Slurp next element.
If no elements in current form, search next form and slurp.
For searching next form, g:iced#paredit#slurp_max_depth is used.
Key is mapped to <Plug>(iced_slurp).
:IcedBarf
Barf last element in current form.
Key is mapped to <Plug>(iced_barf).
:IcedFormat
Reformat current form.
Key is mapped to <Plug>(iced_format).
:IcedFormatAll
Reformat current buffer.
Key is mapped to <Plug>(iced_format_all).
:IcedFormatSync
Same as :IcedFormat, but it's done synchronously.
Key is mapped to <Plug>(iced_format_sync).
:IcedFormatSyncAll
Same as :IcedFormatAll, but it's done synchronously.
Key is mapped to <Plug>(iced_format_sync_all).
:IcedCycleSrcAndTest
Switch between source file and test file.
If the file does not exist, make sure you open a file with a pseudo path.
Key is mapped to <Plug>(iced_cycle_src_and_test).
:IcedGrep [{keyword}]
Execute g:iced#grep#prg command asynchronously.
If {keyword} is not passed, keyword under cursor is used.
NOTE: This command will change the current directory globally.
Configurable option are g:iced#grep#prg and g:iced#grep#format.
Key is mapped to <Plug>(iced_grep).
:IcedBrowseRelatedNamespace
Browse namespaces relating to current namespace, and open selected one.
ctrlp.vim
, fzf
or vim-clap
is required to select namespace.
Configurable option is g:iced#related_ns#tail_patterns.
Key is mapped to <Plug>(iced_browse_related_namespace).
:IcedBrowseSpec
Browse specs, and show spec form in document buffer.
ctrlp.vim
, fzf
or vim-clap
is required to select spec.
Key is mapped to <Plug>(iced_browse_spec).
:IcedBrowseTestUnderCursor
Browse test vars, and jump to the selected var definition.
ctrlp.vim
, fzf
or vim-clap
is required to select a test var.
Key is mapped to <Plug>(iced_browse_test_under_cursor).
:IcedClearNsCache
Clear all caches related to namespace.
vim-iced will cache followings currently:
- Existing all namespace aliases
Key is mapped to <Plug>(iced_clear_ns_cache).
:IcedClearCtrlpCache
Clear ctrlp cache used by vim-iced.
ctrlp.vim
is required.
Key is mapped to <Plug>(iced_clear_ctrlp_cache).
:IcedClearInlineResult
Clear all inline evaluated results.
Key is mapped to <Plug>(iced_clear_inline_result).
:IcedCleanNs
Cleanup ns form.
See https://github.com/clojure-emacs/refactor-nrepl#clean-ns
Key is mapped to <Plug>(iced_clean_ns).
:IcedCleanAll
Cleanup buffer and ns form.
Concretely :IcedCleanNs and :IcedFormatAll are executed.
Key is mapped to <Plug>(iced_clean_all).
:IcedAddMissing [{symbol}]
Add missing libspec.
If {symbol} is not passed, symbol under cursor is used.
Namespaces and its aliases are cached for performance.
:IcedClearNsCache will clear this cache.
If {symbol} is a Java class, vim-iced will find candidates by pre-defined
class mappings.
https://github.com/liquidz/iced-nrepl/blob/main/resources/java_classes.edn
To add your own classes, see g:iced#ns#class_map option.
:IcedAddNs [{ns}]
Add require to ns
form.
If {ns} is not passed, select namespaces in your project
via ctrlp.vim
, fzf
or vim-clap
interface.
Namespaces and its aliases are cached for performance.
:IcedClearNsCache will clear this cache.
:IcedThreadFirst
Convert current outer form to use ->
threading macro.
E.g.
;; before
(foo (bar (baz "hello")))
;; after
(-> "hello" baz bar foo)
:IcedThreadLast
Convert current outer form to use ->>
threading macro.
E.g.
;; before
(foo yy (bar xx "hello"))
;; after
(->> "hello" (bar xx) (foo yy))
:IcedExtractFunction
Extract the form under cursor as a function.
:IcedAddArity
Add an arity to defn
, fn
, defmacro
, or defmethod
.
:IcedMoveToLet
Move the form under cursor to nearest let
binding.
If there is no let
form in current top list,
wrap the form with let
.
:IcedRenameSymbol
Rename all occurrences of the symbol under cursor.
WARNING:
RenameSymbol command requires borkdude/jet
.
https://github.com/borkdude/jet
vim-iced will confirm you to install jet
automatically If not installed.
:IcedBrowseTapped [{keys}]
If {keys} are not passed, select one of tapped values, and start browsing.
ctrlp.vim
, fzf
or vim-clap
is required to select tapped values.
If {keys} are passed, dig into tapped values.
For example, when there are following tapped values:
1st tapped value: {:foo [{:bar "baz"}]}
2nd tapped value: {:hello "world"}
The key to browse "baz"
is 0 :foo 0 :bar
.
(The first 0
means "browse 1st tapped value")
Key is mapped to <Plug>(iced_browse_tapped).
:IcedDeleteTapped
Select one tapped value via ctrlp.vim
, fzf
or vim-clap
interface,
and delete it.
Key is mapped to <Plug>(iced_delete_tapped).
:IcedClearTapped
Clear all tapped values.
Key is mapped to <Plug>(iced_clear_tapped).
:IcedToggleWarnOnReflection
Toggle *warn-on-reflection*
in current project.
Key is mapped to <Plug>(iced_toggle_warn_on_reflection).
:IcedToggleTraceVar [{symbol}]
Toggle tracing {symbol} in current namespace.
If {symbol} is not passed, symbol under cursor is used.
Key is mapped to <Plug>(iced_toggle_trace_var).
:IcedToggleTraceNs [{ns}]
Toggle tracing {ns}.
If {ns} is not passed, current buffer's ns name is used.
Key is mapped to <Plug>(iced_toggle_trace_ns).
:IcedJumpToNextSign
Jump cursor to next sign in current buffer.
If search hit BOTTOM and 'wrapscan' is enabled,
searching sign continues at TOP.
Key is mapped to <Plug>(iced_jump_to_next_sign).
:IcedJumpToPrevSign
Jump cursor to previous sign in current buffer.
If search hit TOP and 'wrapscan' is enabled,
searching sign continues at BOTTOM.
Key is mapped to <Plug>(iced_jump_to_prev_sign).
:IcedJumpToLet
Jump cursor to nearest let
form.
If let
form is not found in current top list, cursor is not moved.
Key is mapped to <Plug>(iced_jump_to_let).
:IcedYankNsName
Yank the current namespace name into "
register.
------------------------------------------------------------------------------
@FUNCTIONS vim-iced-functions
iced#status()
Return vim-iced's status.
This is useful to show status in status line.
E.g. working with https://github.com/itchyny/lightline.vim
let g:lightline = {
\ 'active': {'right': [['iced']]},
\ 'component_function': {'iced': 'iced#status'},
\ }
------------------------------------------------------------------------------
@KEY MAPPINGS vim-iced-key-mappings
<Plug>(iced_connect)
Same as :IcedConnect.
<Plug>(iced_disconnect)
Same as :IcedDisconnect.
<Plug>(iced_reconnect)
Same as :IcedReconnect.
<Plug>(iced_interrupt)
Same as :IcedInterrupt.
<Plug>(iced_jack_in)
Same as :IcedJackIn.
@ <Plug>(iced_instant_connect)
<Plug>(iced_instant_connect)
Same as :IcedInstantConnect.
@ <Plug>(iced_start_cljs_repl)
<Plug>(iced_start_cljs_repl)
Same as :IcedStartCljsRepl.
<Plug>(iced_quit_cljs_repl)
Same as :IcedQuitCljsRepl.
<Plug>(iced_eval)
Evaluate codes.
Followings are examples for working with {vim-sexp}.
<Plug>(iced_eval)<Plug>(sexp_inner_element)``
<Plug>(iced_eval)<Plug>(sexp_outer_list)``
<Plug>(iced_eval)<Plug>(sexp_outer_top_list)``
This operator supports yanking.
See vim-iced-yank-the-result for more information.
@ <Plug>(iced_eval_isolatedly)
<Plug>(iced_eval_isolatedly)
Evaluate codes in a isolated(ephemeral) session.
Followings are examples for working with {vim-sexp}.
<Plug>(iced_eval_isolatedly)<Plug>(sexp_inner_element)``
<Plug>(iced_eval_isolatedly)<Plug>(sexp_outer_list)``
<Plug>(iced_eval_isolatedly)<Plug>(sexp_outer_top_list)``
<Plug>(iced_eval_and_print)
Evaluate code and print result to stdout buffer.
Followings are examples for working with {vim-sexp}.
<Plug>(iced_eval_and_print)<Plug>(sexp_inner_element)``
<Plug>(iced_eval_and_print)<Plug>(sexp_outer_list)``
<Plug>(iced_eval_and_print)<Plug>(sexp_outer_top_list)``
<Plug>(iced_eval_and_tap)
Evaluate code and tap result by clojure.core/tap>
.
Followings are examples for working with {vim-sexp}.
<Plug>(iced_eval_and_tap)<Plug>(sexp_inner_element)``
<Plug>(iced_eval_and_tap)<Plug>(sexp_outer_list)``
<Plug>(iced_eval_and_tap)<Plug>(sexp_outer_top_list)``
@ <Plug>(iced_eval_and_replace)
<Plug>(iced_eval_and_replace)
Evaluate code and replace it by the evaluation result.
Followings are examples for working with {vim-sexp}.
<Plug>(iced_eval_and_replace)<Plug>(sexp_inner_element)``
<Plug>(iced_eval_and_replace)<Plug>(sexp_outer_list)``
<Plug>(iced_eval_and_replace)<Plug>(sexp_outer_top_list)``
@ <Plug>(iced_eval_and_comment)
<Plug>(iced_eval_and_comment)
Evaluate code and add the result as a comment in current end of line.
Followings are examples for working with {vim-sexp}.
<Plug>(iced_eval_and_comment)<Plug>(sexp_inner_element)``
<Plug>(iced_eval_and_comment)<Plug>(sexp_outer_list)``
<Plug>(iced_eval_and_comment)<Plug>(sexp_outer_top_list)``
@ <Plug>(iced_eval_in_context)
<Plug>(iced_eval_in_context)
Evaluate code in the user specified context.
The context is clojure.core/let
style.
For example, the context foo "bar" num 10
will be expanded to
(clojure.core/let [foo "bar" num 10] ...)
.
The input context is saved and will be expanded at the next evaluation.
See also vim-iced-eval-in-context.
<Plug>(iced_eval_ns)
Same as :IcedEvalNs.
<Plug>(iced_eval_visual)
Same as :IcedEvalVisual.
This is mapped to vnoremap
.
<Plug>(iced_macroexpand)
Evaluate {macroexpand}, and show result in a window.
<Plug>(iced_macroexpand)<Plug>(sexp_outer_list)``
<Plug>(iced_macroexpand_1)
Evaluate {macroexpand-1}, and show result in a window.
<Plug>(iced_macroexpand_1)<Plug>(sexp_outer_list)``
<Plug>(iced_require)
Same as :IcedRequire.
<Plug>(iced_require_all)
Same as :IcedRequireAll.
<Plug>(iced_undef)
Same as :IcedUndef.
@ <Plug>(iced_undef_all_in_ns)
<Plug>(iced_undef_all_in_ns)
Same as :IcedUndefAllInNs.
@ <Plug>(iced_eval_outer_top_list)
<Plug>(iced_eval_outer_top_list)
Same as :IcedEvalOuterTopList.
<Plug>(iced_eval_at_mark)
Same as :IcedEvalAtMark.
@ <Plug>(iced_eval_last_outer_top_list)
<Plug>(iced_eval_last_outer_top_list)
Same as :IcedEvalLastOuterTopList.
<Plug>(iced_print_last)
Same as :IcedPrintLast.
@ <Plug>(iced_print_last_stacktrace)
<Plug>(iced_print_last_stacktrace)
Same as :IcedPrintLastStackTrace.
@ <Plug>(iced_macroexpand_outer_list)
<Plug>(iced_macroexpand_outer_list)
Same as :IcedMacroExpandOuterList.
@ <Plug>(iced_macroexpand_1_outer_list)
<Plug>(iced_macroexpand_1_outer_list)
Same as :IcedMacroExpand1OuterList.
<Plug>(iced_refresh)
Same as :IcedRefresh.
<Plug>(iced_refresh_all)
Same as :IcedRefreshAll.
<Plug>(iced_refresh_clear)
Same as :IcedRefreshClear.
<Plug>(iced_test_ns)
Same as :IcedTestNs.
<Plug>(iced_test_all)
Same as :IcedTestAll.
<Plug>(iced_test_redo)
Same as :IcedTestRedo.
@ <Plug>(iced_test_under_cursor)
<Plug>(iced_test_under_cursor)
Same as :IcedTestUnderCursor.
@ <Plug>(iced_test_rerun_last)
<Plug>(iced_test_rerun_last)
Same as :IcedTestRerunLast.
@ <Plug>(iced_test_spec_check)
<Plug>(iced_test_spec_check)
Same as :IcedTestSpecCheck.
@ <Plug>(iced_test_buffer_open)
<Plug>(iced_test_buffer_open)
Same as :IcedTestBufferOpen.
@ <Plug>(iced_test_buffer_close)
<Plug>(iced_test_buffer_close)
Same as :IcedTestBufferClose.
@ <Plug>(iced_stdout_buffer_open)
<Plug>(iced_stdout_buffer_open)
Same as :IcedStdoutBufferOpen.
@ <Plug>(iced_stdout_buffer_clear)
<Plug>(iced_stdout_buffer_clear)
Same as :IcedStdoutBufferClear.
@ <Plug>(iced_stdout_buffer_close)
<Plug>(iced_stdout_buffer_close)
Same as :IcedStdoutBufferClose.
@ <Plug>(iced_stdout_buffer_toggle)
<Plug>(iced_stdout_buffer_toggle)
Same as :IcedStdoutBufferToggle.
<Plug>(iced_def_jump)
Same as :IcedDefJump.
<Plug>(iced_open_ns)
Same as :IcedOpenNs.
@ <Plug>(iced_browse_references)
<Plug>(iced_browse_references)
Same as :IcedBrowseReferences.
@ <Plug>(iced_browse_dependencies)
<Plug>(iced_browse_dependencies)
Same as :IcedBrowseDependencies.
@ <Plug>(iced_browse_var_references)
<Plug>(iced_browse_var_references)
Same as :IcedBrowseVarReferences.
@ <Plug>(iced_browse_var_dependencies)
<Plug>(iced_browse_var_dependencies)
Same as :IcedBrowseVarDependencies.
<Plug>(iced_document_open)
Same as :IcedDocumentOpen.
@ <Plug>(iced_document_popup_open)
<Plug>(iced_document_popup_open)
Same as :IcedDocumentPopupOpen.
Configurable options are:
- g:iced_enable_popup_document
<Plug>(iced_form_document)
Same as :IcedFormDocument.
This is convenient to display documents about the form you are editing.
Configurable options are:
- g:iced_enable_popup_document
- g:iced#nrepl#auto#document_delay
<Plug>(iced_use_case_open)
Same as :IcedUseCaseOpen.
<Plug>(iced_next_use_case)
Same as :IcedNextUseCase.
<Plug>(iced_prev_use_case)
Same as :IcedPrevUseCase.
<Plug>(iced_document_close)
Same as :IcedDocumentClose.
<Plug>(iced_java_document)
Same as :IcedJavaDocument.
<Plug>(iced_source_show)
Same as :IcedSourceShow.
@ <Plug>(iced_source_popup_show)
<Plug>(iced_source_popup_show)
Same as :IcedSourcePopupShow.
@ <Plug>(iced_command_palette)
<Plug>(iced_command_palette)
Same as :IcedCommandPalette.
<Plug>(iced_spec_form)
Same as :IcedSpecForm.
<Plug>(iced_spec_example)
Same as :IcedSpecExample.
@ <Plug>(iced_clojuredocs_open)
<Plug>(iced_clojuredocs_open)
Same as :IcedClojureDocsOpen.
@ <Plug>(iced_clojuredocs_refresh)
<Plug>(iced_clojuredocs_refresh)
Same as :IcedClojureDocsRefresh.
<Plug>(iced_slurp)
Same as :IcedSlurp.
<Plug>(iced_barf)
Same as :IcedBarf.
<Plug>(iced_format)
Same as :IcedFormat.
<Plug>(iced_format_all)
Same as :IcedFormatAll.
<Plug>(iced_format_sync)
Same as :IcedFormatSync.
@ <Plug>(iced_format_sync_all)
<Plug>(iced_format_sync_all)
Same as :IcedFormatSyncAll.
@ <Plug>(iced_cycle_src_and_test)
<Plug>(iced_cycle_src_and_test)
Same as :IcedCycleSrcAndTest.
<Plug>(iced_grep)
Same as :IcedGrep.
@ <Plug>(iced_browse_related_namespace)
<Plug>(iced_browse_related_namespace)
Same as :IcedBrowseRelatedNamespace.
<Plug>(iced_browse_spec)
Same as :IcedBrowseSpec.
@ <Plug>(iced_browse_test_under_cursor)
<Plug>(iced_browse_test_under_cursor)
Same as :IcedBrowseTestUnderCursor.
<Plug>(iced_clear_ns_cache)
Same as :IcedClearNsCache.
@ <Plug>(iced_clear_ctrlp_cache)
<Plug>(iced_clear_ctrlp_cache)
Same as :IcedClearCtrlpCache.
@ <Plug>(iced_clear_inline_result)
<Plug>(iced_clear_inline_result)
Same as :IcedClearInlineResult.
<Plug>(iced_clean_ns)
Same as :IcedCleanNs.
<Plug>(iced_clean_all)
Same as :IcedCleanAll.
<Plug>(iced_add_missing)
Same as :IcedAddMissing.
<Plug>(iced_add_ns)
Same as :IcedAddNs.
<Plug>(iced_thread_first)
Same as :IcedThreadFirst.
<Plug>(iced_thread_last)
Same as :IcedThreadLast.
@ <Plug>(iced_extract_function)
<Plug>(iced_extract_function)
Same as :IcedExtractFunction.
<Plug>(iced_add_arity)
Same as :IcedAddArity.
<Plug>(iced_move_to_let)
Same as :IcedMoveToLet.
<Plug>(iced_rename_symbol)
Same as :IcedRenameSymbol.
<Plug>(iced_browse_tapped)
Same as :IcedBrowseTapped.
<Plug>(iced_delete_tapped)
Same as :IcedDeleteTapped.
<Plug>(iced_clear_tapped)
Same as :IcedClearTapped.
@ <Plug>(iced_toggle_trace_var)
<Plug>(iced_toggle_trace_var)
Same as :IcedToggleTraceVar.
@ <Plug>(iced_toggle_trace_ns)
<Plug>(iced_toggle_trace_ns)
Same as :IcedToggleTraceNs.
@ <Plug>(iced_jump_to_next_sign)
<Plug>(iced_jump_to_next_sign)
Same as :IcedJumpToNextSign.
@ <Plug>(iced_jump_to_prev_sign)
<Plug>(iced_jump_to_prev_sign)
Same as :IcedJumpToPrevSign.
<Plug>(iced_jump_to_let)
Same as :IcedJumpToLet.
<Plug>(iced_yank_ns_name)
Same as :IcedYankNsName.
==============================================================================
@CUSTOMIZING vim-iced-customizing
g:iced#nrepl#host
Connection host name.
Default value is '127.0.0.1'
.
g:iced#nrepl#buffer_size
Threshold for nREPL response length.
If response exceed this threshold, vim-iced will handle the response as
too large response and warn.
Default value is 1048576
.
@ g:iced#nrepl#skip_evaluation_when_buffer_size_is_exceeded
g:iced#nrepl#skip_evaluation_when_buffer_size_is_exceeded
If {v:true}, skip evaluation when the nREPL response length exceed
Default value is v:false
.
@ g:iced#nrepl#connect#jack_in_command
g:iced#nrepl#connect#jack_in_command
Command to start REPL in :IcedJackIn.
Default value is 'iced repl'
.
g:iced#nrepl#connect#prefer
Preferred connection candidate when you have multiple connection candidates
on :IcedConnect.
The value must be one of ''
, 'nrepl'
or 'shadow-cljs'
.
If ''
, it is required to select a conncation candidate manually.
Default value is ''
.
@ g:iced#nrepl#connect#auto_connect_timeout_ms
g:iced#nrepl#connect#auto_connect_timeout_ms
Timeout time for waiting auto connection.
Unit is milli sec.
When you set -1
, vim-iced will wait forever.
Default value is 5000
.
@ g:iced#nrepl#eval#ignoring_vars_in_stacktrace
g:iced#nrepl#eval#ignoring_vars_in_stacktrace
A list of fully qualified symbols to except from stacktraces.
E.g.
g:iced#nrepl#eval#ignoring_vars_in_stacktrace = {
\ 'clojure.lang.AFn/applyTo',
\ 'clojure.lang.AFn/applyToHelper',
\ 'clojure.lang.AFn/run',
\ 'clojure.lang.Compiler/eval',
\ 'clojure.lang.RestFn/invoke',
\ 'clojure.lang.Var/applyTo',
\ 'clojure.main/repl',
\ }
Default value is []
.
See also vim-iced-stacktrace.
@ g:iced#paredit#slurp_max_depth
g:iced#paredit#slurp_max_depth
Maximum depth for slurping.
Default value is 5
.
g:iced#cljs#default_env
Environment used when :IcedStartCljsRepl is called with no argument.
Default value is 'figwheel'
.
g:iced#eval#inside_comment
If {v:true}, evaluate inside comment form.
Default value is v:true
.
See https://liquidz.github.io/vim-iced/#configuration_evaluation
g:iced#eval#mark_at_last
The mark to set last evaluated position.
It is recommended to use the mark which can be used by globally.
Default value is 1
.
@ g:iced#eval#values_to_skip_storing_register
g:iced#eval#values_to_skip_storing_register
Evaluated values not to store to numbered registers.
Default value is ['nil', 'true', 'false']
.
g:iced#eval#popup_highlight
The highlight setting for popup to display evaluated result.
Default value is 'Comment'
.
g:iced#eval#popup_align
The alignment setting for popup to display evaluated result.
The value must be one of 'after'
or 'right'
.
- 'after'
Place the result after the end of the line.
- 'right'
Place on the right edge of the window.
Default value is 'after'
.
g:iced#eval#popup_spinner_texts
g:iced#eval#popup_spinner_texts
Texts for spinners while code is evaluating.
Default value is [' ⠋',' ⠙',' ⠹',' ⠸',' ⠼',' ⠴',' ⠦',' ⠧',' ⠇',' ⠏']
.
See also vim-iced-evaluating-spinner.
@ g:iced#eval#popup_spinner_interval
g:iced#eval#popup_spinner_interval
Interval time for spinners while code is evaluating.
Unit is milli sec.
Default value is 100
.
See also vim-iced-evaluating-spinner.
@ g:iced#eval#keep_inline_result
g:iced#eval#keep_inline_result
If {v:true}, evaluation results displayed as popup are kept.
Default value is v:false
.
See :IcedClearInlineResult to clear results.
g:iced#buffer#error#height
Error window height.
Default value is 'previewheight'.
@ g:iced#debug#value_max_length
g:iced#debug#value_max_length
Max length to show value in debugging.
Negative value means no limitation.
Default value is -1
.
g:iced#promise#timeout_ms
Timeout time for waiting promises.
Unit is milli sec.
Default value is 3000
.
@ g:iced#related_ns#tail_patterns
g:iced#related_ns#tail_patterns
The namespace tailing pattern to decide the namespace is related or not.
This option is used by:IcedBrowseRelatedNamespace command.
Default value is ['', '-test', '-spec', '\.spec']
.
g:iced#test#spec_num_tests
Default num-tests for :IcedTestSpecCheck.
Default value is 10
.
g:iced#qf#height
Quickfix window height.
Default value is 5
.
g:iced#grep#prg
Program to use for the :IcedGrep command.
Format is same as 'grepprg'.
Default value is 'git grep --no-index -I --line-number --no-color'
.
g:iced#grep#format
Format to recognize for the :IcedGrep command output.
Format is same as 'grepformat'.
Default value is '%f:%l:%m,%f:%l%m,%f %l%m'
.
@ g:iced#refactor#prefix_rewriting
g:iced#refactor#prefix_rewriting
Should clean-ns
favor prefix forms in the ns macro?
cf. https://github.com/clojure-emacs/refactor-nrepl#available-features
Default value is v:false
.
@ g:iced#refactor#insert_newline_after_require
g:iced#refactor#insert_newline_after_require
If {v:true}, :IcedCleanNs place a newline after the :require
and :import
tokens.
Default value is v:true
.
@ g:iced#nrepl#auto#does_switch_session
g:iced#nrepl#auto#does_switch_session
If {v:true}, enable automatic switching CLJ/CLJS session.
This will be done by WinEnter auto command.
Default value is v:false
.
@ g:iced#nrepl#complete#ignore_context
g:iced#nrepl#complete#ignore_context
If {v:true}, the manipulation for completion ignores collecting contexts.
This means that results no longer includes information in contexts.
Enable this option only when you have a trouble with performance.
Default value is v:false
.
@ g:iced_enable_enhanced_cljs_completion
g:iced_enable_enhanced_cljs_completion
If {v:true}, enable enhanced ClojureScript completion.
Default value is v:false
.
g:iced#clap#options
Options for starting vim-clap
selector.
E.g. using fzf
as an external filter: ['++externalfilter=fzf', '+async']
Default value is []
.
@ g:iced#nrepl#path_translation
g:iced#nrepl#path_translation
Path translation rule dictionary.
It is useful when connecting to nREPL in docker container.
E.g.
let g:iced#nrepl#path_translation = {
\ '/root': $HOME,
\ }
Default value is {}
.
See also vim-iced-install-docker.
@ g:iced_enable_enhanced_definition_extraction
g:iced_enable_enhanced_definition_extraction
If {v:true}, enable enhanced source extraction.
This feature will extract source by let
form also.
Default value is v:true
.
See also g:iced#nrepl#source#finding_max_depth.
WARNING:
Enhanced source extraction requires borkdude/jet
.
https://github.com/borkdude/jet
vim-iced will confirm you to install jet
automatically If not installed.
@ g:iced#nrepl#source#finding_max_depth
g:iced#nrepl#source#finding_max_depth
Max depth for finding source.
This value is used on enhanced source extraction.
Default value is 3
.
See also g:iced_enable_enhanced_definition_extraction.
@ g:iced#repl#babashka_repl_type
g:iced#repl#babashka_repl_type
REPL type of server launching by babashka.
'socket'
or 'nrepl'
can be set.
Default value is 'nrepl'
.
g:iced_cache_directory
Path to store cached files.
If a empty string is specified, the following path is used.
- macOS : $HOME/Library/Caches/vim-iced
- Others : $XDG_CACHE_HOME/vim-iced
or $HOME/.cache/vim-iced
Default value is ''
.
@ g:iced_enable_clj_kondo_analysis
g:iced_enable_clj_kondo_analysis
If {v:true}, enable clj-kondo's analysis.
If clj-kondo
is not installed, will install automatically.
Default value is v:false
.
See also vim-iced-static-analysis-clj-kondo.
@ g:iced_enable_clj_kondo_local_analysis
g:iced_enable_clj_kondo_local_analysis
If {v:true}, enable clj-kondo's local analysis.
If clj-kondo
is not installed, will install automatically.
Default value is v:false
.
See also vim-iced-static-analysis-clj-kondo.
@ g:iced_clj_kondo_analysis_dirs
g:iced_clj_kondo_analysis_dirs
If some values are set, vim-iced uses these directories for analysis
by clj-kondo.
If this option is empty, vim-iced uses the project root directory.
Default value is []
.
@ g:iced#navigate#prefer_local_jump
g:iced#navigate#prefer_local_jump
If {v:true}, change the behavior of :IcedDefJump to prefer local jumping.
Default value is v:false
.
@ g:iced#navigate#jump_fallback_command
g:iced#navigate#jump_fallback_command
A fallback command when jumping definition is failed.
E.g.
let g:iced#navigate#jump_fallback_command =
\ ':call CocAction("jumpDefinition")'
Default value is ''
.
g:iced#ns#class_map
Custom class mappings for :IcedAddMissing command.
E.g.
let g:iced#ns#class_map = {
\ "foo.bar": ["Baz"],
\ "java.sql": ["Timestamp"],
\ }
Default value is {}
.
g:iced#selector#external
Dictionary to define external selectors.
The key of dictionary is a selector name for
specifying g:iced#selector#search_order.
The value of dictionary is a selector definition as follows.
E.g.
let g:iced#selector#external = {
\ 'selector_name': {'runtimepath': '/path/to/external/plugin',
\ 'run': {config -> your_function(config)}},
\ }
Default value is {}
.
@ g:iced#selector#search_order
g:iced#selector#search_order
Search order for installed selectors.
vim-iced will search runtimepath with this order,
and use the first one found.
Default value is ['crlp','fzf','clap']
.
If you'd like to use a specific selector, you can set like below.
let g:iced#selector#search_order = ['clap']
@ g:iced#nrepl#ns#refresh_before_fn
g:iced#nrepl#ns#refresh_before_fn
A qualified function name to evaluate before :IcedRefresh.
The function should be zero-arity.
E.g.
let g:iced#nrepl#ns#refresh_before_fn = 'user/stop'
Default value is ''
. (Not to evaluate)
@ g:iced#nrepl#ns#refresh_after_fn
g:iced#nrepl#ns#refresh_after_fn
A qualified function name to evaluate after :IcedRefresh.
The function should be zero-arity.
E.g.
let g:iced#nrepl#ns#refresh_after_fn = 'user/start'
Default value is ''
. (Not to evaluate)
@ g:iced#nrepl#ns#does_load_for_new_ns
g:iced#nrepl#ns#does_load_for_new_ns
If {v:true}, vim-iced will load whole file contents when entering new
namespaces.
Otherwise, vim-iced will evaluate only ns
form.
NOTE: For Midje user, loading ns leads running tests.
So Midje users should set v:false.
https://github.com/marick/Midje
Default value is v:true
.
------------------------------------------------------------------------------
@STDOUT BUFFER vim-iced-customizing-stdout-buffer
g:iced#buffer#stdout#mods
Buffer position definition.
Following values are supported.
- {vertical}
- {leftabove}
- {aboveleft}
- {rightbelow}
- {belowright}
- {topleft}
- {botright}
g:iced#buffer#stdout#file
If not empty, vim-iced write stdout buffer content to the file path.
Default value is ''
.
See also g:iced#buffer#stdout#file_buffer_size.
@ g:iced#buffer#stdout#file_buffer_size
g:iced#buffer#stdout#file_buffer_size
Max line count to buffer for g:iced#buffer#stdout#file.
Default value is 256
.
@ g:iced#buffer#stdout#max_line
g:iced#buffer#stdout#max_line
Max line count to keep in stdout buffer.
If negative number is setted, it means no limit.
Default value is -1
.
@ g:iced#buffer#stdout#deleting_line_delay
g:iced#buffer#stdout#deleting_line_delay
Delay time for deleting excess lines in stdout buffer.
Unit is milli sec.
This option is enabled when g:iced#buffer#stdout#max_line is a positive
number.
Default value is 1000
.
@ g:iced#buffer#stdout#enable_notify
g:iced#buffer#stdout#enable_notify
If {v:true}, display standard outputs on popup notification.
Default value is v:true
.
g:iced#buffer#stdout#size
If specified, stdout buffer will be opened with the specified size.
Otherwise, opened with the half size of the current window.
Default value is v:null
.
@ g:iced#buffer#stdout#enable_delimiter
g:iced#buffer#stdout#enable_delimiter
If {v:true}, a delimiter line is appended after specified delays.
See followings for delimiter line and delay:
- g:iced#buffer#stdout#delimiter_delay
- g:iced#buffer#stdout#delimiter_line
Default value is v:true
.
@ g:iced#buffer#stdout#delimiter_delay
g:iced#buffer#stdout#delimiter_delay
A delay time for g:iced#buffer#stdout#enable_delimiter.
Unit is milli sec.
Default value is 500
.
@ g:iced#buffer#stdout#delimiter_line
g:iced#buffer#stdout#delimiter_line
A delimiter line for g:iced#buffer#stdout#enable_delimiter.
Default value is ';; ----------'
.
------------------------------------------------------------------------------
@FORMATTER vim-iced-customizing-formatter
g:iced_formatter
Formatter name.
Following formatters can be used.
- default
Default formatter powered by cljfmt.
- cljstyle
https://github.com/greglook/cljstyle
If cljstyle is not installed, will install automatically.
- zprint
https://github.com/kkinnear/zprint
If zprint is not installed, will install automatically.
- joker
https://github.com/candid82/joker
If joker is not installed, will install automatically.
------------------------------------------------------------------------------
@INDENT RULES vim-iced-customizing-indents
g:iced#format#rule
Cljfmt's formatting rule.
See https://github.com/weavejester/cljfmt#indentation-rules
let g:iced#format#rule = {
\ 'merr.core/let': '[[:block 2] [:inner 1]]',
\ }
@ vim-iced-customizing-tonsky-rule
TONSKY'S RULE
See http://tonsky.me/blog/clojurefmt/ .
You can use this rule with cljfmt and cljstyle.
- cljfmt
let g:iced#format#rule = {'#"^\w"': '[[:inner 0]]'}
- cljstyle
Add following :indents
setting to your .cljstyle
.
{
:indents ^:replace {#"^\w" [[:inner 0]]}
}
g:iced#format#options
Extra configuration map for cljfmt.
cf. https://github.com/weavejester/cljfmt#configuration
Default value is {}
.
e.g.
let g:iced#format#options = {
\ 'remove-consecutive-blank-lines?': v:false,
\ 'remove-multiple-non-indenting-spaces?': v:true,
\ }
------------------------------------------------------------------------------
@DOCUMENTS vim-iced-customizing-documents
g:iced#buffer#document#mods
Buffer position definition.
Following values are supported.
- {vertical}
- {leftabove}
- {aboveleft}
- {rightbelow}
- {belowright}
- {topleft}
- {botright}
@ g:iced#buffer#document#height
g:iced#buffer#document#height
Document window height.
Default value is 'previewheight'.
@ g:iced#buffer#document#does_update_automatically
g:iced#buffer#document#does_update_automatically
If {v:true} and document buffer is visible,
update document buffer with document for the form under cursor.
Default value is v:false
.
@ g:iced#clojuredocs#export_edn_url
g:iced#clojuredocs#export_edn_url
The URL exported from ClojureDocs.
EDN format file is expected.
Default value is https://github.com/clojure-emacs/clojuredocs-export-edn/raw/master/exports/export.compact.edn
.
@ g:iced#clojuredocs#use_clj_docs_on_cljs
g:iced#clojuredocs#use_clj_docs_on_cljs
If {v:true}, use Clojure documents instead of ClojureScript.
Default value is v:false
.
See also g:iced#clojuredocs#cljs_ns_replace_map.
@ g:iced#clojuredocs#cljs_ns_replace_map
g:iced#clojuredocs#cljs_ns_replace_map
The namespace conversion table for g:iced#clojuredocs#use_clj_docs_on_cljs
option.
Default value is {'cljs.core': 'clojure.core'}
.
@ vim-iced-customizing-auto-document
AUTO DOCUMENT
g:iced_enable_auto_document
Enable automatic displaying one-line document.
This will be done by CursorMoved / CursorMovedI auto command and timer.
NOTE: This feature won't work when popup menu is visible.
The value should be one of 'normal'
, 'insert'
or 'any'
.
Otherwise, this option will be disabled.
'normal'
: Enabled on only normal mode.
'insert'
: Enabled on only insert mode.
'every'
: Enabled on normal and insert mode.
Default value is 'none'
.
See also:
- g:iced_enable_popup_document
- g:iced#nrepl#auto#document_delay
@ g:iced_enable_popup_document
g:iced_enable_popup_document
Display documents on popup window.
The value should be one of follows.
Otherwise, this option will be disabled.
'full'
: Enabled on only full document.
:IcedDocumentOpen shows full document.
'one-line'
: Enabled on only one-line document.
'every'
: Every enabled.
Default value is 'every'
.
@ g:iced_max_distance_for_auto_document
g:iced_max_distance_for_auto_document
Max line distance to display one-line document.
See also g:iced_enable_auto_document.
Default value is 2
.
@ g:iced#nrepl#auto#document_delay
g:iced#nrepl#auto#document_delay
Delay time for displaying one-line document.
Unit is milli sec.
Default value is 500
.
g:iced#util#pumvisible_fn
The function to check whether popup menu is visible or not.
Default value is function('pumvisible')
.
------------------------------------------------------------------------------
@AUTO INDENT vim-iced-customizing-auto-indent
g:iced_enable_auto_indent
If {v:true}, enable indenting automatically.
Default value is v:true
.
See details: vim-iced-indenting.
------------------------------------------------------------------------------
@SIGNS vim-iced-customizing-signs
g:iced_sign
Sign setting.
vim-iced provides following signs.
- iced_error (for test failure position)
- iced_trace (for tracing var position)
Each sign has default setting as follows.
{
'error': '🔥',
'trace': '👁',
'errorhl': 'ErrorMsg',
'tracehl': 'Search',
}
You can change the setting by g:iced_sign
variable.
E.g. changing sign text
let g:iced_sign = {'error': 'E', 'trace': 'T'}
------------------------------------------------------------------------------
@COMMAND PALETTES vim-iced-customizing-palette
g:iced#palette
User custom commands.
E.g. define command palette to start cljs REPL
let g:iced#palette = {
\ 'foo bar': ':IcedEvalRepl (cljs-repl)'
\ }
------------------------------------------------------------------------------
@HOOKS vim-iced-customizing-hooks
g:iced#hook
Hook setting.
This is a dictionary with hook event as a key,
and the value is a dictionary or a list of dictionaries.
E.g.
let g:iced#hook = {
\ 'test_finished': {
\ 'type': 'shell',
\ 'exec': {v -> printf('tmux display-message "%s"', v.summary)}},
\ 'disconnected': [{
\ 'type': 'function',
\ 'exec': {_ -> s:do_something()}}],
\ }
Another way, you can also use iced#hook#add
function to add definitions.
call iced#hook#add('disconnected', {
\ 'type': 'command',
\ 'exec': 'echom "hello"',
\ })
- Hook events
- connect_prepared hook_event_connect_prepared
- connecting hook_event_connecting
- connected hook_event_connected
- disconnected hook_event_disconnected
- test_finished hook_event_test_finished
- ns_required hook_event_ns_required
- ns_all_reloaded hook_event_ns_all_reloaded
- session_switched hook_event_session_switched
- eval_prepared hook_event_eval_prepared
- evaluated hook_event_evaluated
- Hook report types
- shell hook_report_shell
- eval hook_report_eval
- function hook_report_function
- command hook_report_command
@CONNECT PREPARED hook_event_connect_prepared
Hooked before the start of connection.
This hook only allows function
hook type.
Following list is passed to reporter.
e.g. [{'label': 'nREPL', 'type': 'nrepl', 'port': 12345}]
Reporter should return a list of dictionary which has same parameters.
@CONNECTING hook_event_connecting
Hooked just before connecting.
Following parameters are passed to reporter.
- host
Host name to connect.
- port
Port number to connect.
If any hook functions return {'cancel': 'message'}
,
vim-iced will cancel to connect.
@CONNECTED hook_event_connected
Hooked when vim-iced is connected to nREPL.
No parameters are passed to reporter.
@DISCONNECTED hook_event_disconnected
Hooked when vim-iced is disconnected from nREPL.
No parameters are passed to reporter.
@TEST FINISHED hook_event_test_finished
Hooked when running test is finished.
Following parameters are passed to reporter.
- result
Test result. "succeeded" or "failed".
- summary
Test summary.
@NS REQUIRED hook_event_ns_required
Hooked when :IcedRequire
is finished.
@NS ALL RELOADED hook_event_ns_all_reloaded
Hooked when :IcedRequireAll
is finished.
@SESSION SWITCHED hook_event_session_switched
Hooked when current session is switched.
Following parameters are passed to reporter.
- session
Destination session type. "clj" or "cljs".
@EVAL PREPARED hook_event_eval_prepared
Hooked before the start of evaluation.
Following parameters are passed to reporter.
- code
Evaluation code.
- option
Evaluation option.
This option contains id
, file
, line
, column
, verbose
and so on.
@EVALUATED hook_event_evaluated
Hooked after evaluation.
Following parameters are passed to reporter.
- result
Result map respnsed by nREPL server.
This map contains id
, status
, ns
, value
and so on.
- option
Evaluation option.
This option contains line
, column
, verbose
, code
and so on.
------------------------------------------------------------------------------
@POPUP WINDOW vim-iced-customizing-popup-window
g:iced#popup#time
Auto closing time(ms) for popup window.
Default value is 3000
.
g:iced#popup#max_height
Max height for popup window.
Default value is 50
.
@ g:iced#popup#neovim#winhighlight
g:iced#popup#neovim#winhighlight
winhighlight
option for floating window in Neovim.
- https://neovim.io/doc/user/options.html#'winhighlight'
Default value is 'Normal:NormalFloat'
.
g:iced#popup#neovim#style
style
option for floating window in Neovim.
- https://neovim.io/doc/user/api.html#nvim_open_win()
Default value is 'minimal'
.
------------------------------------------------------------------------------
@NOTIFICATION vim-iced-customizing-notification
@ g:iced#notify#max_height_rate
g:iced#notify#max_height_rate
Ratio of the notification area to the window height.
Default value is 0.2
.
@ g:iced#notify#max_width_rate
g:iced#notify#max_width_rate
Ratio of the notification area to the window width.
Default value is 0.3
.
------------------------------------------------------------------------------
@DEFAULT KEYS vim-iced-customizing-default-keys
PREFIXES
- <Leader>e: Evaluating
- <Leader>t: Testing
- <Leader>s: Stdout buffer
- <Leader>r: Refactoring
- <Leader>h: Help/Document
- <Leader>b: Browsing
- <Leader>j: Jumping cursor
@ g:iced_default_key_mapping_leader
g:iced_default_key_mapping_leader
<Leader> key for default key mappings.
If you'd like to use <LocalLeader> instead of <Leader>,
please set as follows:
let g:iced_default_key_mapping_leader = '<LocalLeader>'
Default value is '<Leader>'
.
@ g:iced_enable_default_key_mappings
g:iced_enable_default_key_mappings
If {v:true}, apply following mappings.
{mode} {lhs} {rhs}
------ ----------- ---------------------------------------------------
n <Leader>' <Plug>(iced_connect)
n <Leader>" <Plug>(iced_jack_in)
n <Leader>ei <Plug>(iced_eval)<Plug>(sexp_inner_element)``
n <Leader>ee <Plug>(iced_eval)<Plug>(sexp_outer_list)``
n <Leader>ece <Plug>(iced_eval_in_context)<Plug>(sexp_outer_list)``
n <Leader>et <Plug>(iced_eval_outer_top_list)
n <Leader>ea <Plug>(iced_eval_at_mark)
n <Leader>el <Plug>(iced_eval_last_outer_top_list)
n <Leader>en <Plug>(iced_eval_ns)
v <Leader>ee <Plug>(iced_eval_visual)
n <Leader>ep <Plug>(iced_print_last)
n <Leader>eb <Plug>(iced_require)
n <Leader>eB <Plug>(iced_require_all)
n <Leader>eu <Plug>(iced_undef)
n <Leader>eU <Plug>(iced_undef_all_in_ns)
n <Leader>eq <Plug>(iced_interrupt)
n <Leader>eQ <Plug>(iced_interrupt_all)
n <Leader>eM <Plug>(iced_macroexpand_outer_list)
n <Leader>em <Plug>(iced_macroexpand_1_outer_list)
n <Leader>enr <Plug>(iced_refresh)
n <Leader>tt <Plug>(iced_test_under_cursor)
n <Leader>tl <Plug>(iced_test_rerun_last)
n <Leader>ts <Plug>(iced_test_spec_check)
n <Leader>to <Plug>(iced_test_buffer_open)
n <Leader>tn <Plug>(iced_test_ns)
n <Leader>tp <Plug>(iced_test_all)
n <Leader>tr <Plug>(iced_test_redo)
n <Leader>ss <Plug>(iced_stdout_buffer_toggle)
n <Leader>so <Plug>(iced_stdout_buffer_open)
n <Leader>sl <Plug>(iced_stdout_buffer_clear)
n <Leader>sq <Plug>(iced_stdout_buffer_close)
n <Leader>rcn <Plug>(iced_clean_ns)
n <Leader>rca <Plug>(iced_clean_all)
n <Leader>raa <Plug>(iced_add_arity)
n <Leader>ram <Plug>(iced_add_missing)
n <Leader>ran <Plug>(iced_add_ns)
n <Leader>rtf <Plug>(iced_thread_first)
n <Leader>rtl <Plug>(iced_thread_last)
n <Leader>ref <Plug>(iced_extract_function)
n <Leader>rml <Plug>(iced_move_to_let)
n <Leader>rrs <Plug>(iced_rename_symbol)
n K <Plug>(iced_document_popup_open)
n <Leader>hb <Plug>(iced_document_open)
n <Leader>hu <Plug>(iced_use_case_open)
n <Leader>hn <Plug>(iced_next_use_case)
n <Leader>hN <Plug>(iced_prev_use_case)
n <Leader>hq <Plug>(iced_document_close)
n <Leader>hs <Plug>(iced_source_popup_show)
n <Leader>hS <Plug>(iced_source_show)
n <Leader>hc <Plug>(iced_clojuredocs_open)
n <Leader>hh <Plug>(iced_command_palette)
n <Leader>bn <Plug>(iced_browse_related_namespace)
n <Leader>bs <Plug>(iced_browse_spec)
n <Leader>bt <Plug>(iced_browse_test_under_cursor)
n <Leader>br <Plug>(iced_browse_references)
n <Leader>bd <Plug>(iced_browse_dependencies)
n <C-]> <Plug>(iced_def_jump)
n <Leader>jn <Plug>(iced_jump_to_next_sign)
n <Leader>jN <Plug>(iced_jump_to_prev_sign)
n <Leader>jl <Plug>(iced_jump_to_let)
n <Leader>dbt <Plug>(iced_browse_tapped)
n <Leader>dlt <Plug>(iced_clear_tapped)
n <Leader>* <Plug>(iced_grep)
n <Leader>/ :<C-u>IcedGrep<Space>
n <Leader>yn <Plug>(iced_yank_ns_name)
n == <Plug>(iced_format)
n =G <Plug>(iced_format_all)
==============================================================================
@CHANGELOG vim-iced-changelog
See https://github.com/liquidz/vim-iced/blob/master/CHANGELOG.adoc
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0: