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 file50%goes to the midpoint10%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 5050%jumps to line 10075%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 rulershows cursor position including percentage