Vimium: Mapping Multiple commands to a key or Key Combo

Created on 25 Apr 2016  路  6Comments  路  Source: philc/vimium

Is it possible to map multiple commands to a single key or key combo?
For example, mapping a single character to move three lines down and delete that line. We would do something like :nmap x 3jyy in vim.
Here, j and yy are two different actions.
Is there a way to combine multiple actions to a single key?

Most helpful comment

Hi, not sure this is compelling, but I came here hoping to do this because I wanted to map

map <c-o> goBack
map <c-O> duplicateTab \| goBack

In other words, I wanted to do the same thing clicking the back button while holding down Cmd does on a mac, namely: open a new tab with a shared back/forward history and go back in that new tab.

All 6 comments

Thanks, @Sibicoder.

Answer: not currently. And I'm not sure this is a priority. It would probably be trickier to implement than you might imagine (because with JS so much happens asynchronously), and it's not clear that there's a compelling use case.

Hi, not sure this is compelling, but I came here hoping to do this because I wanted to map

map <c-o> goBack
map <c-O> duplicateTab \| goBack

In other words, I wanted to do the same thing clicking the back button while holding down Cmd does on a mac, namely: open a new tab with a shared back/forward history and go back in that new tab.

Came here for the exact same reason as @NHDaly, but I see how acting on two tabs would be problematic.

I too miss this feature.

+1
I would use this feature for two combos:

  • open in new tab + go to this tab (F + gt)
  • close current tab and open new one to have cursor placed in browser search bar (x + t)

After some trouble, I could do it, but in qutebrowser. Very happy if it were on Vimium!

Was this page helpful?
0 / 5 - 0 ratings