2023-05-25 10:13:53 +01:00
|
|
|
return {
|
|
|
|
"romgrk/barbar.nvim",
|
|
|
|
version = "^1.0.0", -- optional: only update when a new 1.x version is released
|
2023-05-25 10:24:52 +01:00
|
|
|
dependencies = { "lewis6991/gitsigns.nvim", "nvim-tree/nvim-web-devicons" },
|
2023-05-25 10:13:53 +01:00
|
|
|
event = { "BufReadPre", "BufNewFile" },
|
|
|
|
init = function()
|
|
|
|
vim.g.barbar_auto_setup = false
|
|
|
|
vim.keymap.set("n", "<A-,>", "<Cmd>BufferPrevious<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<A-.>", "<Cmd>BufferNext<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<A-<>", "<Cmd>BufferMovePrevious<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<A->>", "<Cmd>BufferMoveNext<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<A-p>", "<Cmd>BufferPin<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<A-c>", "<Cmd>BufferClose<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<A-C>", "<Cmd>BufferCloseAllButCurrentOrPinned<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<C-p>", "<Cmd>BufferPick<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<Space>bb", "<Cmd>BufferOrderByBufferNumber<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<Space>bd", "<Cmd>BufferOrderByDirectory<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<Space>bl", "<Cmd>BufferOrderByLanguage<CR>", { noremap = true, silent = true })
|
|
|
|
vim.keymap.set("n", "<Space>bw", "<Cmd>BufferOrderByWindowNumber<CR>", { noremap = true, silent = true })
|
|
|
|
end,
|
|
|
|
config = true,
|
|
|
|
opts = {
|
2023-05-25 10:24:52 +01:00
|
|
|
animation = true,
|
2023-05-25 10:13:53 +01:00
|
|
|
auto_hide = false,
|
2023-05-25 10:24:52 +01:00
|
|
|
tabpages = true,
|
2023-05-25 10:13:53 +01:00
|
|
|
hide = { extensions = true },
|
2023-05-25 10:24:52 +01:00
|
|
|
highlight_alternate = false,
|
|
|
|
highlight_inactive_file_icons = false,
|
|
|
|
highlight_visible = false,
|
2023-05-25 10:13:53 +01:00
|
|
|
modified = { button = "●" },
|
|
|
|
pinned = { button = "車", filename = true, separator = { right = "" } },
|
2023-05-25 10:24:52 +01:00
|
|
|
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,
|
|
|
|
},
|
|
|
|
},
|
2023-05-25 10:13:53 +01:00
|
|
|
},
|
|
|
|
}
|