vim

For discussion on all things (neo)vim.
Gleb Posobin 2020-11-03T22:18:48.152300Z

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?

Gleb Posobin 2020-11-03T22:21:01.153800Z

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 [])?

dave 2020-11-04T13:54:52.161700Z

vim-sexp is compatible with parinfer and provides that functionality. i have both vim-sexp and parinfer installed and they make a great team 🙂

Gleb Posobin 2020-11-04T14:11:18.161900Z

Great, I am trying it out!

rwstauner 2020-11-03T22:29:19.154800Z

i haven't really used vim-sexp but i get the latter effect from kovisoft/paredit

2020-11-03T22:35:11.156500Z

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.)

walterl 2020-11-03T22:43:51.156600Z

vibibibib...

Gleb Posobin 2020-11-03T22:44:37.156800Z

Cool! Is there a way to contract after that?

Gleb Posobin 2020-11-03T22:47:59.157200Z

Great, thank you!

Gleb Posobin 2020-11-03T23:01:07.157800Z

Is anyone using vim-cljfmt? When I try to format the file, it deletes the its content...

jeremyvdw 2020-11-05T15:03:28.173200Z

dunno if you already worked around this, but if you don’t, here is a clue https://github.com/venantius/vim-cljfmt/issues/48

rwstauner 2020-11-03T23:07:58.158400Z

venantius/vim-cljfmt ? i use it in some projects and haven't had that problem

Gleb Posobin 2020-11-03T23:10:18.158700Z

Yes.