vimtricks.wiki Concise Vim tricks, one at a time.

How do I jump to non-whitespace text beyond column 80?

Answer

/\%>80v\S

Explanation

When you enforce line-length limits, visual guides show where the boundary is, but they do not help you jump directly to violations. Vim's virtual-column atom lets search operate on display columns, so you can navigate only the overflow region and fix it quickly.

How it works

/\%>80v\S
  • / starts a forward search
  • \%>80v matches positions strictly after virtual column 80
  • \S requires a non-whitespace character at that position

The virtual-column atom is display-aware, so it tracks what you see on screen rather than byte offsets. That makes it effective in code, prose, and mixed-indentation files where simple character counts are less practical.

Example

Given:

short line
this line has content that extends far beyond the configured width limit

Searching with /\%>80v\S lands on the first non-space character past column 80 in the long line.

Tips

  • Use n and N to jump through all over-limit locations
  • Replace 80 with your project width (100, 120, etc.)
  • Pair this with :set colorcolumn=81 so visual guidance and navigation use the same threshold

Next

How do I programmatically create a blockwise register with setreg()?