Comments (8)
Haha, Currently nvim-cmp uses vim's native completion menu.
But my next task after nvim-cmp stabilized is it! I will use a custom completion menu via the floating window. (It realizes custom highlighting.)
from nvim-cmp.
vim.lsp.protocol.CompletionItemKind = {
'', -- Text = 1;
'', -- Method = 2;
'ƒ', -- Function = 3;
'', -- Constructor = 4;
'⌘', -- Field = 5;
'', -- Variable = 6;
'', -- Class = 7;
'ﰮ', -- Interface = 8;
'', -- Module = 9;
'', -- Property = 10;
'', -- Unit = 11;
'', -- Value = 12;
'了', -- Enum = 13;
'', -- Keyword = 14;
'', -- Snippet = 15;
'', -- Color = 16;
'', -- File = 17;
'', -- Reference = 18;
'', -- Folder = 19;
'', -- EnumMember = 20;
'', -- Constant = 21;
'', -- Struct = 22;
'', -- Event = 23;
'', -- Operator = 24;
'', -- TypeParameter = 25;
}
local cmp = require('cmp')
for index, value in ipairs(vim.lsp.protocol.CompletionItemKind) do
cmp.lsp.CompletionItemKind[index] = value
end
a little snippet to implement lsplkind on nvim-cmp
from nvim-cmp.
vim.lsp.protocol.CompletionItemKind = { '', -- Text = 1; '', -- Method = 2; 'ƒ', -- Function = 3; '', -- Constructor = 4; '⌘', -- Field = 5; '', -- Variable = 6; '', -- Class = 7; 'ﰮ', -- Interface = 8; '', -- Module = 9; '', -- Property = 10; '', -- Unit = 11; '', -- Value = 12; '了', -- Enum = 13; '', -- Keyword = 14; '', -- Snippet = 15; '', -- Color = 16; '', -- File = 17; '', -- Reference = 18; '', -- Folder = 19; '', -- EnumMember = 20; '', -- Constant = 21; '', -- Struct = 22; '', -- Event = 23; '', -- Operator = 24; '', -- TypeParameter = 25; } local cmp = require('cmp') for index, value in ipairs(vim.lsp.protocol.CompletionItemKind) do cmp.lsp.CompletionItemKind[index] = value enda little snippet to implement lsplkind on nvim-cmp
great i am using it this way to show icon + text
for index, value in ipairs(vim.lsp.protocol.CompletionItemKind) do
cmp.lsp.CompletionItemKind[index] = value .. ' ' .. cmp.lsp.CompletionItemKind[index]
end
from nvim-cmp.
Are you using custom window to display completion candidates in cmp or standard vim/nvim one?
from nvim-cmp.
Sounds pretty cool! Will there then also be an option to just use the regular neovim completion menu?
from nvim-cmp.
Sounds pretty cool! Will there then also be an option to just use the regular neovim completion menu?
Sounds like you'd have to maintain two implementations to do that, one that conforms to the requirements of nvim's completion menu and one to a custom popup. I'm nowhere near the code but seems like it'd be easier to just add configuration options for whatever a person might want to disable/enable rather than implement/maintain both styles
from nvim-cmp.
I'm nowhere near the code but seems like it'd be easier to just add configuration options for whatever a person might want to disable/enable rather than implement/maintain both styles
Yeah, that's what I meant
from nvim-cmp.
I've added the API for it. see
https://github.com/hrsh7th/nvim-cmp#formattingformat-type-funentry-cmpentry-vim_item-vimcompleteditem-vimcompleteditem
from nvim-cmp.
Related Issues (20)
- Mapped confirm character breaks completion
- explain contextreason better in the docs
- command line completion appends unwanted forward slash HOT 1
- How to change the cmp source HOT 2
- Some information is put in formatting field "menu", which doesn't get truncated by maxwidth HOT 1
- nvim cmp breaks completion on input function HOT 1
- cmp:visible() is slow when typing due to onetime config
- suggestion: add "type checking" for sources
- Extra TS text appearing when doing cmp.mapping.select_next_item() HOT 4
- There's some extra `${}` text inserted when selecting first item HOT 1
- Mapping Enter or Shift-Enter does not work as expected HOT 2
- cmdline completion runs git commands resulting in many passphrase popups
- Selection cursor doesn't appear at the top of the autocompletion list for gopls HOT 3
- Please consider not using global variables HOT 4
- Documentation window obstructs suggestions window when suggestions window is too wide. HOT 1
- Fallback actions in `c` mode might be bugged for `Esc` HOT 2
- Goto next group_index ? HOT 1
- Main suggestion gets stuck in buffer, after changing focus to another window
- Speed / lag is hard to troubleshoot ? HOT 1
- Text completion does not include words with UTF-8 characters that take up more that a single byte HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-cmp.