Skip to content

Close completion with Escape key, but remain in Insert mode? #924

Answered by harrygallagher4
pbar1 asked this question in Q&A
Discussion options

You must be logged in to vote

Do your <tab>/<s-tab> maps work? I think functions need to be wrapped in cmp.mapping(fn) to work properly.

My configuration is in fennel but I've used the following for months:

(local m cmp.mapping)
(local visible? cmp.visible)
(local abort! cmp.abort)

{:mapping {:<esc> (m #(if (visible?) (abort!) ($)) [:i :c])}}

The function is basically identical to the last one in your post except it uses abort instead of close.

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@pbar1
Comment options

Comment options

You must be logged in to vote
3 replies
@pbar1
Comment options

@harrygallagher4
Comment options

@pbar1
Comment options

Answer selected by pbar1
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants