I got this to work in a terminal, since C-Enter is mapped to NL.

This is my code:

fun ToggleEnterMappings()
if mapcheck(“”, “i”) == “”
iunmap
inoremap :call ToggleEnterMappings()
inoremap :call ToggleEnterMappings()
else
inoremap
inoremap :call ToggleEnterMappings()
inoremap :call ToggleEnterMappings()
endif
endfun
call ToggleEnterMappings()