This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-29
Channels
- # announcements (6)
- # babashka (7)
- # beginners (24)
- # calva (2)
- # cider (21)
- # clj-kondo (49)
- # cljdoc (29)
- # clojure (56)
- # clojure-dev (2)
- # clojure-europe (15)
- # clojure-nl (6)
- # clojure-norway (27)
- # clojure-uk (3)
- # clojuredesign-podcast (6)
- # clojurescript (1)
- # conjure (1)
- # core-async (8)
- # cryogen (2)
- # cursive (6)
- # data-science (1)
- # datomic (12)
- # events (1)
- # fulcro (16)
- # graalvm (28)
- # hyperfiddle (2)
- # lambdaisland (4)
- # leiningen (20)
- # observability (1)
- # off-topic (24)
- # pathom (5)
- # pedestal (10)
- # portal (7)
- # practicalli (1)
- # reitit (5)
- # rewrite-clj (20)
- # shadow-cljs (18)
- # vim (8)
- # xtdb (9)
is there any way to do parinfer (I've used parinfer-rust and nvim-parinfer) but turn off automatic insertion of closing bracket so that if I have the following code '(let [test (fn :foobar..' and when I insert for example a parenthesis between the fn and the :foobar, instead of doing this: '(let [test (fn () :foobar..' it does this: '(let [test (fn (:foobar)..' cursive does this with parinfer smart mode and automatic closing bracket insertion turned off, is there a way to get this behavior on vim too? (can use iced or conjure)
I use nvim-paredit
, and that allows me to hit >)
which moves the closing )
forward/to the right.
Is it as simple as ensuring there is more space between :foobar and the () insertion point (e.g. add another space then move back and insert parens)
I'm using https://github.com/gpanders/nvim-parinfer branch master, commit 5ca0928 and don't get the same behavior. If it's a Clojure keyword the parens doesn't wrap. If it's a symbol name, then it is wrapped by parens
With parinfer, typing the closing parens )
where it should go will automatically update the structure correctly.
Not sure if this makes a difference, but I set parinfer_force_balance = true
{
"gpanders/nvim-parinfer",
ft = { "clojure" },
init = function()
vim.g.parinfer_force_balance = true
vim.g.parinfer_comment_chars = ";;"
end,
},
hey @U05254DQM thanks for the replies! I installed gpanders/nvim-parinfer and I can't get the same behavior as cursive, I tried the parinfer_force_balance configuration too but it didn't change a thing :white_frowning_face: if you have the following map: {:foo bar} by typing ( after the right-side space of :foo, does the parens enclose the bar? becoming (bar) like cursive?
To get (bar) in that expression I put the cursor on top of b and press i
for insert mode, then (
will wrap to give (bar)
If the cursor is on top of the space between :foo and bar then I get {:foo() bar}