Skip to content

Commit 1509ff5

Browse files
committed
feat: Allow customizing hl_group used on WindowPicker
- Default WindowPicker hl_group to StatusLineNC - Introduce `window_picker_hl_group` option to specify custom hl_group to be used
1 parent 37468ed commit 1509ff5

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ use 'sindrets/winshift.nvim'
4141
require("winshift").setup({
4242
highlight_moving_win = true, -- Highlight the window being moved
4343
focused_hl_group = "Visual", -- The highlight group used for the moving window
44+
window_picker_hl_group = "StatusLineNC" -- The highlight group used for the target windows
4445
moving_win_options = {
4546
-- These are local options applied to the moving window while it's
4647
-- being moved. They are unset when you leave Win-Move mode.

lua/winshift/colors.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,16 @@ function M.get_hl_groups()
171171
or (M.get_bg({ hl_focused, "Normal" }) or "white")
172172
local fg_focused = reverse and (M.get_bg({ hl_focused, "Normal" }) or "black") or nil
173173

174+
local hl_window_picker = config.get_config().window_picker_hl_group
175+
174176
return {
175177
Normal = { fg = fg_focused, bg = bg_focused },
176178
EndOfBuffer = { fg = bg_focused, bg = bg_focused },
177179
LineNr = { fg = M.get_fg("LineNr"), bg = bg_focused, gui = M.get_gui("LineNr") },
178180
CursorLineNr = { fg = M.get_fg("CursorLineNr"), bg = bg_focused, gui = M.get_gui("CursorLineNr") },
179181
SignColumn = { fg = M.get_fg("SignColumn"), bg = bg_focused },
180182
FoldColumn = { fg = M.get_fg("FoldColumn"), bg = bg_focused },
181-
WindowPicker = { fg = "#ededed", bg = "#4493c8", ctermfg = 255, ctermbg = 33, gui = "bold" },
183+
WindowPicker = { fg = M.get_fg(hl_window_picker), bg = M.get_bg(hl_window_picker), gui = M.get_gui(hl_window_picker) },
182184
}
183185
end
184186

lua/winshift/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local M = {}
55
M.defaults = {
66
highlight_moving_win = true,
77
focused_hl_group = "Visual",
8+
window_picker_hl_group = "StatusLineNC",
89
moving_win_options = {
910
wrap = false,
1011
cursorline = false,

0 commit comments

Comments
 (0)