coc-pairs icon indicating copy to clipboard operation
coc-pairs copied to clipboard

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

Open gbrlsnchs opened this issue 5 years ago • 7 comments

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

gbrlsnchs avatar Apr 01 '19 13:04 gbrlsnchs

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

chemzqm avatar Apr 01 '19 21:04 chemzqm

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

gbrlsnchs avatar Apr 02 '19 03:04 gbrlsnchs

@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. :smile: Its fly-mode is fantastic, which, however, I use seldom. So after weighting and balance, I chose coc-pairs.

voldikss avatar May 22 '19 05:05 voldikss

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

cjnucette avatar Jul 15 '19 11:07 cjnucette

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 https://github.com/neoclide/coc-pairs/issues/13#issuecomment-478998416 where I comment about the issue I had and how I solved it.

gbrlsnchs avatar Jul 15 '19 20:07 gbrlsnchs

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.

mikew avatar Nov 25 '19 01:11 mikew

So is it possible to get proper indentation without formatOnType?

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

chemzqm avatar Nov 25 '19 01:11 chemzqm