This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-02
Channels
- # announcements (1)
- # asami (89)
- # aws (10)
- # babashka (41)
- # beginners (71)
- # calva (25)
- # cider (3)
- # clj-kondo (65)
- # cljdoc (15)
- # cljs-dev (3)
- # cljsrn (8)
- # clojure (56)
- # clojure-europe (44)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-uk (48)
- # clojured (7)
- # clojurescript (17)
- # conjure (6)
- # cursive (3)
- # datomic (9)
- # emacs (11)
- # events (3)
- # fulcro (3)
- # helix (3)
- # honeysql (7)
- # hugsql (6)
- # introduce-yourself (2)
- # jobs (2)
- # kaocha (4)
- # luminus (1)
- # nrepl (2)
- # off-topic (10)
- # pathom (7)
- # philosophy (3)
- # polylith (27)
- # reagent (18)
- # reitit (3)
- # remote-jobs (7)
- # reveal (3)
- # shadow-cljs (9)
- # slack-help (5)
- # tools-deps (9)
- # vim (48)
Hi! I'm looking for a nvim plugin to manage sexps. I tried https://github.com/vim-scripts/paredit.vim it's super useful but I found a problem (not sure if I'm using it wrong or if it's a bug) When I delete until the end of line inside of a string inside of a vector I end up with unbalanced brackets.
[:p "If I press D here | paredit will do this"] -> [:p "If I press D here"
Are you using another plugin? I'm new to nvim plugins so any other useful plugins are welcomed.that along with Plug 'guns/vim-sexp', {'for': 'clojure'}
and Plug 'tpope/vim-sexp-mappings-for-regular-people', {'for': 'clojure'}
I'll read the docs, try it and might come later with questions π I'm trying to use vscode + vscode-neovim
if you ever have unbalanced parens but your plugins wonβt let you input them (this happens to me sometimes with vim-sexp and vim-sexp-mappings), CTRL-V in insert mode will βforceβ input of the character without triggering/respecting mappings
:help i_CTRL-V
: The characters typed right after CTRL-V are not considered for mapping.
Good to know! Another little trick I use in a situation like that is to go to another instance of the character I want to insert but can't (e.g. a close paren), go into visual mode to copy it (`vy`), and the paste it wherever I want it to go with p
.
yeah thatβs another good method, especially if you need to paste multiple parens
surely it's easier to type in 8 a Ctrl-V )
Idk how to count, I gotta go one at a time
oh, you mean a Ctrl-V )
followed by .
until you are done? π
Haha yeah, or v y followed by p until Iβm done
If ever I find myself in that situation (which is rarer now since I've got used to how parinfer-rust works), I just exit, load up vi
, without any plugins, do a bit of editing, save and open again in vim π
love that solution, lol
Other strategies Iβve used for a quick fix.
; )
then delete the ;
oh thatβs a good one too
Or ")"
then remove the quotes.
once you get into the flow of how parinfer-rust, etc., work, then you sorta just forget about the parens etc..
You've all effectively demonstrated why paredit can't really guarantee balanced parens π
lol if you count just adding as many parens as necessary to the last line of a file, it def can π₯΄
while we are talking about balanced parens... what is the best choice these days for auto-closing parenthesis/braces/strings? I've tried a couple recently, and they are broken in different but pretty bad ways : (
https://github.com/jiangmiao/auto-pairs has served me well. I haven't looked into any of the alternatives, though.
i somehow have autopairs but have no idea what makes them happen lmao
I just realized that I have autopairs disabled for Clojure and other Lisps:
augroup autopairs_config
" disable auto-pairs for lisp -- it interferes with parinfer
autocmd Filetype lisp,scheme,clojure,lfe let b:AutoPairs = {}
augroup END
vim-sexp comes with insert mapping to autoclose parens https://github.com/guns/vim-sexp/blob/master/README.markdown#insert-mode-mappings-insert
I use AutoPairs and not parinfer, but had to tweak it a bit for Clojure:
" Don't automatically insert closing ' or `
let b:AutoPairs = {'(':')', '[':']', '{':'}','"':'"'}
hm, auto-pairs was the last one I had enabled, and I can't remember why exactly, but I removed it. Will give it a spin again, thanks!