I get a strange behavior of vim but it can be related to st-terminal that I cannot do an Enter or Ctrl+Enter to break the current line into new line in insert mode, as in the example below:
I have a line in vim that opens inside st-terminal:
This is a| test
| is the position of the cursor. I'd like to break the line into two different lines using Enter or Ctrl+Enter but I couldn't do that; vim somehow prevents me to break the line.
This is a
test
I have settings that might change Enter behavior of vim, these settings related to “UltiSnips” plugin, like below:
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
let g:UltiSnipsExpandTrigger="<enter>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
As I understand, the above code might lock Enter to break line in insert mode. But doesn't care about Ctrl+Enter.
UltiSnips possible locked Enter in insert mode.
I try to install xterm and do a try; it doesn't work either.
So it might relate to the OS itself? I have no idea.
I use Arch Linux, st-terminal, xterm, latest vim 8.1 / 1-374
EDIT: I tried to remove the above code in .vimrc,
and Enter and Ctrl+Enter work again.
But I still need to enable the UltiSnips plugin. How can I make Ctrl+Enter break the line? It's okay to disable Enter.
I suspect possible st-terminal didn't separate Ctrl+Enter and Enter; Ctrl+Enter falls back to Enter, it actually might had been set to the same "terminal keycodes"??
I found a solution: I comment out this line to enable back Enter
let g:UltiSnipsExpandTrigger="<enter>"