Skip to content

How do I make vim.fn.feedkeys('d', 'n') enter operator-pending mode? #24157

Closed Answered by nyngwang
nyngwang asked this question in Q&A
Discussion options

You must be logged in to vote

I found that the cause is that I also define some other keymaps starting with d, e.g. d{d,m,c,r,t,k, ...}, and this makes the d of di delayed(if I remove all other d{...} keymaps then no such problem) so instead id will be executed. To work around this, simply make di a special case too:

vim.keymap.set('n', 'di',  function () if dapui_open and G.cur_tab(tab_debug) then return end vim.fn.feedkeys('di', 'n') end)

Replies: 2 comments 6 replies

Comment options

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

Answer selected by nyngwang
Comment options

You must be logged in to vote
5 replies
@nyngwang
Comment options

@nyngwang
Comment options

@zeertzjq
Comment options

@nyngwang
Comment options

@nyngwang
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants