jiangmiao / auto-pairs

Vim plugin, insert or delete brackets, parens, quotes in pair
http://www.vim.org/scripts/script.php?script_id=3599
4.09k stars 373 forks source link

Not auto pair when code in Rust file #337

Closed hungpham3112 closed 2 years ago

hungpham3112 commented 3 years ago

When I edit the Rust file, I used b' ' in the if statement but it didn't work

bandicam 2021-09-02 21-33-05-390

It's really uncomfortable

LunarWatcher commented 3 years ago

My fork has a system to deal with these edge-cases. b is included by default, so the expansion works.

However, Rust is annoying and decided to override the default pairs in a way that completely disregards auto-pairs and user standards.

Use let g:rust_keep_autopairs_default = 1 to keep general single quote completion

hungpham3112 commented 3 years ago

My fork has a system to deal with these edge-cases. b is included by default, so the expansion works.

However, Rust is annoying and decided to override the default pairs in a way that completely disregards auto-pairs and user standards.

Use let g:rust_keep_autopairs_default = 1 to keep general single quote completion

It doesn't work, still auto-pairs single quote

LunarWatcher commented 3 years ago

Works fine for me out of the box with no config to auto-pairs. Did you actually switch repos? Remember that you need to clean before installing

hungpham3112 commented 2 years ago

Works fine for me out of the box with no config to auto-pairs. Did you actually switch repos? Remember that you need to clean before installing

Thanks for your fork, sorry for really late respond, . I'm using your fork now. let g:rust_keep_autopairs_default = 1 solved my problems. But I don't see help file of rust_keep_autopairs_default in the document when press K in vim. Keep up the great work !!!

LunarWatcher commented 2 years ago

Auto-pairs doesn't currently document it, because it's created by and in the rust plugin. Consequently, that's where the docs are: https://github.com/rust-lang/rust.vim/blob/87c745d8d506fc1eecc1d81df15d5bde1658a2fc/doc/rust.txt#L277

That said, I'll add a troubleshooting section on it (if I haven't already; I don't remember). It's hard to find from Rust's docs, and the troubleshooting doc is a more natural place to look anyway