Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What are the differences between this and jiangmiao/auto-pairs? #12

Open
gbrlsnchs opened this issue Apr 1, 2019 · 7 comments
Open

Comments

@gbrlsnchs
Copy link

I think it would be a good idea to have in the README some text explaining what's the difference between this plugin and other that are already well-known, like https://github.com/jiangmiao/auto-pairs. I'm currently using jiangmiao/auto-pairs since it correctly indents code when <CR> is pressed, so I don't see any real benefits of using this plugin over the one I cited (because I can't really see a difference).

@chemzqm
Copy link
Member

chemzqm commented Apr 1, 2019

My advice is stick to the auto pair plugin you like, it's designed to works like VSCode, but not featured like some of others.

For improvement of <CR> it's implemented in coc.nvim to make it works with formatOnType feature of LSP, checkout :h coc#on_enter()

@gbrlsnchs
Copy link
Author

Thanks, I'll definitely try it out with formatOnType, I'm loving how powerful Neovim has become thanks to coc.nvim... thanks again, mate!

@voldikss
Copy link
Contributor

voldikss commented May 22, 2019

@gbrlsnchs
IMO auto-pairs has a few flaws:

  • Auto indent didn't work for me sometimes when I was using auto-pairs. So I have to write vimscript by myself to meet demand.
  • auto-pairs inserts pairs always, which is a little noisy. coc-pairs just insert the first pair if the next character behind the cursor position is not a whitespace.

Maybe I didn't explain that clearly... Anyway, auto-pairs is a great plugin. 😄 Its fly-mode is fantastic, which, however, I use seldom. So after weighting and balance, I chose coc-pairs.

@cjnucette
Copy link

Thanks, I'll definitely try it out with formatOnType, I'm loving how powerful Neovim has become thanks to coc.nvim... thanks again, mate!

Did you find a solution? Can you post it?.

@gbrlsnchs
Copy link
Author

Thanks, I'll definitely try it out with formatOnType, I'm loving how powerful Neovim has become thanks to coc.nvim... thanks again, mate!

Did you find a solution? Can you post it?.

See #13 (comment) where I comment about the issue I had and how I solved it.

@mikew
Copy link

mikew commented Nov 25, 2019

So is it possible to get proper indentation without formatOnType? Since I'm using prettier in some places, and other formatters in others, and they may not be controlled from coc, it would be nice to get proper indentation without having to resort to cocs formatting.

@chemzqm
Copy link
Member

chemzqm commented Nov 25, 2019

So is it possible to get proper indentation without formatOnType?

Checkout :h indentexpr, formatOnType reformat current line on <CR> which means not only indentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants