The Wayback Machine - https://web.archive.org/web/20220803130409/https://github.com/ms-jpq/coq_nvim/issues/24
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

config-request: expose ability to map Select Next Item and Select Previous Item in completion menu #24

Closed
vxio opened this issue Aug 15, 2021 · 5 comments

Comments

@vxio
Copy link

@vxio vxio commented Aug 15, 2021

In addition to <tab> and <s-tab> for selecting next/previous items in the completion menu, it'd be great to have this enabled for <up> and <down> arrows.

@mcauley-penney
Copy link

@mcauley-penney mcauley-penney commented Aug 15, 2021

If your config is in Lua or you use Lua at all, these are currently working for me

local send_keys = function(str)
    return vim.api.nvim_replace_termcodes( str, true, true, true )
end

_G.arrow_down = function()
    return vim.fn.pumvisible() == 1 and send_keys "<C-n>" or send_keys "<down>"
end


_G.arrow_up = function()
    return vim.fn.pumvisible() == 1 and send_keys "<C-p>" or send_keys "<up>"
end 

map( 'i', '<up>',   'v:lua.arrow_up()',   { expr = true, silent = true }  )
map( 'i', '<down>', 'v:lua.arrow_down()', { expr = true, silent = true }  )

@ms-jpq
Copy link
Owner

@ms-jpq ms-jpq commented Aug 16, 2021

wait it already works on my machine™,

does it actually not work for you guys to scroll up and down with <up> and <down>?

@ms-jpq
Copy link
Owner

@ms-jpq ms-jpq commented Aug 16, 2021

that is freaking weird

@zeertzjq
Copy link
Contributor

@zeertzjq zeertzjq commented Aug 21, 2021

These two seem to work without any mappings. If you already have these two mapped to something else then they will not work.
<Up> and <Down> are actually different from <C-P> and <C-N>. @McAuleyPenney was right.

@ms-jpq
Copy link
Owner

@ms-jpq ms-jpq commented Aug 22, 2021

what @zeertzjq said

@ms-jpq ms-jpq closed this as completed Aug 22, 2021
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

4 participants