terryma
terryma

Reputation: 191

What vim setting controls this behavior?

hello world

If I place my cursor right after o on hello and go into insert mode, then type <CR>, world does not have a space in front of it on the second line. But with a vanilla vimrc file, the space character in front of world originally is preserved on the newline. I can't figure out what setting is controlling this particular behavior.

Upvotes: 0

Views: 45

Answers (1)

steveha
steveha

Reputation: 76765

By any chance is autoindent set on? That will make the white space at the beginning of a line match the previous line, and since the previous line has no leading whitespace, vim would delete the whitespace. (I just tested this.)

Upvotes: 2

Related Questions