Skip to content

Instantly share code, notes, and snippets.

@marlun
Created April 20, 2011 06:13
Show Gist options
  • Save marlun/930480 to your computer and use it in GitHub Desktop.
Save marlun/930480 to your computer and use it in GitHub Desktop.
function! MyCR()
echom 'MyCR()'
" XPTinfo() returns a list if snippet is active.
if type(XPTinfo()) == type([])
echom 1
XPTcrash
return ''
elseif pumvisible()
echom 2
return "\<C-Y>"
elseif delimitMate#WithinEmptyPair()
echom 3
return "\<C-R>=delimitMate#ExpandReturn()\<CR>"
else
echom 4
return "\<C-G>u\<CR>"
endif
endfunction
inoremap <expr> <CR> MyCR()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment