-
-
Notifications
You must be signed in to change notification settings - Fork 942
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
Control space not working for cmp
#601
Comments
An example of this is here: https://asciinema.org/a/dinLAO4CjcdXWKWjObFdsIglJ When there is no completion menu available, if I press |
Correct that is not happening. I can send a video later. I can try with vanilla AstroNvim however I don't really see anything conflicting |
Could it be because there is nothing matching the completion? The easiest way to test this is to start typing something where the menu is open automatically and then use |
I have the same issue too, doing |
@johnsiras could you share your user configuration? Also what terminal and operating system are you on? |
I still don't have my nvim user config repo yet, but my terminal is wezterm both wezterm, terminal, and alacritty doesn't work. |
@johnsiras @jayp0521 this appears to be a bug upstream for Neovim on windows: neovim/neovim#8435 |
Btw, And it's annoying too when using tab ik it's for indentation not for cmp completion wezterm-gui_O2Z4p1A1NU.mp4 |
@johnsiras we are currently using a replication of the "super tab" like functionality found here: https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings#luasnip This checks to see if there are words before the cursor and if there are then it will try to complete which is the behavior you are experiencing. It will not trigger the complete if you are tabbing in a new line which is most of the cases where one tends to put tab characters. This functionality can be overridden in the user configuration (I do this because I am not a fan of this default, but the general consensus by the users on the discord/here are that this is preferred): return {
plugins = {
cmp = function(config)
local cmp = require "cmp"
local luasnip = require "luasnip"
config.mapping["<Tab>"] = cmp.mapping(function(fallback)
if luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { "i", "s" })
config.mapping["<S-Tab>"] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" })
return config
end,
},
} |
Since this is an upstream bug affecting windows users and not related to AstroNvim in particular, I'm going to go ahead and close this and leave the issue searchable for anyone else who may have the same problem/question. |
For anyone stumbling across this thread who has a similar issue (ctrl-space not working when trying to trigger completion) I would recommend checking that your keyboard/terminal app/whatever in the input chain to vim is actually sending the input (ctrl-space) you think it is - particularly if you're on MacOs! I questioned if my terminal app (iterm2) wasn't sending ctrl-Space through properly, so on iterm2 I turned on raw key reporting mode: that showed me that space bar wouldn't register any input when ctrl was pressed at the same time I then stumbled across this article which says that apparently a default system shortcut was made a while ago in macos that uses the ctrl-space combination https://apple.stackexchange.com/a/351058 deselecting this shortcut like so solved my problem: |
AstroNvim/lua/configs/cmp.lua
Line 80 in bdddd84
nothing happens when I press
Ctrl + Space
. the other bindings work. I did not test them allThe text was updated successfully, but these errors were encountered: