There's a very weird thing that occurs when I type a comment that it inserts a newline after a max-width which I don't want to have done. For example: here is me typing it in: https://gyazo.com/7dd2fccd0d988082abf2e6f8a9be945e.
Why does this occur?
The only (hackish) way I was able to disable it is to set
:set paste, but hopefully there's a better way to disable this autowrapping?
"When in normal mode, treat an enter like insert -- as I continue typing this line it automatically adds a new line :nmap <leader>& O :nmap <CR> i<CR>
:set formatoptions? comments? textwidth?, the combination of these three should define the behavior of automatically wrapping lines, in particular comment lines.
:set whatever?and it would tell you what the current setting was. Doing that helped me figure it out -- setting
textwidth=0fixed it for me.
set tw=0is not necessarily the only or best way to fix this... I tried to reproduce your issue on a
*.vimfile and while mine wraps the lines, it starts the wrapped line with a comment character... So I was curious why your setup seems to be acting differently...