Adding Newline with Indentation Between Brackets on Enter in Neovim Using mini.pairs #1531
-
Contributing guidelines
Module(s)mini.pairs QuestionHi, I’m trying to configure my neovim and mini.nvim has helped me a lot. However, I’m having an issue with mini.pairs. How can I add a newline with indentation between brackets when pressing Enter? By default, it behaves like this:
But I want it to work like this when I press Enter:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Pressing Chances are that something else overrides For all (registered) pairs to act like that after pressing |
Beta Was this translation helpful? Give feedback.
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 likev:lua.MiniPairs.cr()
andMiniPairs <CR>
.For all (registered) pairs to act like that after pressing
<CR>
, theMiniPairs.cr
function needs to be used inside expression mapping. Here is an example from my config with customcr_action
function.