nvim-lua / wishlist

A public catalogue of Lua plugins Neovim users would like to see exist
MIT License
235 stars 0 forks source link

Auto close brackets pairs #11

Closed gegoune closed 2 years ago

gegoune commented 3 years ago

What? Modern, working out of the box but configurable auto pair plugin written in lua.

Why? There is popular demand for auto pair close plugins, which is reflected by number of existing solutions. Many of which are outdated, not maintained or simply buggy. It would be nice to have modern, working out of the box solution for neovim.

Potential existing implementations: https://github.com/cohama/lexima.vim https://github.com/jiangmiao/auto-pairs https://github.com/rstacruz/vim-closer https://github.com/Raimondi/delimitMate

https://www.reddit.com/r/vim/comments/6h0dy7/

*Potential pitfalls:* Would like it to work with existing lua plugins out of the box. It potentially needs to remap <CR> which also plugins like completion-vim do (I believe).

gegoune commented 3 years ago

https://github.com/windwp/nvim-autopairs

matu3ba commented 3 years ago

https://github.com/windwp/nvim-autopairs

I think the autopair solution should support treesitter for no false bracket creations. It could possibly reuse parts of rainbow.

tomtomjhj commented 3 years ago

Another plugin: https://github.com/tmsvg/pear-tree/ This one does a fairly good job at deciding when it's correct to insert/delete matching brackets. Example

gegoune commented 3 years ago

@tomtomjhj But that's not lua plugin.

bluz71 commented 3 years ago

Looks like there is a new option available pears.nvim from @steelsojka.

I don't know how it compares with nvim-autopairs.

I currently use pear-tree which works quite well. But I do want to give the new Lua alternatives a test drive eventually.

windwp commented 3 years ago

latest update of nvim-autopairs added support treesitter and multiple chars.

a new api with rule make it is easy to customize.

bluz71 commented 3 years ago

And initial endwise infrastructure was also added to nvim-autopairs, which should prove very useful.

gegoune commented 2 years ago

That wish seems to be granted.