Vim Tip – Highlighting long rows
Occasionally when using vim to edit large amounts of text, such as writing a blog post, or formatting a large code comment, I wish to hard wrap the lines at a certain number of columns for ease of reading. Here is a simple vim function which uses the built in syntax highlighting capabilities of vim to highlight any line which extends beyond 80 columns of text, allowing me to add line breaks as I see fit, while leaving long lines of code alone. As an added bonus, it looks really nice in the gui version of vim while still remaining usable in the console version.
Read more…