Fork me on GitHub

Any vim-iced users? Does anyone know how I could create mappings that roughly map to the existing but let me wrap arbitrary Clojure code around the eval'd code? For example, I want to be able to create a mapping that will do the normal Evaluate outer list (mapped to <Leader>ee by default), but wrap it in a time call, like (time <outer list>). And as an aside, I wonder if using Fennel for my config would help with doing things like this.


sheluchin, I don't have an answer, but yes, there are vim-iced users here. Sounds like a cool idea. It must be possible, because it seems simpler than other things that vim-iced does to code. But I think most of those are done by external programs. I don't know much about it, but it seems as if you could make nrepl do that, and vim-iced uses nrepl to evaluate code. People do amazing things with Lua, so maybe the Fennel strategy is good. Dunno. (Maybe all of that just tells you less than you already know.)


Thanks @U4HSMRQQJ. I'm slowly hacking my way towards it 🙂 I found that vim-iced has these paredit functions: So I can make a function similar to this one: Except the function should take some argument to make wrapping the current_top_list easy so composing its value into new calls becomes trivial. I can see adding temporary wrapper mappings being pretty useful. Something like (time <current_top_list>) may be useful only on occasion, but I think it generally opens up a lot of meta-programming flexibility.


That sounds like a reasonable strategy. I wonder if vim-iced IcedToggleTraceVAr might be another useful model.