Comments (5)
Slimv does not have any built-in support for encrypted communication between vim and the swank server. I think tunneling may work, but TBH I have never tried it. By default the swank server is using port 4005 (see slime/start-swank.lisp
). So I think if you:
- manually start the swank server on the remote machine (e.g.
sbcl --load start-swank.lisp
for sbcl) - create an ssh tunnel on your local machine that forwards remote port 4005 (or whatever port you configured for the remote swank)
- configure your local port used by the ssh tunnelling in your .vimrc (see
g:swank_port
)
then slimv might be able to connect to the remote swank server.
from slimv.
At least for Common Lisp, SSH forwarding works. It's partially documented on the CL cookbook: https://lispcookbook.github.io/cl-cookbook/debugging.html#remote-debugging
In one of my experimental use cases, I ship a binary exe to my server and it serves some web pages with hunchentoot. In its loader I make sure to load and init swank (I don't think this is needed if instead you're using ASDF and specify :swank as a dependency)
(load "~/.vim/bundle/slimv/slime/swank-loader.lisp")
(swank-loader:init :delete nil
:reload nil
:load-contribs nil)
and I start it at the same time as I start my hunchentoot server:
(defvar *acceptor*) ; hunchentoot handle
(defun start-server (port)
; sorry, I don't remember why I initially included these and then commented them out
;(setf swank:*use-dedicated-output-stream* nil)
;(setf swank:*communication-style* :fd-handler)
; the key line:
(swank:create-server :dont-close t)
; hunchentoot only:
(setf *acceptor*
(start (make-instance 'easy-acceptor :port port))))
After that, I launch the exe on the server in a screen session, and I can later connect with ssh -C -L4005:127.0.0.1:4005 myserver
and so long as I don't have anything locally slimv's ,c
will connect to the remote program and I can inspect and recompile stuff and so on.
from slimv.
At least for Common Lisp, SSH forwarding works. It's partially documented on the CL cookbook: https://lispcookbook.github.io/cl-cookbook/debugging.html#remote-debugging
In one of my experimental use cases, I ship a binary exe to my server and it serves some web pages with hunchentoot. In its loader I make sure to load and init swank (I don't think this is needed if instead you're using ASDF and specify :swank as a dependency)
(load "~/.vim/bundle/slimv/slime/swank-loader.lisp") (swank-loader:init :delete nil :reload nil :load-contribs nil)and I start it at the same time as I start my hunchentoot server:
(defvar *acceptor*) ; hunchentoot handle (defun start-server (port) ; sorry, I don't remember why I initially included these and then commented them out ;(setf swank:*use-dedicated-output-stream* nil) ;(setf swank:*communication-style* :fd-handler) ; the key line: (swank:create-server :dont-close t) ; hunchentoot only: (setf *acceptor* (start (make-instance 'easy-acceptor :port port))))After that, I launch the exe on the server in a screen session, and I can later connect with
ssh -C -L4005:127.0.0.1:4005 myserver
and so long as I don't have anything locally slimv's,c
will connect to the remote program and I can inspect and recompile stuff and so on.
I am trying to run two sbcl and two image. The program use 4545 to isolate the two swank. I am using slimv and remote ssh ok. But can this be done in two images with different port. In particular how can my gvim found the right swank.
the advice is to use .vimrc but there is only one per vim, wonder how and whether one can use two swank ports for two different sbcl images.
Thank in advance again for any advice.
from slimv.
Maybe this approach could work: override the g:swank_port
option before opening the REPL buffer.
Define two separate key mappings (e.g. ,1
and ,2
) for opening the swank server on two different ports:
:noremap <silent> ,1 :let g:swank_port=4545 <bar> call SlimvConnectServer()<CR>
:noremap <silent> ,2 :let g:swank_port=4546 <bar> call SlimvConnectServer()<CR>
Then open swank on port 4545 by pressing ,1
and open swank on port 4546 by pressing ,2
.
from slimv.
Thanks. Thanks and thanks. All goods!!!!!!
TL;dr
All good, except I use nmap. (I know nothing about vim but somehow the as the command noremap just not working; I check this https://stackoverflow.com/questions/3776117/what-is-the-difference-between-the-remap-noremap-nnoremap-and-vnoremap-mapping and as there is something call nmap I just try that. I guess I need to investigate a bit more; but it is not my focus).
That do the job and may I as a novice to this, add some conceptual and operational note. In particular, the key is your note on "before the REPL"
Let us concentrate on the second part
:let g:swank_port=4545 call SlimvConnectServer()
vim will use that to connect to a different swank server by a different sbcl image. Hence, one has to do the in-package etc. anew.
The nmap is to map the keyboard using the lead-character "," in slimv case. It map ,1 to 4545 port (and you can see a message in the real to reflect this).
Typing this down as this is so far of my conceptual scope that I really ensure I can understand this a few months later. I think I need to re-fresh my understanding of load-compile-executive plus vim-repl-image ...
(P.S. It is like "ssh -C -L4005:127.0.0.1:4005 myserver" is so strange it is only last week I aware that I do not need to expose my web server on the Internet for my testing. I can just tunnel my SSH to 8080 from local host to AWS! I only aware the similarity, after re-reading this post. )
Sorry for such a long post. Just to say my gratitude if you read to here. Just to say again all thanks!!!!
from slimv.
Related Issues (20)
- Add option to disable slimv indent plugins HOT 1
- Slimv not working with sbcl 2.1.0 HOT 4
- mit-scheme doesn't work anymore HOT 2
- Slimv with which-key HOT 5
- Attempting to slurp a string on the last line barfs instead HOT 1
- Eval and replaced evaluated form with result HOT 2
- Show describe-symbol in new buffer HOT 1
- iskeyword conflict with vim-racket HOT 3
- Don't display escape characters in REPL HOT 5
- Slimv fails to autodetect mit-scheme and manual swank initiation fails too. HOT 3
- SlimvArglist does not handle context like for make-instance HOT 1
- [SOLVED] Unable to start swank server in NixOS HOT 8
- Installation via Plugin Manager? HOT 6
- Messages from xdg-open displayed in editor
- Slimv hangs after connecting to SWANK. HOT 8
- Evaluate expression command making new line before evaluating HOT 15
- Space as slimv_leader HOT 1
- package-local-nicknames support HOT 3
- Notice: slime-v2.28 is not compatible and causes slimv to appear to hang after trying to print a string HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slimv.