I write in English and Swedish in vim and have the lines below in my .vimrc to switch to and from a pseudo-Swedish keyboard layout. Basically some keys are remapped with inoremmap when doing <Leader>s to output Swedish characters, and characters that are masked by this are reached by hitting the key twice. <Leader>e undoes these mappings to return to English typing. This all works fine except for with the r operation. For example, when the Swedish mappings are in effect, r[ does not change the letter to , but to [. How can I make these mappings also affect the r operation?    Note that I do not want to use the OS's keyboard switch since this would effect operations in normal mode.    Switch to Swedishfunction! SweType()  set spelllang=sv  inoremap ;   inoremap ;; ;  inoremap :   inoremap :: :  inoremap [   inoremap {   inoremap '   inoremap '' '  inoremap    inoremap    inoremap [[ [  inoremap {{ {endfunctionnmap <Leader>s :<C-U>call SweType()<CR> Switch to Englishfunction! EngType()  set spelllang=en_us  inoremap ; ;  iunmap ;;  inoremap : :  iunmap ::  inoremap [ [  iunmap [[  inoremap { {  iunmap {{  inoremap ' '  iunmap ''  inoremap    iunmap endfunctionnmap <Leader>e :<C-U>call EngType()<CR>
imap and the r operation
key bindings;insert mode
You should be able to remap the whole sequence of keys in normal mode :nnoremap r[ rEdited the answer, as I'm not sure in which mode we are when we hit r. Maybe a sub mode of insert mode that is left as soon as another key is pressed.