diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua index eef982c..bb5750e 100644 --- a/lua/plugins/barbar.lua +++ b/lua/plugins/barbar.lua @@ -1,7 +1,7 @@ return { "romgrk/barbar.nvim", 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" }, init = function() vim.g.barbar_auto_setup = false @@ -20,9 +20,31 @@ return { end, config = true, opts = { + animation = true, auto_hide = false, + tabpages = true, hide = { extensions = true }, + highlight_alternate = false, + highlight_inactive_file_icons = false, + highlight_visible = false, modified = { button = "●" }, 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, + }, + }, }, } diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 8f2746e..0d0c6be 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -38,7 +38,7 @@ local config = function() vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) - local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } + local signs = require "ui.lsp_icons" for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) diff --git a/lua/ui/lsp_icons.lua b/lua/ui/lsp_icons.lua new file mode 100644 index 0000000..fa9d45e --- /dev/null +++ b/lua/ui/lsp_icons.lua @@ -0,0 +1 @@ +return { Error = " ", Warn = " ", Hint = " ", Info = " " }