For example, I want to map the key stroke <Fixed key><Number> to :tabn <Number><CR>. I don’t normally use more than 8-9 open tabs and so this will be helpful for quickly switching between tabs. How do I set the mapping to accept any entry in <Number>? Of course, since there are only 9 possible options, I can simply write it out for each one, but I wanted to know if there’s a smarter way of doing this.
For example, I want to map the key stroke <Fixed key><Number> to :tabn <Number><CR>
Share
Your question is nice, but you can already use
<number>gtfor that. And I am afraid there is no way to have argument-dependent mapping. However you could do a loop in vimscript that generates your mapping commands.Edit: otherwise you can put that in your vimrc: