Command mode configuration, accept shorthand suggestions #744
-
The main two commands I use are I can see that Is it possible to expose these shorthand commands I use in the autocomplete list? Or alternatively, is it possible to show the autocomplete list without highlighting the first option, so that by typing |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You can make it not select by default in cmdline on v0.8.2 like https://cmp.saghen.dev/configuration/completion.html#list The list itself comes from the built in completions so I'm not sure about adding shorthands, although I imagine it wouldn't be particularly useful to have single character options |
Beta Was this translation helpful? Give feedback.
-
I have noticed that using the suggested completion.list.selection = function(ctx)
return ctx.mode == 'cmdline' and 'auto_insert' or 'preselect'
end requires to press the accept twice for the command to be accepted in the commandline. In the recording below you can see that after selecting an entry ( My keymaps configuration is as follows: keymap = {
["<CR>"] = { "accept", "fallback" },
["<Tab>"] = { "select_next", "fallback" },
["<S-Tab>"] = { "select_prev", "fallback" },
["<C-k>"] = { "scroll_documentation_up", "fallback" },
["<C-j>"] = { "scroll_documentation_down", "fallback" },
["<C-e>"] = { "hide" },
["K"] = { "show", "show_documentation", "hide_documentation" },
} and the same occurs where one uses |
Beta Was this translation helpful? Give feedback.
You can make it not select by default in cmdline on v0.8.2 like https://cmp.saghen.dev/configuration/completion.html#list
The list itself comes from the built in completions so I'm not sure about adding shorthands, although I imagine it wouldn't be particularly useful to have single character options