I personnally went for:
set wrap
,set linebreak
set breakindent
set showbreak=?
.Some explanation:
wrap
option visually wraps line instead of having to scroll horizontallylinebreak
is for wrapping long lines at a specific character instead of just anywhere when the line happens to be too long, like in the middle of a word. By default, it breaks on whitespace (word separator), but you can configure it with breakat
. It also does NOT insert EOL
in the file as the OP wanted.breakat
is the character where it will visually break the line. No need to modify it if you want to break at whitespace between two words.breakindent
enables to visually indent the line when it breaks.showbreak
enables to set the character which indicates this break.See :h <keyword>
within vim for more info.
Note that you don't need to modify textwidth
nor wrapmargin
if you go this route.