Skip to content

Instantly share code, notes, and snippets.

@marlun
Created December 11, 2010 21:31
Show Gist options
  • Save marlun/737671 to your computer and use it in GitHub Desktop.
Save marlun/737671 to your computer and use it in GitHub Desktop.
inoremap <expr> <CR> pumvisible() ?
\ "\<C-Y>" : delimitMate#WithinEmptyPair() ?
\ "\<C-R>=delimitMate#ExpandReturn()\<CR>" : "\<C-G>u\<CR>"
" <CR> accepts selected completion menu item (if it's visible)
"inoremap <expr> <cr> pumvisible() ? "\<c-y>" : "\<c-g>u\<cr>"
" Simulate <down> button
inoremap <expr> <c-n> pumvisible() ? "\<lt>c-n>" : "\<lt>c-n>\<lt>c-r>=pumvisible() ? \"\\<lt>down>\" : \"\"\<lt>cr>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment