Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Auto-close with line breaks #74

Open
thewinger opened this issue Dec 1, 2016 · 4 comments
Open

Auto-close with line breaks #74

thewinger opened this issue Dec 1, 2016 · 4 comments

Comments

@thewinger
Copy link

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 {
    |
}
@ollpu
Copy link

ollpu commented Jan 7, 2017

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.

@thewinger
Copy link
Author

@ollpu Thanks, I'll try that

@ghost
Copy link

ghost commented Dec 20, 2018

@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.

@thewinger
Copy link
Author

@WhiteHatZero great! Thanks!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants