Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document CR mapping and workarounds #22

Open
xdg opened this issue Dec 10, 2019 · 0 comments
Open

Document CR mapping and workarounds #22

xdg opened this issue Dec 10, 2019 · 0 comments

Comments

@xdg
Copy link

xdg commented Dec 10, 2019

The CR wrapping isn't well documented, particularly how it handles existing mappings. I had problems with a pumvisible expr mapping but found a workaround moving the expression into a function and using a <C-R>=...<CR> mapping instead, which composes correctly with vim-closer. E.g.

function! HandleCRKey() abort
  return pumvisible() ? "\<C-E>\n" : "\n"
endfunction

" vim-closer can extend this correctly
inoremap <silent> <CR> <C-R>=HandleCRKey()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant