Skip to content

Commit 65c4965

Browse files
committed
Script plugin debug environment with Tmux
1 parent 874cf10 commit 65c4965

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

TODO

+7-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@ TODO alpha
4343
Then trying an ,eb doesn't fail gracefully
4444
->Exception in logs, current-connection still nil?
4545
[_] Script debugging
46-
open nvim w/ NVIM_LISTEN_ADDRESS
47-
can we source debug vimscript from CLI?
48-
start repl to clojure-socketrepl.nvim on 5555
49-
load a ns which calls `user/go` to localhost 7777
46+
[X] nvim listening to socket, sourced debug script
47+
[X] plugin process running a repl
48+
[X] automatically connect to nvim, with socketrepl main
49+
[X] another clojure process w/ socket repl on 5555
50+
[_] docs
51+
You still have to :Connect from nvim
52+
[_] Enhance debugging
5053
How to reset state?
5154
repl, rerun `connect!`, maybe just `go`
5255
nvim channel 1 will be fubar, how to replace?

plugin/socketrepl.vim.debug

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
let s:p_dir = expand('<sfile>:p:h')
21
let g:is_running = 0
32
let g:channel = -1
43

run-dev.sh

-20
This file was deleted.

tmux-run-dev.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Development run script #
2+
3+
# Generate .classpath from Leiningen if project.clj has changed.
4+
if [[ project.clj -nt .classpath ]]; then
5+
lein classpath > .classpath
6+
fi
7+
8+
tmux new-window -n 'nvim-debug'
9+
tmux send-keys "NVIM_LISTEN_ADDRESS=127.0.0.1:7777 nvim -S plugin/socketrepl.vim.debug" C-m
10+
tmux split
11+
tmux send-keys 'exec java -cp "$(cat .classpath)" clojure.main' C-m
12+
tmux send-keys '(println "Plugin repl connecting to nvim")' C-m
13+
tmux send-keys '(go)' C-m
14+
tmux split
15+
tmux send-keys 'exec java -cp "$(cat .classpath)" -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl :server-daemon false}" clojure.main' C-m
16+
tmux send-keys '(println "Socket repl server on 5555")' C-m
File renamed without changes.

0 commit comments

Comments
 (0)