Remove bufferline plugin in favor of only having lualine

This commit is contained in:
Alexander Navarro 2024-07-21 13:00:58 -04:00
parent 183e3303be
commit 519e658693
4 changed files with 79 additions and 100 deletions

View file

@ -62,4 +62,7 @@ vim.keymap.set("n", "<Leader>uI", fixIndentation, default("Fix indentation"))
vim.keymap.set("n", "<Leader>uh", ":nohl<CR>", default("Remove search highlight"))
vim.keymap.set('t', '<ESC>', '<C-\\><C-n>', default("Exit insert mode on terminal"))
vim.keymap.set("t", "<ESC>", "<C-\\><C-n>", default("Exit insert mode on terminal"))
vim.keymap.set("n", "<leader>bc", "<Cmd>bd<CR>", default("Close buffer"))
vim.keymap.set("n", "<leader>bA", "<Cmd>bufdo bd<CR>", default("Close all buffers"))

View file

@ -3,7 +3,7 @@ return {
dependencies = {
{ "nvim-tree/nvim-web-devicons", lazy = true },
},
event = { "BufReadPost", "BufNewFile" },
lazy = false,
cmd = "Grapple",
keys = {
{ "<leader><leader>a", "<cmd>Grapple toggle<cr>", desc = "Toggle bookmark for current file" },

View file

@ -1,78 +0,0 @@
return {
"akinsho/bufferline.nvim",
event = "VeryLazy",
keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Close non-pinned buffers" },
{ "<leader>bO", "<Cmd>BufferLineCloseOthers<CR>", desc = "Close non focused buffers" },
{ "<leader>bA", "<Cmd>bufdo bd<CR>", desc = "Close all buffers" },
{ "<leader>bh", "<Cmd>BufferLineMovePrev<CR>", desc = "Move buffer to right" },
{ "<leader>bl", "<Cmd>BufferLineMoveNext<CR>", desc = "Move buffer to left" },
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev buffer" },
{ "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next buffer" },
},
dependencies = {
{
"echasnovski/mini.bufremove",
-- stylua: ignore
keys = {
{ "<leader>bc", function() require("mini.bufremove").delete(0, false) end, desc = "Close Buffer" },
{ "<leader>bC", function() require("mini.bufremove").delete(0, true) end, desc = "Close Buffer (Force)" },
},
},
},
config = function()
local opts = {
highlights = { separator = { bg = "NONE" } },
options = {
-- separator_style = "padded_slant",
-- themable = true,
close_command = function(n)
require("mini.bufremove").delete(n, false)
end,
-- stylua: ignore
always_show_bufferline = false,
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,
-- return false to exluce buffers
custom_filter = function(buf_number)
if vim.bo[buf_number].filetype == "qf" then
return false
end
if vim.fn.bufname(buf_number) == "" then
return false
end
-- disable for dadbod query buffers
if string.find(vim.fn.bufname(buf_number), "db_ui") then
return false
end
return true
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,
}

View file

@ -3,6 +3,7 @@ return {
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
"cbochs/grapple.nvim",
},
opts = function()
local icons = require("aleidk.constants").icons
@ -48,6 +49,51 @@ return {
lualine_b = {},
lualine_c = {
{ "branch", icon = icons.git.branch },
{
"overseer",
},
{
-- Macro recording status
function()
return require("noice").api.status.mode.get()
end,
cond = function()
return package.loaded["noice"] and require("noice").api.status.mode.has()
end,
},
},
lualine_x = {
{
function()
return require("grapple").statusline()
end,
},
},
lualine_y = {
{ "searchcount" },
{ "location" },
{
"progress",
fmt = position_scrollbar,
separator = " ",
padding = 0,
},
},
lualine_z = {},
},
winbar = {
lualine_b = {
{
"filename",
path = 1,
symbols = {
modified = "", -- Text to show when the buffer is modified
alternate_file = "#", -- Text to show to identify the alternate file
directory = "", -- Text to show when the buffer is a directory
},
},
},
lualine_y = {
{
"diff",
symbols = {
@ -66,32 +112,40 @@ return {
hint = icons.diagnostics.Hint,
},
},
{
"overseer",
},
{
-- Macro recording status
function()
return require("noice").api.status.mode.get()
end,
cond = function()
return package.loaded["noice"] and require("noice").api.status.mode.has()
end,
},
},
lualine_x = {
{ "searchcount" },
},
inactive_winbar = {
lualine_b = {
{
"filename",
path = 1,
symbols = {
modified = "", -- Text to show when the buffer is modified
alternate_file = "#", -- Text to show to identify the alternate file
directory = "", -- Text to show when the buffer is a directory
},
},
},
lualine_y = {
{ "location" },
{
"progress",
fmt = position_scrollbar,
separator = " ",
padding = 0,
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = diff_source,
},
{
"diagnostics",
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
},
lualine_z = {},
},
extensions = {
"neo-tree",