The Computer Oracle

How do you create a vim key mapping that requires numbers before the hotkey (like <G>)?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Fantascape Looping

--

Chapters
00:00 How Do You Create A Vim Key Mapping That Requires Numbers Before The Hotkey (Like ≪G≫)?
00:17 Accepted Answer Score 16
00:36 Thank you

--

Full question
https://superuser.com/questions/410847/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#vim

#avk47



ACCEPTED ANSWER

Score 16


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>