Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a mapping like the G hotkey that jumps to a line (e.g., to jump to line 10: 10G). How can I do that?

share|improve this question
up vote 8 down vote accepted

You can obtain that number from the v:count or v:count1 variable. See

:help v:count

For example,

:map G :<C-U>echo v:count<CR>
share|improve this answer
Perfect. Got me down the right path. Needed to use exe though: nmap <tab> :<C-U>exe "buffer ".v:count<CR> – Belmin Fernandez Apr 10 '12 at 16:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.