vim-autoclose
vim-autoclose copied to clipboard
Auto-close with line breaks
Is there a way of entering a line break whan auto-closing?
Specially in CSS, when I write
.foo {
I get
.foo {|}
Is there a way of getting?
.foo {
|
}
I just mapped {<CR>
to do something like this (<CR>
is enter):
inoremap {<CR> {<CR>}<Esc>O
This way, you can also just make an inline block by not hitting enter after the bracket.
@ollpu Thanks, I'll try that
@thewinger I added better support for matching character pairs with line breaks. You can find the updated version here: https://github.com/whitehatzero/vim-autoclose
Since I essentially just handled the insert mode remap like @ollpu suggested, you might need to remove that particular key mapping from your vimrc if you run into any weird behavior.
@whitehatzero great! Thanks!