vim-iced plugin to add support for multi session.
vim-iced basically only supports connections to a single nREPL server. But if you use shadow-cljs, for example, to run backend and frontend nREPL server separately in the same project, you’ll need to launch 2 vim/nvim to connect them. It’s pain.
This plugin supports multiple nREPL connections from a single vim/nvim by allowing you to store and switch between multiple nREPL sessions.
Basically, only you should do is executing IcedConnect
command as before.
vim-iced can select a REPL port to connect when Clojure project and ClojureScript project(e.g. shadow-cljs) REPLs are up. This plugin hooks the connection process, and manages multiple REPL connections.
This plugin primarily targets connecting to 2 REPLs: Clojure and ClojureScript projects.
With g:iced_multi_session#does_switch_session
option, this plugin automatically switches the connecting REPL when the connecting REPL is not matched to the file extension on current buffer.
If you’d like to connect to 3 or more REPLs or switch the REPL more strictly, g:iced_multi_session#definitions
option is recommended.
This plugin provides following commands, and these are added to the command palette automatically.
Command | Note |
---|---|
|
Create a new session. |
|
Switch to the next session. If the current session is the last, switch to first one. |
|
Display all session names. |
|
Swith to the selected session. |
|
Rename the current session name. |
Option | Default | Note |
---|---|---|
|
|
If |
|
|
The prefix string for new session name. |
|
|
Session definitions in current project. /path/to/your/project/root/.local.vimrc
let g:iced_multi_session#definitions = [
\ {'port_file': printf('%s/.nrepl-port', expand('<sfile>:p:h')),
\ 'path': 'src/',
\ 'name': 'web'},
\ {'port_file': printf('%s/.shadow-cljs/nrepl.port', expand('<sfile>:p:h')),
\ 'path': 'src-cljs/',
\ 'name': 'cljs'},
\ ] |
Function | Note |
---|---|
|
Returns a string which describe current session status.
e.g. This function can be used for showing session status on statusline. The following is a example configuration for lightline.vim. let g:lightline = {
\ 'active': {
\ 'left': [ ... ],
\ 'right': [ ... ['iced_multi_session'], ... ]
\ },
\ 'component_function': {
\ 'iced_multi_session': 'iced_multi_session#current',
\ },
\ } |
-
vim-iced (
3.4.0
or later)
Copyright (c) 2020-2021 Masashi Iizuka
Distributed under the MIT License.