jiangmiao / auto-pairs

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

Unexpected indentation of last bracket #329

Open ghost opened 3 years ago

ghost commented 3 years ago

Plugin functioning correctly, though hitting enter after typing a bracket seems to indent strangely. I would like something like this:

before: ()
after: (
    |
)

...but Currently I have this:

before: ()
after: (
    |
    )

Details:

Installation: vim-plug
Language: C
Operating System: unix
Vim: NVIM v0.4.3

Thanks!

LunarWatcher commented 3 years ago

Get a better indentexpr. https://github.com/LunarWatcher/auto-pairs/issues/26 https://github.com/LunarWatcher/auto-pairs/issues/27

in this case, though, because you're using C, you need to modify cino appropriately. Auto-pairs is just exploiting various indent expressions to mimic this behavior - and there's no way around that aside configuring your stuff properly.