mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-26 10:48:45 +02:00
feat(diagnostics): added icons
This commit is contained in:
parent
43a97bc7ce
commit
8834510d40
2 changed files with 45 additions and 2 deletions
30
lua/config/icons.lua
Normal file
30
lua/config/icons.lua
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
return {
|
||||||
|
diagnostics = {
|
||||||
|
Error = " ",
|
||||||
|
Warn = " ",
|
||||||
|
Hint = " ",
|
||||||
|
Info = " ",
|
||||||
|
},
|
||||||
|
kinds = {
|
||||||
|
Class = " ",
|
||||||
|
Color = " ",
|
||||||
|
Constant = " ",
|
||||||
|
Constructor = " ",
|
||||||
|
Enum = "了 ",
|
||||||
|
EnumMember = " ",
|
||||||
|
Field = " ",
|
||||||
|
File = " ",
|
||||||
|
Folder = " ",
|
||||||
|
Function = " ",
|
||||||
|
Interface = "ﰮ ",
|
||||||
|
Keyword = " ",
|
||||||
|
Method = "ƒ ",
|
||||||
|
Property = " ",
|
||||||
|
Snippet = " ",
|
||||||
|
Struct = " ",
|
||||||
|
Text = " ",
|
||||||
|
Unit = " ",
|
||||||
|
Value = " ",
|
||||||
|
Variable = " ",
|
||||||
|
},
|
||||||
|
}
|
|
@ -13,11 +13,24 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
|
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
|
||||||
{ "folke/neodev.nvim", config = true },
|
{ "folke/neodev.nvim", config = true },
|
||||||
{ "williamboman/mason.nvim", config = true },
|
{ "williamboman/mason.nvim", config = true, cmd = "Mason" },
|
||||||
{ "williamboman/mason-lspconfig.nvim", config = { ensure_installed = vim.tbl_keys(servers) } },
|
{ "williamboman/mason-lspconfig.nvim", config = { automatic_installation = true } },
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
|
-- diagnostics
|
||||||
|
for name, icon in pairs(require("config.icons").diagnostics) do
|
||||||
|
name = "DiagnosticSign" .. name
|
||||||
|
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||||
|
end
|
||||||
|
vim.diagnostic.config({
|
||||||
|
underline = true,
|
||||||
|
update_in_insert = false,
|
||||||
|
virtual_text = { spacing = 4, prefix = "●" },
|
||||||
|
severity_sort = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- lspconfig
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||||
for server, opts in pairs(servers) do
|
for server, opts in pairs(servers) do
|
||||||
opts.capabilities = capabilities
|
opts.capabilities = capabilities
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue