blink.cmp icon indicating copy to clipboard operation
blink.cmp copied to clipboard

Completion does not handle `.` (dot) command

Open gwww opened this issue 1 year ago • 5 comments
trafficstars

When I hit tab to complete something the part after the tab is not a part of dot repeat.

Example, in a lua file in input mode:

vim. ==> vim.call (to exit input mode)

. ==> vim.

Hope this is clear. I have not checked what nvim-cmp does.

gwww avatar Oct 24 '24 14:10 gwww

Fixing this requires using an operatorfunc or feedkeys/nvim_paste. It looks like an official solution is in the works which I'll likely wait for

saghen avatar Oct 24 '24 15:10 saghen

For reference, this is how nvim-cmp handles it (using vim.api.nvim_feedkeys to input the completion result): https://github.com/hrsh7th/nvim-cmp/blob/ed31156aa2cc14e3bc066c59357cc91536a2bc01/lua/cmp/utils/feedkeys.lua

jmbuhr avatar Nov 27 '24 13:11 jmbuhr

The implementation in nvim-cmp looks nice - maybe a bit hacky, but I think it would be a huge improvement.

@Saghen if you would like to keep this out of the core, is there a possibility to allow a plugin to do this? I could develop and maintain a "hacky repeat" type of plugin that could implement dot repeats (maybe).

mikavilpas avatar Nov 27 '24 17:11 mikavilpas

I'd accept a PR for this in the core. I imagine it wouldn't be able to handle snippets, but that shouldn't be a deal breaker

saghen avatar Nov 27 '24 22:11 saghen

This would be really great, because it would allow this plugin to work with multicursor.nvim.

aaronlifton avatar Dec 20 '24 21:12 aaronlifton

Closed by #1033

saghen avatar Feb 11 '25 18:02 saghen

Wow this works flawlessly with https://github.com/jake-stewart/multicursor.nvim, so nice

https://github.com/user-attachments/assets/6ef1642b-9906-4570-8309-2e126744eadf

xzbdmw avatar Feb 11 '25 18:02 xzbdmw

@xzbdmw wow that is amazing! 😄 Really happy about this.

mikavilpas avatar Feb 11 '25 18:02 mikavilpas

this still doesn't work for me, when I autocomplete something, and then later press . to repeat completion, it just prints out the characters that I used to trigger the completion:

https://github.com/user-attachments/assets/9bda3960-ab31-431f-b018-91aa6028953b

zivkovicn avatar Feb 12 '25 13:02 zivkovicn

Did you upgrade to using tip or are you on a release version?

gwww avatar Feb 12 '25 13:02 gwww

Did you upgrade to using tip or are you on a release version?

Do you mind if you share how we can configure lazy to points to the tip? I've tried the following and several other variants and was unsuccessful

{ "Saghen/blink.cmp", branch = "main", tag=nil, version=nil }

hadynz avatar Feb 13 '25 08:02 hadynz

I use this, can you try that?

https://github.com/mikavilpas/dotfiles/blob/c770da3e747da3110c9abba8b521a31c01be18f4/.config/nvim/lua/plugins/blink.lua#L11

mikavilpas avatar Feb 13 '25 12:02 mikavilpas

I tried with version = false but that means installing rust nightly, which I did, but then I had issues with autocompletion not triggering at all, so I've reverted b/c I need this work today 😄 , seems that I will just wait until this reaches to the regular version tag.

zivkovicn avatar Feb 13 '25 16:02 zivkovicn

Hey! I was testing this out today since 0.12 was just released and from my testing the auto_brackets setting doesn't seem to work properly with multicursor.nvim

When I have auto_brackets disabled:

https://github.com/user-attachments/assets/9c42db67-4d02-4f6f-ad36-42c131163557

When I have it enabled:

https://github.com/user-attachments/assets/eb5e80db-ede5-42e6-8628-36759bcd8859

I wasn't sure whether to open an issue in this repo or in multicursor.nvim but since this issue already mentions the plugin and is relevant to the feature I thought it'd be the best place to put it :) Let me know if I should make a new issue and where.

iniw avatar Feb 15 '25 22:02 iniw

Ah that's going to be a mind numbing issue to fix 😄 A new issue would be great

saghen avatar Feb 15 '25 22:02 saghen

Now reported at #1233

iniw avatar Feb 15 '25 23:02 iniw