This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-03
Channels
- # announcements (2)
- # asami (1)
- # babashka (32)
- # beginners (125)
- # calva (4)
- # cider (1)
- # clj-kondo (16)
- # clj-together (1)
- # cljs-dev (15)
- # clojure (30)
- # clojure-australia (3)
- # clojure-europe (41)
- # clojure-italy (1)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-spec (68)
- # clojure-uk (28)
- # clojurescript (36)
- # conjure (2)
- # cryogen (1)
- # cursive (2)
- # data-science (2)
- # datascript (2)
- # datomic (70)
- # events (2)
- # fulcro (11)
- # graalvm (1)
- # jobs (4)
- # kaocha (4)
- # leiningen (4)
- # malli (52)
- # meander (21)
- # off-topic (11)
- # pathom (7)
- # pedestal (17)
- # reagent (23)
- # reitit (5)
- # remote-jobs (5)
- # reveal (7)
- # shadow-cljs (24)
- # spacemacs (36)
- # sql (21)
- # vim (18)
- # xtdb (7)
Is there a way to expand / contract current selection by the levels with vim-sexp? So if I do "vi(", the innermost form surrounded by () is selected, is there a way to expand the selection to the next one form containing that one?
Cool! Is there a way to contract after that?
Not that I'm aware of. Probably because it's stateless and therefore non-deterministic: if you went from some form f to include it's parent, it would include f's siblings too. Then it won't know how which sibling to select "down" into. Just guessing, though 🤷
Also, is there a way to preserve the parenthesis on deleting? So if I delete the second line in
(defn f []
2)
the output will be (defn f [])
?Parinfer-rust does this. https://github.com/eraserhd/parinfer-rust
A long time ago, I switched from paredit to parinfer and I've never looked back. It is quite different, and it's not for everyone, but it makes a lot of sense for the way I think about editing code
The overall idea is that you almost never have to add or remove parentheses directly. Rather, you align/indent your code according to common Lisp/Clojure conventions and parinfer places your parentheses for you based on your indentation.
Interesting! What about slurping and barfing when items are on the same line?
vim-sexp is compatible with parinfer and provides that functionality. i have both vim-sexp and parinfer installed and they make a great team 🙂
Great, I am trying it out!
I think vim-sexp is primarily oriented to using text objects (eg. f for form, F for top level form, which combine with d/y and then i/a etc.)
Great, thank you!
Is anyone using vim-cljfmt
? When I try to format the file, it deletes the its content...
dunno if you already worked around this, but if you don’t, here is a clue https://github.com/venantius/vim-cljfmt/issues/48