Instead of wrapping lines visually, I want vim to wrap with a linebreak regardless of my the window dimensions. How can I set this automatically
You could work with
set textwidt=0 set wrapmargin=1 set formatoptions+=t set formatoptions-=l
wrapmargin defines the "number of characters from the right window border where wrapping starts". This option is only used, if
textwidth is set to zero.
t enables auto-wrap of text. By removing
l from the formatoptions, also lines that are already longer are wrapped.
:help 'formatoptions' and
The 'textwidth' option can be used to automatically break a line before it gets too long. Set the 'textwidth' option to the desired maximum line length. If you then type more characters (not spaces or tabs), the last word will be put on a new line (unless it is the only word on the line). If you set 'textwidth' to 0, this feature is disabled.
The line is only broken automatically when using Insert mode, or when appending to a line. When in replace mode and the line length is not changed, the line will not be broken.
In the comments I see you use "auto" linebreaks for coding.
Have you tried
breakindent and friends?