Skip to content

Commit 5b79608

Browse files
committed
Fix up tabs
1 parent f6e4f98 commit 5b79608

File tree

2 files changed

+49
-11
lines changed

2 files changed

+49
-11
lines changed

config/nvim/lazy-lock.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"vim-fugitive": { "branch": "master", "commit": "8c8cdf4405cb8bdb70dd9812a33bb52363a87dbc" },
7171
"vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" },
7272
"vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" },
73-
"which-key.nvim": { "branch": "main", "commit": "af4ded85542d40e190014c732fa051bdbf88be3d" },
7473
"vim-unimpaired": { "branch": "master", "commit": "6d44a6dc2ec34607c41ec78acf81657248580bf1" },
74+
"which-key.nvim": { "branch": "main", "commit": "af4ded85542d40e190014c732fa051bdbf88be3d" },
7575
"zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }
76-
}
76+
}
+47-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,50 @@
1-
-- better looking tabs
21
return {
3-
"akinsho/bufferline.nvim",
4-
dependencies = { "nvim-tree/nvim-web-devicons" },
5-
version = "*",
6-
opts = {
7-
options = {
8-
mode = "tabs",
9-
separator_style = "slant",
2+
"akinsho/bufferline.nvim",
3+
version = "v4.*", -- Automatically pulls the latest stable version
4+
lazy = false, -- Load the plugin immediately
5+
dependencies = { "nvim-tree/nvim-web-devicons" }, -- Optional: for file icons
6+
config = function()
7+
require("bufferline").setup({
8+
options = {
9+
numbers = "none", -- Can be "none", "ordinal", "buffer_id", or "both"
10+
close_command = "bdelete! %d", -- Command to close a buffer
11+
right_mouse_command = "bdelete! %d", -- Command for right-click buffer close
12+
left_mouse_command = "buffer %d", -- Command for left-click buffer switch
13+
middle_mouse_command = nil, -- Middle-click disables action
14+
indicator = { icon = "", style = "icon" }, -- Visual indicator for the active buffer
15+
buffer_close_icon = "",
16+
modified_icon = "",
17+
left_trunc_marker = "",
18+
right_trunc_marker = "",
19+
max_name_length = 18, -- Truncate buffer names
20+
max_prefix_length = 15, -- Truncate file path prefixes
21+
tab_size = 18,
22+
diagnostics = "nvim_lsp", -- Show diagnostics (or set to "coc", "ale", etc.)
23+
diagnostics_indicator = function(count, level)
24+
local icon = level:match("error") and "" or ""
25+
return " " .. icon .. count
26+
end,
27+
offsets = {
28+
{
29+
filetype = "NvimTree",
30+
text = "File Explorer", -- Text to display next to the offset
31+
text_align = "center",
32+
separator = true,
33+
},
34+
},
35+
show_buffer_icons = true, -- Show file type icons
36+
show_buffer_close_icons = true, -- Show close icons on each buffer
37+
show_close_icon = true, -- Show close icon in the bufferline
38+
separator_style = "slant", -- Options: "slant", "padded_slant", "thick", "thin", etc.
39+
enforce_regular_tabs = false, -- Ensure all tabs are the same width
40+
always_show_bufferline = true, -- Show bufferline even with one buffer
41+
},
42+
})
43+
end,
44+
keys = {
45+
{ "<Tab>", ":BufferLineCycleNext<CR>", desc = "Next buffer", silent = true },
46+
{ "<S-Tab>", ":BufferLineCyclePrev<CR>", desc = "Previous buffer", silent = true },
47+
{ "<leader>bp", ":BufferLinePick<CR>", desc = "Pick buffer" },
48+
{ "<leader>bc", ":BufferLinePickClose<CR>", desc = "Pick and close buffer" },
1049
},
11-
},
1250
}

0 commit comments

Comments
 (0)