File tree Expand file tree Collapse file tree 3 files changed +41
-10
lines changed Expand file tree Collapse file tree 3 files changed +41
-10
lines changed Original file line number Diff line number Diff line change @@ -17,30 +17,35 @@ adding the following JVM options to any Clojure application.
17
17
-Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}"
18
18
```
19
19
20
- Then, from within Neovim, connect to the socket repl.
20
+ Create a buffer for displaying interaction with the repl.
21
21
22
22
```
23
- :Connect <host> <port>
23
+ <leader>rlog
24
24
```
25
25
26
- Create a buffer for displaying interaction with the repl.
26
+ From there, to eval any buffer or form under cursor use:
27
27
28
28
```
29
- :vnew
30
- :ReplLog
29
+ <leader>eb
31
30
```
32
31
33
- From there, to eval any buffer or form under cursor use:
32
+ or
34
33
35
34
```
36
- :EvalBuffer
35
+ <leader>ef
37
36
```
38
37
39
- or
38
+ Note that the above leader-based mappings can be disabled by setting
39
+ ` g:disable_socket_repl_mappings ` to ` 1 ` in your .vimrc. The following commands
40
+ are available to create your own mappings:
40
41
41
42
```
42
- :EvalCode
43
+ :EvalBuffer
44
+ :EvalForm
45
+ :ReplLog
43
46
```
47
+ Unlike the ` <leader>rlog ` mapping, the ` :ReplLog ` command simply adds the repl
48
+ log to the current pane.
44
49
45
50
TODO: demo video
46
51
Original file line number Diff line number Diff line change @@ -41,4 +41,17 @@ function! ReplLog()
41
41
endfunction
42
42
command ! ReplLog call ReplLog ()
43
43
44
- echo ' prod socket repl plugin loaded!'
44
+ if ! exists (' g:disable_socket_repl_mappings' )
45
+ nnoremap <leader> eb :EvalBuffer<cr>
46
+ nnoremap <leader> ef :EvalCode<cr>
47
+
48
+ function ! ShowLog ()
49
+ vnew
50
+ ReplLog
51
+ norm
52
+ norm
53
+ endfunction
54
+ nnoremap <leader> rlog :call ShowLog()<cr>
55
+ endif
56
+
57
+ echo ' socket repl plugin loaded!'
Original file line number Diff line number Diff line change @@ -25,4 +25,17 @@ function! ReplLog()
25
25
endfunction
26
26
command! ReplLog call ReplLog()
27
27
28
+ if !exists('g:disable_socket_repl_mappings')
29
+ nnoremap <leader>eb :EvalBuffer<cr>
30
+ nnoremap <leader>ef :EvalCode<cr>
31
+
32
+ function! ShowLog()
33
+ vnew
34
+ ReplLog
35
+ norm
36
+ norm
37
+ endfunction
38
+ nnoremap <leader>rlog :call ShowLog()<cr>
39
+ endif
40
+
28
41
echo 'debug socket repl plugin loaded!'
You can’t perform that action at this time.
0 commit comments