Skip to content
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

Replace right-click menu with cmp one #2061

Open
Sk7Str1p3 opened this issue Oct 13, 2024 · 1 comment
Open

Replace right-click menu with cmp one #2061

Sk7Str1p3 opened this issue Oct 13, 2024 · 1 comment

Comments

@Sk7Str1p3
Copy link

IMG_20241013_234402_696
So my goal is replace mouse menu (right window) with cmp menu (left one) I could not find any info, is this even possible? thx

@tmillr
Copy link
Contributor

tmillr commented Jan 27, 2025

I think it is, if your terminal is modern/mouse-friendly.

The right window is nvim builtin menu, cmp isn't. You need to globally map <RightMouse> to a function which triggers/opens cmp menu with custom entries.

You'll also need to locally map <LeftMouse> in the cmp menu window/buffer itself (if cmp doesn't do so already) so that you can select entries with the mouse.

Except for builtin menus, nvim disables mouse-move events by default. There is a dedicated nvim option to enable them though. Then you'll need to locally map those mouse move events in the cmp menu window/buffer as well if you want it to highlight hovered entries (like most gui context menus do).

You can also try searching to see if someone has made a plugin just for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants