Skip to content

Commit 93cfc88

Browse files
authored
Merge pull request s1n7ax#24 from adoyle-h/feat/selection_display
feat: add option "selection_display" to change display
2 parents a53a3b7 + f80963b commit 93cfc88

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ require 'window-picker'.setup({
109109
-- all the windows except the curren window will be highlighted using this
110110
-- color
111111
other_win_hl_color = '#44cc41',
112+
113+
-- You can change the display string in status bar.
114+
-- It supports '%' printf style. Such as `return char .. ': %f'` to display
115+
-- buffer filepath. See :h 'stl' for details.
116+
selection_display = function (char) return char end,
112117
})
113118
```
114119

lua/window-picker/config.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ local config = {
1111
-- following letters on them so you can use that letter to select the window
1212
selection_chars = 'FJDKSLA;CMRUEIWOQP',
1313

14+
-- You can change the display string in status bar.
15+
-- It supports '%' printf style. Such as `return char .. ': %f'` to display
16+
-- buffer filepath. See :h 'stl' for details.
17+
selection_display = function (char) return char end,
18+
1419
-- whether you want to use winbar instead of the statusline
1520
-- "always" means to always use winbar,
1621
-- "never" means to never use winbar

lua/window-picker/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function M.pick_window(custom_config)
196196

197197
win_map[char] = id
198198

199-
api.nvim_win_set_option(id, indicator_setting, '%=' .. char .. '%=')
199+
api.nvim_win_set_option(id, indicator_setting, '%=' .. conf.selection_display(char) .. '%=')
200200

201201
api.nvim_win_set_option(
202202
id,

0 commit comments

Comments
 (0)