Fork me on GitHub
#conjure
<
2023-01-05
>
armed05:01:24

Hello everyone, I created a little helper tool that finds all .nrepl-port files in my projects dir and lists them in the telescope picker. It calls :ConjureConnect on the selected item. I want to highlight a picker item that I’m already connected to. How to get the current session’s nrepl port number or better nrepl file path via conjure API?

Proctor14:01:33

looks like it also gives the host, so you can make sure it is the current host as well an not a remote host connection

Braden Shepherdson15:01:53

ooh! I've been wanting this for juggling JVM nrepl and shadow-cljs node repls. this would be a lot nicer than my current workflow of :!cat .shadow-cljs/nrepl.port, memorize it, :ConjureConnect $port, with about a 70% memory success rate >_> (tangentially, :ConjureClientState default|cljs is awesome for switching between them; I've added <localleader>td and <ll>tj bindings for those. it's so slick!)

armed15:01:53

@US03ZP2F5 thanks, that I was looking for @UCY0GT0QM It is around 40 lines of lua, feel free to grab from my dots https://github.com/armed/dotfiles/blob/master/nvim/lua/config/tools/nrepl-finder.lua

armed15:01:57

Just change root directory