@@ -89,10 +89,6 @@ nmap("<C-Space>", "<CMD>NvimTmuxNavigateNext<CR>")
8989nmap (" <M-Right>" , " <CMD>BufferLineCycleNext<CR>" )
9090nmap (" <M-Left>" , " <CMD>BufferLineCyclePrev<CR>" )
9191
92- nmap (" <M-3>" , " <leader>Tf" )
93- nmap (" <M-2>" , " <leader>Th" )
94- nmap (" <M-1>" , " <leader>Tv" )
95-
9692-- which-key setup
9793-- unmap things that I want to use
9894wunmap (" `" )
@@ -122,21 +118,30 @@ mappings["h"] = { "<CMD>nohlsearch<CR>", "No Highlight" }
122118
123119-- buffers operations
124120mappings [" <Tab>" ] = { " <CMD>edit #<CR>" , " Previous Active Buffer" }
121+
122+ -- buffer quick switch index starts at 1 instead of 0
123+ wk .add ({
124+ {
125+ " <leader>" ,
126+ group = " buffers" ,
127+ expand = function ()
128+ local buf_entries = require (" which-key.extras" ).expand .buf ()
129+ buf_entries = vim .list_slice (buf_entries , 1 , 9 )
130+ -- Increment displayed index by 1 for each entry
131+ for _ , entry in ipairs (buf_entries ) do
132+ entry [1 ] = tostring (tonumber (entry [1 ]) + 1 ) -- Convert "0" → "1", etc.
133+ end
134+
135+ return buf_entries
136+ end ,
137+ },
138+ })
125139mappings [" 0" ] = {
126140 function ()
127141 require (" neo-tree.command" ).execute ({ toggle = false , dir = vim .uv .cwd () })
128142 end ,
129143 " Focus Explorer" ,
130144}
131- mappings [" 1" ] = { " <CMD>BufferLineGoToBuffer 1<CR>" , " Select Buffer 1" }
132- mappings [" 2" ] = { " <CMD>BufferLineGoToBuffer 2<CR>" , " Select Buffer 2" }
133- mappings [" 3" ] = { " <CMD>BufferLineGoToBuffer 3<CR>" , " Select Buffer 3" }
134- mappings [" 4" ] = { " <CMD>BufferLineGoToBuffer 4<CR>" , " Select Buffer 4" }
135- mappings [" 5" ] = { " <CMD>BufferLineGoToBuffer 5<CR>" , " Select Buffer 5" }
136- mappings [" 6" ] = { " <CMD>BufferLineGoToBuffer 6<CR>" , " Select Buffer 6" }
137- mappings [" 7" ] = { " <CMD>BufferLineGoToBuffer 7<CR>" , " Select Buffer 7" }
138- mappings [" 8" ] = { " <CMD>BufferLineGoToBuffer 8<CR>" , " Select Buffer 8" }
139- mappings [" 9" ] = { " <CMD>BufferLineGoToBuffer 9<CR>" , " Select Buffer 9" }
140145
141146mappings [" b/" ] = { " <CMD>Telescope buffers previewer=true<CR>" , " Find" }
142147mappings [" b]" ] = { " <CMD>BufferLineCycleNext<CR>" , " Next" }
0 commit comments