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

How do I jump to a percentage position in a file?

Answer

{count}%

Explanation

When used with a count, the % command jumps to the line at that percentage of the file. For example, 50% jumps to the middle of the file.

How it works

  • {count}% jumps to the line at that percentage through the file
  • 50% goes to the midpoint
  • 10% goes to 10% through the file
  • The cursor lands on the first non-blank character

Example

In a 200-line file:

  • 25% jumps to line 50
  • 50% jumps to line 100
  • 75% jumps to line 150

Tips

  • Without a count, % matches brackets instead
  • This is useful for quick estimation-based navigation
  • Works well with the ruler or statusline showing file percentage
  • :set ruler shows cursor position including percentage

Next

How do you yank a single word into a named register?