I am developing a vim plugin and I have set a default mapping this way.
if !hasmapto('<Plug>DumpDebugString')
nmap <unique> <Leader>ds <Plug>DumpDebugString
nmap <unique> <Leader>dS <Plug>DumpDebugStringExpr
endif
...
nnoremap <silent> <Plug>DumpDebugString :<C-U> :call <SID>debugFunctionWrapper(0)<CR>
nnoremap <silent> <Plug>DumpDebugStringExpr :<C-U> :call <SID>debugFunctionWrapper(1)<CR>
When I try invoking ds the DumpDebugString method runs correctly but takes some time actually get called in the first place. It is run instantly only if I map it like this:
nmap <leader>ds <Plug>DumpDebugString<CR>
But the extra <CR>
shouldn't be needed since it already included in the nnoremap
call.
- I don't think it has anything to do with the actual mapping characters or with the use of
<Plug>
. - Substituting
:call <SID>debugFunctionWrapper(0)<CR>
with something like:call str2nr("1")<CR>
doesn't seem to solve the problem - Adding
<nowait>
doesn't do anything.
For the story, here's the plugin: https://github.com/bergercookie/vim-debugstring
:call
's to just:<c-u>call
instead of:<c-u> :call