From fabad863a15aad95b320ba24a9ecb487c6276ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Wed, 1 Dec 2021 14:04:59 +0100 Subject: [PATCH] Add easy fireplace connect command for non lein projects --- symlinks/config/nvim/after/ftplugin/clojure.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/symlinks/config/nvim/after/ftplugin/clojure.vim b/symlinks/config/nvim/after/ftplugin/clojure.vim index fa15b9a..621312c 100644 --- a/symlinks/config/nvim/after/ftplugin/clojure.vim +++ b/symlinks/config/nvim/after/ftplugin/clojure.vim @@ -1,2 +1,11 @@ setlocal ts=2 sts=2 sw=2 expandtab autoindent let b:undo_ftplugin .= '|setlocal ts< sts< sw< expandtab< autoindent<' + +function s:FireplaceStartAndConnect() + let port = luaeval('math.random(35000, 39999)') + silent execute "Dispatch lein repl :start :port " . l:port + sleep 3 + execute "FireplaceConnect nrepl://localhost:" . l:port +endfunction + +command! -nargs=0 FireplaceStartLeinRepl call FireplaceStartAndConnect()