This almost works for me:
nmap <buffer> <S-CR> <Plug>SlimeLineSendj
The reason it actually doesn't work is that my terminal Vim actually doesn't recognize the <S-CR>
sequence as different from a simple <CR>
, so whenever I press <S-CR>
Vim just moves to the next line and doesn't really trigger the mapping... If I do the same using a different trigger, it works fine:
nmap <buffer> <LocalLeader>s <Plug>SlimeLineSendj
Whenever expanding a mapping, Vim will look for the longest sequence of characters that matches a mapping. In this case, this will be <Plug>SlimeLineSend
, which will trigger the action. The j
is still on the buffer, so Vim will use this command as a motion to go down one line.
(Many plug-ins create their <Plug>
mappings with a set of parens around the "command" part, so that it's clear where it ends. Also, that allows them to create commands that are prefixes of other commands. For example, emmet.vim has <Plug>(emmet-toggle-comment)
, Command-T has <Plug>(CommandT)
, etc.)