add bufferline
This commit is contained in:
parent
7b2cfd98dd
commit
e647e33d8f
4 changed files with 120 additions and 17 deletions
62
config/nvim/lua/aleidk/constants.lua
Normal file
62
config/nvim/lua/aleidk/constants.lua
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
return {
|
||||||
|
icons = {
|
||||||
|
misc = {
|
||||||
|
pint = " ",
|
||||||
|
},
|
||||||
|
dap = {
|
||||||
|
Stopped = { " ", "DiagnosticWarn", "DapStoppedLine" },
|
||||||
|
Breakpoint = " ",
|
||||||
|
BreakpointCondition = " ",
|
||||||
|
BreakpointRejected = { " ", "DiagnosticError" },
|
||||||
|
LogPoint = ".>",
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
Error = " ",
|
||||||
|
Warn = " ",
|
||||||
|
Hint = " ",
|
||||||
|
Info = " ",
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
added = " ",
|
||||||
|
modified = " ",
|
||||||
|
removed = " ",
|
||||||
|
},
|
||||||
|
kinds = {
|
||||||
|
Array = " ",
|
||||||
|
Boolean = " ",
|
||||||
|
Class = " ",
|
||||||
|
Color = " ",
|
||||||
|
Constant = " ",
|
||||||
|
Constructor = " ",
|
||||||
|
Copilot = " ",
|
||||||
|
Enum = " ",
|
||||||
|
EnumMember = " ",
|
||||||
|
Event = " ",
|
||||||
|
Field = " ",
|
||||||
|
File = " ",
|
||||||
|
Folder = " ",
|
||||||
|
Function = " ",
|
||||||
|
Interface = " ",
|
||||||
|
Key = " ",
|
||||||
|
Keyword = " ",
|
||||||
|
Method = " ",
|
||||||
|
Module = " ",
|
||||||
|
Namespace = " ",
|
||||||
|
Null = " ",
|
||||||
|
Number = " ",
|
||||||
|
Object = " ",
|
||||||
|
Operator = " ",
|
||||||
|
Package = " ",
|
||||||
|
Property = " ",
|
||||||
|
Reference = " ",
|
||||||
|
Snippet = " ",
|
||||||
|
String = " ",
|
||||||
|
Struct = " ",
|
||||||
|
Text = " ",
|
||||||
|
TypeParameter = " ",
|
||||||
|
Unit = " ",
|
||||||
|
Value = " ",
|
||||||
|
Variable = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
57
config/nvim/lua/aleidk/plugins/bufferline.lua
Normal file
57
config/nvim/lua/aleidk/plugins/bufferline.lua
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
return {
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
after = "onedark",
|
||||||
|
keys = {
|
||||||
|
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
|
||||||
|
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
|
||||||
|
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev buffer" },
|
||||||
|
{ "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next buffer" },
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"echasnovski/mini.bufremove",
|
||||||
|
-- stylua: ignore
|
||||||
|
keys = {
|
||||||
|
{ "<leader>bd", function() require("mini.bufremove").delete(0, false) end, desc = "Delete Buffer" },
|
||||||
|
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
opts = {
|
||||||
|
highlights = { separator = { bg = "NONE" } },
|
||||||
|
options = {
|
||||||
|
-- FIXME: Doesn't work with onedark pro colorscheme
|
||||||
|
-- separator_style = "padded_slant",
|
||||||
|
-- themable = true,
|
||||||
|
close_command = function(n)
|
||||||
|
require("mini.bufremove").delete(n, false)
|
||||||
|
end,
|
||||||
|
-- stylua: ignore
|
||||||
|
right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
diagnostics_indicator = function(_, _, diag)
|
||||||
|
local icons = require("aleidk.constants").icons.diagnostics
|
||||||
|
local ret = (diag.error and icons.Error .. diag.error .. " " or "")
|
||||||
|
.. (diag.warning and icons.Warn .. diag.warning or "")
|
||||||
|
return vim.trim(ret)
|
||||||
|
end,
|
||||||
|
offsets = {
|
||||||
|
{
|
||||||
|
filetype = "NvimTree",
|
||||||
|
-- text = "nvim-tree",
|
||||||
|
highlight = "Directory",
|
||||||
|
text_align = "left",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
groups = {
|
||||||
|
items = {
|
||||||
|
require("bufferline.groups").builtin.pinned:with({ icon = "" }),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
require("bufferline").setup(opts)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
return {
|
|
||||||
"rebelot/heirline.nvim",
|
|
||||||
-- You can optionally lazy-load heirline on UiEnter
|
|
||||||
-- to make sure all required plugins and colorschemes are loaded before setup
|
|
||||||
event = "UiEnter",
|
|
||||||
config = function()
|
|
||||||
require("heirline").setup({
|
|
||||||
statusline = {},
|
|
||||||
winbar = {},
|
|
||||||
tabline = {},
|
|
||||||
statuscolumn = {},
|
|
||||||
opts = {},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
@ -8,7 +8,6 @@ return {
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
local tree = require("nvim-tree")
|
local tree = require("nvim-tree")
|
||||||
local tree_cb = require("nvim-tree.config").nvim_tree_callback
|
|
||||||
local api = require("nvim-tree.api")
|
local api = require("nvim-tree.api")
|
||||||
|
|
||||||
tree.setup({
|
tree.setup({
|
||||||
|
|
@ -32,7 +31,7 @@ return {
|
||||||
},
|
},
|
||||||
view = {
|
view = {
|
||||||
centralize_selection = true, -- center current file on enter
|
centralize_selection = true, -- center current file on enter
|
||||||
width = 30, -- N° of columns or %
|
width = 30, -- N° of columns or %
|
||||||
},
|
},
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
local function opts(desc)
|
local function opts(desc)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue