File tree Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Expand file tree Collapse file tree 3 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,10 @@ The available configuration are:
170170 local modified_a = vim.fn.getftime(buffer_a.path)
171171 local modified_b = vim.fn.getftime(buffer_b.path)
172172 return modified_a > modified_b
173- end
173+ end,
174+ pick = {
175+ alphabet = "abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ1234567890",
176+ },
174177 }
175178 }
176179<
@@ -658,6 +661,19 @@ this can also be mapped to something like
658661 nnoremap <silent> gD :BufferLinePickClose<CR>
659662>
660663
664+ You can configure the characters used for selecting buffers using the
665+ `pick.alphabet` option. By default, both uppercase and lowercase
666+ alphanumeric characters are used.
667+ >lua
668+ options = {
669+ pick = {
670+ alphabet = "abcdefghijklmopqrstuvwxyz"
671+ }
672+ }
673+ <
674+
675+ With the configuration above, bufferline will only use lowercase letters.
676+
661677==============================================================================
662678MOUSE ACTIONS *bufferline-mouse-actions*
663679
Original file line number Diff line number Diff line change @@ -674,6 +674,9 @@ local function get_defaults()
674674 groups = { items = {}, options = { toggle_hidden_on_enter = true } },
675675 hover = { enabled = false , reveal = {}, delay = 200 },
676676 debug = { logging = false },
677+ pick = {
678+ alphabet = " abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ1234567890" ,
679+ },
677680 }
678681 return { options = opts , highlights = derive_colors (opts .style_preset ) }
679682end
Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ local strwidth = vim.api.nvim_strwidth
1010
1111M .current = {}
1212
13- local valid = " abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMOPQRSTUVWXYZ"
14-
1513function M .reset () M .current = {} end
1614
1715-- Prompts user to select a buffer then applies a function to the buffer
3533--- @param element bufferline.Tab | bufferline.Buffer
3634--- @return string ?
3735function M .get (element )
36+ local valid_alphabet = config .options .pick .alphabet
37+
3838 local first_letter = element .name :sub (1 , 1 )
39- -- should only match alphanumeric characters
40- local invalid_char = first_letter :match (" [^%w]" )
4139
42- if not M .current [first_letter ] and not invalid_char then
40+ local is_valid_char = first_letter :match (" [" .. valid_alphabet .. " ]" )
41+
42+ if not M .current [first_letter ] and is_valid_char then
4343 M .current [first_letter ] = element .id
4444 return first_letter
4545 end
46- for letter in valid :gmatch (" ." ) do
46+ for letter in valid_alphabet :gmatch (" ." ) do
4747 if not M .current [letter ] then
4848 M .current [letter ] = element .id
4949 return letter
You can’t perform that action at this time.
0 commit comments