This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-22
Channels
- # aws (12)
- # babashka (24)
- # beginners (51)
- # biff (2)
- # cherry (4)
- # cider (2)
- # clj-kondo (4)
- # cljs-dev (19)
- # clojure (70)
- # clojure-australia (4)
- # clojure-europe (39)
- # clojure-nl (4)
- # clojure-norway (6)
- # clojure-spec (9)
- # clojurescript (21)
- # component (6)
- # cursive (18)
- # data-science (9)
- # datomic (18)
- # events (2)
- # expound (4)
- # fulcro (15)
- # graalvm (2)
- # graphql (5)
- # jobs (1)
- # juxt (2)
- # leiningen (8)
- # malli (4)
- # meander (21)
- # nrepl (3)
- # observability (14)
- # off-topic (49)
- # other-languages (1)
- # pathom (13)
- # pedestal (7)
- # rdf (5)
- # re-frame (10)
- # reitit (1)
- # sql (4)
- # squint (30)
- # tools-deps (1)
- # vim (11)
Does anyone know how to get Cider/Emacs eval-in-context functionality in vim? It's a binding that allows you to set some values before evaluating a form, and re-using them later. Can't find any docs for it, but there's a bit of info https://clojurians.slack.com/archives/C053AK3F9/p1661180273024399?thread_ts=1661168165.432639&cid=C053AK3F9. I'm using vim-iced, and I don't think it has this feature, but I'm curious if it exists at all in the vim landscape.
I don't see anything for this in #conjure and I don't remember it from my fireplace days. Looks like emacs special sauce
I just bound a https://github.com/walterl/dotfiles/blob/49bc0bdf76458e85a3491bb9942faf5630b3fad1/_config/nvim/ftplugin/clojure.vim#L53 that inserts (comment (def foo :foo))
(substitute foo
for the element under the cursor) for me to eval. Not as smooth an experience as I'm sure emacs's is, but sufficient.
Ah, I'm just annoyed with littering up my undo history by shimming comments in and out all the time and hoping for a better way. The Emacs thing looks sweet, but this is #vim 😅
vim-fireplace also has something close to that with its cqq
https://github.com/tpope/vim-fireplace/blob/master/doc/fireplace.txt#L216. But those things have shown me that I rather prefer something less ephemeral, because it's not often I only want to eval a form once while REPL'ing.
I.e. There's only so many times that I can type out the values for "fish" and "food" before I want to def
it 🙂
Yes, I can see how that would get mighty tedious, but the Cider/Emacs thing remembers history so you can repeat the binding to run it again with the same thing.
The hardest part would be determining which symbols in the current form need values; the rest should be fairly easily scriptable. Especially with neovim's inputs.
@UPWHQK562 Oh, I missed the feature. Looks cool. I would like to try it and if it looks good, I'll incorporate it to vim-iced.
@UBL24PLE6 You do an incredible job running your open source projects and being open to feedback. Thanks for checking in here, whether you decide to keep the feature or not 🙂