Add more options and icons to barbar
Move LSP icons to separate UI file to be re-used
This commit is contained in:
parent
c34b29c222
commit
b73d600dfe
|
@ -1,7 +1,7 @@
|
||||||
return {
|
return {
|
||||||
"romgrk/barbar.nvim",
|
"romgrk/barbar.nvim",
|
||||||
version = "^1.0.0", -- optional: only update when a new 1.x version is released
|
version = "^1.0.0", -- optional: only update when a new 1.x version is released
|
||||||
dependencies = "nvim-tree/nvim-web-devicons",
|
dependencies = { "lewis6991/gitsigns.nvim", "nvim-tree/nvim-web-devicons" },
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.barbar_auto_setup = false
|
vim.g.barbar_auto_setup = false
|
||||||
|
@ -20,9 +20,31 @@ return {
|
||||||
end,
|
end,
|
||||||
config = true,
|
config = true,
|
||||||
opts = {
|
opts = {
|
||||||
|
animation = true,
|
||||||
auto_hide = false,
|
auto_hide = false,
|
||||||
|
tabpages = true,
|
||||||
hide = { extensions = true },
|
hide = { extensions = true },
|
||||||
|
highlight_alternate = false,
|
||||||
|
highlight_inactive_file_icons = false,
|
||||||
|
highlight_visible = false,
|
||||||
modified = { button = "●" },
|
modified = { button = "●" },
|
||||||
pinned = { button = "車", filename = true, separator = { right = "" } },
|
pinned = { button = "車", filename = true, separator = { right = "" } },
|
||||||
|
icons = {
|
||||||
|
diagnostics = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = { enabled = true, icon = require("ui.lsp_icons").Error },
|
||||||
|
[vim.diagnostic.severity.WARN] = { enabled = true, icon = require("ui.lsp_icons").Warn },
|
||||||
|
[vim.diagnostic.severity.INFO] = { enabled = true, icon = require("ui.lsp_icons").Hint },
|
||||||
|
[vim.diagnostic.severity.HINT] = { enabled = true, icon = require("ui.lsp_icons").Info },
|
||||||
|
},
|
||||||
|
gitsigns = {
|
||||||
|
added = { enabled = true, icon = "+" },
|
||||||
|
changed = { enabled = true, icon = "~" },
|
||||||
|
deleted = { enabled = true, icon = "-" },
|
||||||
|
},
|
||||||
|
filetype = {
|
||||||
|
custom_colors = false,
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ local config = function()
|
||||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
||||||
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, opts)
|
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, opts)
|
||||||
|
|
||||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
local signs = require "ui.lsp_icons"
|
||||||
for type, icon in pairs(signs) do
|
for type, icon in pairs(signs) do
|
||||||
local hl = "DiagnosticSign" .. type
|
local hl = "DiagnosticSign" .. type
|
||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||||
|
|
1
lua/ui/lsp_icons.lua
Normal file
1
lua/ui/lsp_icons.lua
Normal file
|
@ -0,0 +1 @@
|
||||||
|
return { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
Loading…
Reference in a new issue