You can use colorcolumn to set the right margin strip.
This did not exist before Vim 7.3, so it would be wiser to enable it only if the function is available.
if exists('&colorcolumn') set colorcolumn=70 endif
I prefer this to only display in insert mode, so I use this:
if exists('&colorcolumn') autocmd InsertEnter * set colorcolumn=80 autocmd InsertLeave * set colorcolumn="" endif
This will set the parameter when switching to insert mode and turn it off when you leave insert mode.
source share