Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onsails/lspkind.nvim
vscode-like pictograms for neovim lsp completion items
https://github.com/onsails/lspkind.nvim
lsp lua neovim nvim
Last synced: about 1 month ago
JSON representation
vscode-like pictograms for neovim lsp completion items
- Host: GitHub
- URL: https://github.com/onsails/lspkind.nvim
- Owner: onsails
- License: mit
- Created: 2021-02-04T19:47:10.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-11T14:07:20.000Z (4 months ago)
- Last Synced: 2024-01-23T07:40:26.392Z (4 months ago)
- Topics: lsp, lua, neovim, nvim
- Language: Lua
- Homepage:
- Size: 618 KB
- Stars: 1,203
- Watchers: 6
- Forks: 30
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-neovim - onsails/lspkind.nvim - The plugin adds vscode-like icons to Neovim LSP completions. (LSP / (requires Neovim 0.5))
- my-awesome-stars - onsails/lspkind.nvim - vscode-like pictograms for neovim lsp completion items (Lua)
- awesome-stars - onsails/lspkind.nvim - vscode-like pictograms for neovim lsp completion items (Lua)
- awesome-stars - onsails/lspkind.nvim - vscode-like pictograms for neovim lsp completion items (Lua)
- awesome-stars - lspkind.nvim - like pictograms for neovim lsp completion items | onsails | 759 | (Lua)
- awesome-stars - onsails/lspkind.nvim - vscode-like pictograms for neovim lsp completion items (Lua)
- awesome-stars - onsails/lspkind.nvim - vscode-like pictograms for neovim lsp completion items (Lua)
- awesome-neovim - onsails/lspkind.nvim - The plugin adds vscode-like icons to Neovim LSP completions. (LSP / (requires Neovim 0.5))
- awesome-neovim - onsails/lspkind.nvim - The plugin adds vscode-like icons to Neovim LSP completions. (LSP / (requires Neovim 0.5))
README
# lspkind-nvim
This tiny plugin adds vscode-like pictograms to neovim built-in lsp:
![Screenshot](https://github.com/onsails/lspkind-nvim/raw/images/images/screenshot.png "Screenshot")
[nvim-compe](https://github.com/hrsh7th/nvim-compe), [vim-vsnip](https://github.com/hrsh7th/vim-vsnip), [vim-vsnip-integ](https://github.com/hrsh7th/vim-vsnip-integ), [jellybeans-nvim](https://github.com/metalelf0/jellybeans-nvim)## Requirements
- [A patched font](https://www.nerdfonts.com/)
## Configuration
### Option 1: vanilla Neovim LSP
Wherever you configure lsp put the following lua command:
```lua
require('lspkind').init({
-- DEPRECATED (use mode instead): enables text annotations
--
-- default: true
-- with_text = true,-- defines how annotations are shown
-- default: symbol
-- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
mode = 'symbol_text',-- default symbol map
-- can be either 'default' (requires nerd-fonts font) or
-- 'codicons' for codicon preset (requires vscode-codicons font)
--
-- default: 'default'
preset = 'codicons',-- override preset symbols
--
-- default: {}
symbol_map = {
Text = "",
Method = "",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
},
})
```### Option 2: [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
```lua
local lspkind = require('lspkind')
cmp.setup {
formatting = {
format = lspkind.cmp_format({
mode = 'symbol', -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
-- can also be a function to dynamically calculate max width such as
-- maxwidth = function() return math.floor(0.45 * vim.o.columns) end,
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
show_labelDetails = true, -- show labelDetails in menu. Disabled by default-- The function below will be called before any actual modifications from lspkind
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
before = function (entry, vim_item)
...
return vim_item
end
})
}
}
```## Related LSP plugins
[diaglist.nvim](https://github.com/onsails/diaglist.nvim) – live render workspace diagnostics in quickfix with current buf errors on top, buffer diagnostics in loclist