diff options
| author | ache <ache@ache.one> | 2024-08-09 05:57:20 +0200 |
|---|---|---|
| committer | ache <ache@ache.one> | 2024-08-09 05:57:20 +0200 |
| commit | 08a715f6375694f37be30afdddb2025dcde2133b (patch) | |
| tree | 175575cb23c87fcff02b77b3beaefd11736785fd /lua/ache/plugins | |
| parent | Typo in plugin name firenvim (diff) | |
Set bufferline shortcuts
Diffstat (limited to 'lua/ache/plugins')
| -rw-r--r-- | lua/ache/plugins/bufferline.lua | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/lua/ache/plugins/bufferline.lua b/lua/ache/plugins/bufferline.lua index 8fe18e3..8d2dbaa 100644 --- a/lua/ache/plugins/bufferline.lua +++ b/lua/ache/plugins/bufferline.lua @@ -1,11 +1,33 @@ return { - "akinsho/bufferline.nvim", - version = "*", - dependencies = "nvim-tree/nvim-web-devicons", - config = function() - vim.opt.termguicolors = true - require("bufferline").setup({}) - vim.keymap.set("n", "<tab>", "<cmd>bnext<cr>") - vim.keymap.set("n", "<s-tab>", "<cmd>bprev<cr>") - end, + "akinsho/bufferline.nvim", + version = "*", + dependencies = "nvim-tree/nvim-web-devicons", + config = function() + vim.opt.termguicolors = true + require("bufferline").setup({ + options = { + separator_style = "slope", -- padded_slope doesn't render properly + diagnostics = "nvim_lsp", + }, + }) + + vim.keymap.set("n", "<tab>", "<cmd>bnext<cr>") + vim.keymap.set("n", "<s-tab>", "<cmd>bprev<cr>") + + vim.keymap.set("n", "<leader>tx", function() + vim.api.nvim_command("bp|sp|bn|bd") + end, { desc = "Close current bufferline tab" }) + + vim.keymap.set("n", "<leader>tl", function() + vim.api.nvim_command("BufferLineCloseLeft") + end, { desc = "Close bufferline tabs on the left" }) + + vim.keymap.set("n", "<leader>tr", function() + vim.api.nvim_command("BufferLineCloseRight") + end, { desc = "Close bufferline tabs on the right" }) + + vim.keymap.set("n", "<leader>to", function() + vim.api.nvim_command("BufferLineCloseOthers") + end, { desc = "Close others bufferline tabs" }) + end, } |