I
I
Insolent Muzzle2021-03-20 15:10:02
vim
Insolent Muzzle, 2021-03-20 15:10:02

Vim removes auto-indentation when breaking lines. What to do?

There are curly braces and there is a cursor between them. I press enter, and I see this picture:

{
        | <- Типо курсор
}

Everything is fine, the indent was automatically added. I press enter again: the cursor moved to another line, and the indents were added. Everything seems to be fine. I go back up a line and see that Vim has eaten my indentation. They were and disappeared when the line was broken. This happened in most editors that I used, but there I managed to disable this thing, but in Vim it did not. How is it disabled?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Insolent Muzzle, 2021-05-21
@pluffie

It turned out that everything is very simple (thanks, Englishmen)
:inoremap <Return> <Space><BS><Return>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question