-
Notifications
You must be signed in to change notification settings - Fork 201
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
feat(cmdline): allow configuring separate cmdline preset #532
Conversation
Thinking about this more, specifically for the cmdline, users will probably want to customize other config options as well. |
This PR is indeed not enough. Not sure what the best approach is. I've disabled the cmdline integration for now in LazyVim. |
That would make the entire config dynamic which would make this much more complicated. I'd like to avoid this if possible
So you'd like |
These are the options I set: vim.opt.completeopt = "menu,menuone,noselect" |
The screenshots are Noice obviously, but that behaves exactly as the normal cmdline regarding completion. |
Maybe make So we can set keymaps like this:
|
@the-fuckin-nobody though about doing it that way initially, but in my case, the first entry would already be pre-selected, so you can't use |
If I am understanding it correctly, is this the desired behaviour? recording.mp4 |
Yep, exactly. |
Then, it is actually doable with the current state of the plugin, by configuring the tab keymap like this like this and having the selection behaviour as ["<Tab>"] = {
function(cmp)
if vim.fn.getcmdtype() ~= "" then
return cmp.select_next()
elseif cmp.snippet_active() then
return cmp.accept()
end
end,
"snippet_forward",
"fallback",
}, But in my case I would prefer to have selection behaviour as |
Yep same here |
any progress about handling the 'special' auto_insert for cmdline? |
That should be done in another PR I guess cuz its unrelated to this PR( |
Yep, I'm still working out how I want to solve it |
Take a break bro not everything must be implemented right away! PS: You're awesome |
for those who find here and want some temp fix: init = function()
-- FIX: Temporary for not being able to set auto_insert for cmdline
local orig_list_selection = nil
vim.api.nvim_create_autocmd("CmdlineEnter", {
callback = function()
local list = require "blink.cmp.completion.list"
orig_list_selection = list.config.selection
list.config.selection = "auto_insert"
end,
})
vim.api.nvim_create_autocmd("CmdlineLeave", {
callback = function()
if orig_list_selection then
local list = require "blink.cmp.completion.list"
list.config.selection = orig_list_selection
end
end,
})
end, |
This PR does two things:
cmdline
Closes #514