hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.53k stars 377 forks source link

Add option to not reverse select_next_item on bottom_up list (#1346) #1711

Open GustawXYZ opened 9 months ago

GustawXYZ commented 9 months ago
* add feature requested in (#1346)

Add a parameter to the function preserve_mapping_verticality, which will keep mappings like and not reversed even when used custom view is used with selection_order = 'top_down' configuration. (Up is up and Down is down even when the list is upside down)

Example use configuration:

    ["<Down>"] = cmp.mapping(cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select, preserve_mapping_verticality = true }, { "i", "s" }),
    ["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select, preserve_mapping_verticality = true }, { "i", "s" }),
edshamis commented 5 months ago

Please add this

GustawXYZ commented 5 months ago

@edshamis +1! In the meantime feel free to use the fork, in lazy.nvim you can configure this like so:

{
"hrsh7th/nvim-cmp",
url = "https://github.com/GustawXYZ/nvim-cmp",
event = "VeryLazy", 
}