How can I remap a quick successive double press of the A key to function as a single press of the B key in any mode?

vim

Solution

I don’t know that you can do this with a single mapping (although that would probably be lovely), but the following series of three mode-specific mappings should do it:

nnoremap aa b
inoremap aa b
vnoremap aa b

Problem

I've tried `nnoremap aa b` in my .vimrc but it doesn't work. I want this to work in all modes (line mode, normal mode, and insert mode.)

Original source