Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 3 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

 
discard

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.