From 82879f5e038540f57bd6110a32f00831586226cb Mon Sep 17 00:00:00 2001 From: Haelnorr Date: Sat, 15 Feb 2025 09:48:01 +1100 Subject: [PATCH] Added bufferline.nvim --- lazy-lock.json | 1 + lua/haelnorr/lazy/bufferline.lua | 30 ++++++++++++++++++++++++++++++ lua/haelnorr/lazy/catppuccin.lua | 2 ++ lua/haelnorr/lazy/which-key.lua | 1 + lua/haelnorr/remap.lua | 2 ++ 5 files changed, 36 insertions(+) create mode 100644 lua/haelnorr/lazy/bufferline.lua diff --git a/lazy-lock.json b/lazy-lock.json index 884c754..4f551ec 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,6 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, "aerial.nvim": { "branch": "master", "commit": "a89f5e39bbbd445242eebdbaac971e0c70ddd3b4" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "cellular-automaton.nvim": { "branch": "main", "commit": "1606e9d5d04ff254023c3f3c62842d065708d6d3" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, diff --git a/lua/haelnorr/lazy/bufferline.lua b/lua/haelnorr/lazy/bufferline.lua new file mode 100644 index 0000000..fa1e745 --- /dev/null +++ b/lua/haelnorr/lazy/bufferline.lua @@ -0,0 +1,30 @@ +return { + "akinsho/bufferline.nvim", + version = "*", + dependencies = { + "nvim-tree/nvim-web-devicons", + "catppuccin/nvim", + }, + config = function() + vim.opt.termguicolors = true + local bufferline = require("bufferline") + local mocha = require("catppuccin.palettes").get_palette("mocha") + bufferline.setup({ + options = { + always_show_bufferline = false, + auto_toggle_bufferline = true, + }, + highlights = require("catppuccin.groups.integrations.bufferline").get({ + styles = { "italic", "bold" }, + custom = { + all = { + fill = { bg = mocha.base }, + }, + mocha = { + background = { fg = mocha.text }, + }, + }, + }), + }) + end, +} diff --git a/lua/haelnorr/lazy/catppuccin.lua b/lua/haelnorr/lazy/catppuccin.lua index 3cf147e..d82898c 100644 --- a/lua/haelnorr/lazy/catppuccin.lua +++ b/lua/haelnorr/lazy/catppuccin.lua @@ -30,10 +30,12 @@ return { background = true, }, }, + nvim_surround = true, telescope = { enabled = true, }, treesitter = true, + which_key = true, }, }) vim.cmd("colorscheme catppuccin-mocha") diff --git a/lua/haelnorr/lazy/which-key.lua b/lua/haelnorr/lazy/which-key.lua index 030e236..6d011c3 100644 --- a/lua/haelnorr/lazy/which-key.lua +++ b/lua/haelnorr/lazy/which-key.lua @@ -32,6 +32,7 @@ return { { "l", "LspRestart", desc = "Restart LSP" }, { "c", "Lazy reload conform.nvim", desc = "Reload Conform" }, { "o", "Lazy reload oil.nvim", desc = "Reload Oil" }, + { "b", "Lazy reload bufferline.nvim", desc = "Reload Bufferline" }, -- Harpoon -- Quick jumps and show list diff --git a/lua/haelnorr/remap.lua b/lua/haelnorr/remap.lua index 1b92e57..4788d6d 100644 --- a/lua/haelnorr/remap.lua +++ b/lua/haelnorr/remap.lua @@ -15,6 +15,8 @@ vim.keymap.set("n", "", "cprevzz") vim.keymap.set("n", "k", "lnextzz", { desc = "Quickfix next" }) vim.keymap.set("n", "j", "lprevzz", { desc = "Quickfix prev" }) +vim.keymap.set("n", "q", "bw", { desc = "Close file" }) + vim.keymap.set( "n", "s",