Let's assume my .vimrc has the following configuration:
set textwidth=10
In a file I type the following:
This is a
sentence
word wraps
just fine
at 10
chars.
As I type this sentence, VIM will word-wrap in real time and prevent me from passing the marker I've set. However, a common issue I find myself in is adding more content. I forgot a word in the previous paragraph, "sentence THAT word wraps."
So I go back and add it.
This is a
a sentence that, suddenly, doesn't
word wrap
just fine
at 10
chars.
If I wanted to fix this now (have all lines below 10 character limit that I've set), I'd have to find the 10 character spot, hit RETURN (to move extra content down), then find the 10 character spot on the next line, hit RETURN, and so on.
This scenario surfaces a lot for me in my program and function prologues in code (I typically work with 73 character line limits), because I find myself having to add more explanations or content later.
Is there a quick/easy way to fix this problem?
Also:
I have this in my .vimrc
to highlight text-width offenders:
" highlight anything past the 73 character limit
augroup vimrc_autocmds
autocmd Filetype cpp autocmd BufEnter * highlight OverLength ctermbg=darkgrey guibg=#592929
autocmd Filetype cpp autocmd BufEnter * match OverLength /\%73v.*/
augroup END
Perhaps there is something here I can add too?