Raimondi / delimitMate

Vim plugin, provides insert mode auto-completion for quotes, parens, brackets, etc.
http://www.vim.org/scripts/script.php?script_id=2754
1.98k stars 116 forks source link

<Plug>delimitMateCR doesn't trigger, it writes function as text #259

Open rafi opened 7 years ago

rafi commented 7 years ago

Using this snippet from docs:

    inoremap <expr> <CR> delimitMate#WithinEmptyPair() ?
             \ "<Plug>delimitMateCR" :
             \ "external_mapping"

Produces literal text and doesn't trigger plugin, for example:

image

(Using latest Neovim v0.2.1-278-g1b2acb8d)

tenfyzhong commented 6 years ago

@rafi

imap <expr> <CR> delimitMate#WithinEmptyPair() ?
             \ "\<Plug>delimitMateCR" :
             \ "external_mapping"
  1. you should use imap
  2. add a \ before <Plug>