Fork me on GitHub
#vim
<
2022-07-27
>
Martynas Maciulevičius10:07:32

Is there a way to open a paren and have the closing paren be inserted automatically? For instance if I type this ( then I expect to end up in insertion mode like this: (|) where | is the cursor

lispyclouds10:07:22

if you use one of the structural editing tools like https://github.com/guns/vim-sexp or https://github.com/eraserhd/parinfer-rust they do it for you. keep things always balanced. i use the latter.

lispyclouds11:07:01

should handle deletion of the open paren too

practicalli-johnny11:07:05

https://github.com/windwp/nvim-autopairs does this for many character pairs and allows simple definition of your own specific rules as to when to create pairs

👍 1
Noah Bogart11:07:19

Vim-sexp (and tpope’s sexp-mappings) are great and do automatic pair insertion