From 519e658693f0a4c8fc194b022d8fa3faf6df9945 Mon Sep 17 00:00:00 2001 From: aleidk Date: Sun, 21 Jul 2024 13:00:58 -0400 Subject: [PATCH] Remove bufferline plugin in favor of only having lualine --- .../dot_config/nvim/lua/aleidk/keymaps.lua | 5 +- .../nvim/lua/aleidk/plugins/bookmarks.lua | 2 +- .../nvim/lua/aleidk/plugins/bufferline.lua | 78 --------------- .../nvim/lua/aleidk/plugins/lualine.lua | 94 +++++++++++++++---- 4 files changed, 79 insertions(+), 100 deletions(-) delete mode 100644 chezmoi/dot_config/nvim/lua/aleidk/plugins/bufferline.lua diff --git a/chezmoi/dot_config/nvim/lua/aleidk/keymaps.lua b/chezmoi/dot_config/nvim/lua/aleidk/keymaps.lua index 35c21a6..75b54d7 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/keymaps.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/keymaps.lua @@ -62,4 +62,7 @@ vim.keymap.set("n", "uI", fixIndentation, default("Fix indentation")) vim.keymap.set("n", "uh", ":nohl", default("Remove search highlight")) -vim.keymap.set('t', '', '', default("Exit insert mode on terminal")) +vim.keymap.set("t", "", "", default("Exit insert mode on terminal")) + +vim.keymap.set("n", "bc", "bd", default("Close buffer")) +vim.keymap.set("n", "bA", "bufdo bd", default("Close all buffers")) diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/bookmarks.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/bookmarks.lua index 02cefcc..fcfd24f 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/bookmarks.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/bookmarks.lua @@ -3,7 +3,7 @@ return { dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true }, }, - event = { "BufReadPost", "BufNewFile" }, + lazy = false, cmd = "Grapple", keys = { { "a", "Grapple toggle", desc = "Toggle bookmark for current file" }, diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/bufferline.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/bufferline.lua deleted file mode 100644 index 369f4bf..0000000 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/bufferline.lua +++ /dev/null @@ -1,78 +0,0 @@ -return { - "akinsho/bufferline.nvim", - event = "VeryLazy", - keys = { - { "bp", "BufferLineTogglePin", desc = "Toggle pin" }, - { "bP", "BufferLineGroupClose ungrouped", desc = "Close non-pinned buffers" }, - { "bO", "BufferLineCloseOthers", desc = "Close non focused buffers" }, - { "bA", "bufdo bd", desc = "Close all buffers" }, - { "bh", "BufferLineMovePrev", desc = "Move buffer to right" }, - { "bl", "BufferLineMoveNext", desc = "Move buffer to left" }, - { "", "BufferLineCyclePrev", desc = "Prev buffer" }, - { "", "BufferLineCycleNext", desc = "Next buffer" }, - }, - dependencies = { - { - "echasnovski/mini.bufremove", - -- stylua: ignore - keys = { - { "bc", function() require("mini.bufremove").delete(0, false) end, desc = "Close Buffer" }, - { "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, -} diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/lualine.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/lualine.lua index c2fe5e0..e12fff4 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/lualine.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/lualine.lua @@ -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",