Skip to content

Adding Newline with Indentation Between Brackets on Enter in Neovim Using mini.pairs #1531

Closed Answered by echasnovski
kyzsuukii asked this question in Q&A
Discussion options

You must be logged in to vote

Pressing <CR> does behave like that with only 'mini.pairs' enabled. You can also see that at the end of the demo.

Chances are that something else overrides <CR> in Insert mode (maybe completion plugin?). What does executing :imap <CR> show? It should show something like v:lua.MiniPairs.cr() and MiniPairs <CR>.

For all (registered) pairs to act like that after pressing <CR>, the MiniPairs.cr function needs to be used inside expression mapping. Here is an example from my config with custom cr_action function.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kyzsuukii
Comment options

Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.pairs
2 participants