mapping.vim (517B)
1 " remap a key given a dictionary representing a saved mapping 2 function! quick_scope#mapping#Restore(mapping) abort 3 execute a:mapping.mode 4 \ . (a:mapping.noremap ? 'noremap ' : 'map ') 5 \ . (a:mapping.buffer ? '<buffer> ' : '') 6 \ . (a:mapping.expr ? '<expr> ' : '') 7 \ . (a:mapping.nowait ? '<nowait> ' : '') 8 \ . (a:mapping.silent ? '<silent> ' : '') 9 \ . a:mapping.lhs . ' ' 10 \ . substitute(a:mapping.rhs, '<SID>', '<SNR>' . a:mapping.sid . '_', 'g') 11 endfunction