[vim/vim] feat: add 'winhighlight' option (PR #19493)

22 views
Skip to first unread message

Foxe Chen

unread,
Feb 23, 2026, 9:32:27 PM (yesterday) Feb 23
to vim/vim, Subscribed

Same as Neovim's winhighlight option, as said here:

'winhighlight' 'winhl'	string	(default "")
			local to window
	Window-local highlights.  Comma-delimited list of highlight
	|group-name| pairs "{hl-from}:{hl-to},..." where each {hl-from} is
	a |highlight-groups| item to be overridden by {hl-to} group in
	the window.

	Note: highlight namespaces take precedence over 'winhighlight'.
	See |nvim_win_set_hl_ns()| and |nvim_set_hl()|.

	Highlights of vertical separators are determined by the window to the
	left of the separator.  The 'tabline' highlight of a tabpage is
	decided by the last-focused window of the tabpage.  Highlights of
	the popupmenu are determined by the current window.  Highlights in the
	message area cannot be overridden.

	Example: show a different color for non-current windows: >vim
		set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC

Fixes #3576

Demo:

https://github.com/user-attachments/assets/18e2f771-63d8-442a-83ff-70d469de87bf

I will add docs and tests later (also need to add cmdline completion)


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19493

Commit Summary

  • fb999d3 add 'winhighlight' option

File Changes

(12 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493@github.com>

Foxe Chen

unread,
Feb 23, 2026, 9:33:50 PM (yesterday) Feb 23
to vim/vim, Push

@64-bitman pushed 1 commit.

  • ddcec1c add 'winhighlight' option


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/fb999d3f4ec2e9c244fd8adfd63a96eed509ae67/after/ddcec1c2719c0eaae5f797af034a0e6150dbd8b7@github.com>

Foxe Chen

unread,
Feb 23, 2026, 9:34:47 PM (yesterday) Feb 23
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 649e527 add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/ddcec1c2719c0eaae5f797af034a0e6150dbd8b7/after/649e527cf5b1e2770ca235de2f28080d27cf8ffb@github.com>

Foxe Chen

unread,
Feb 23, 2026, 9:35:41 PM (yesterday) Feb 23
to vim/vim, Push

@64-bitman pushed 1 commit.

  • b7e2c7d add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/649e527cf5b1e2770ca235de2f28080d27cf8ffb/after/b7e2c7da7f30955143f1417680826576c3530d97@github.com>

Foxe Chen

unread,
Feb 23, 2026, 9:40:02 PM (yesterday) Feb 23
to vim/vim, Push

@64-bitman pushed 1 commit.

  • e759a47 add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/b7e2c7da7f30955143f1417680826576c3530d97/after/e759a4748c6978a7da7a08703f8659757ec861f9@github.com>

Foxe Chen

unread,
Feb 23, 2026, 9:42:49 PM (yesterday) Feb 23
to vim/vim, Push

@64-bitman pushed 1 commit.

  • c53b4a4 add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/e759a4748c6978a7da7a08703f8659757ec861f9/after/c53b4a42415f464a9e20ef45b2a15dd11618cbf9@github.com>

Foxe Chen

unread,
Feb 23, 2026, 9:48:17 PM (yesterday) Feb 23
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 6c2e7e8 add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/c53b4a42415f464a9e20ef45b2a15dd11618cbf9/after/6c2e7e869463618b57d547606315318eff058de6@github.com>

Foxe Chen

unread,
Feb 23, 2026, 10:33:18 PM (yesterday) Feb 23
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 819c194 add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/6c2e7e869463618b57d547606315318eff058de6/after/819c19453eaaac697ad18d64e60c8e5f96b35849@github.com>

Foxe Chen

unread,
Feb 23, 2026, 11:00:09 PM (24 hours ago) Feb 23
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 16bd90b add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/819c19453eaaac697ad18d64e60c8e5f96b35849/after/16bd90bfe12e8d47f19721086c748f7cf1785f5c@github.com>

mityu

unread,
Feb 23, 2026, 11:27:01 PM (23 hours ago) Feb 23
to vim/vim, Subscribed
mityu left a comment (vim/vim#19493)

I'm wondering that this option conflicts with the 'wincolor' option. Is this OK?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/c3948908470@github.com>

Foxe Chen

unread,
Feb 23, 2026, 11:40:24 PM (23 hours ago) Feb 23
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19493)

I'm wondering that this option conflicts with the 'wincolor' option. Is this OK?

I suppose we can just make wincolor use winhighlight internally


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/c3948949248@github.com>

Foxe Chen

unread,
7:23 AM (15 hours ago) 7:23 AM
to vim/vim, Push

@64-bitman pushed 1 commit.

  • b5dad62 add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/16bd90bfe12e8d47f19721086c748f7cf1785f5c/after/b5dad62435930b7dc8e03ea4a4195b1a27bb20f2@github.com>

Foxe Chen

unread,
7:23 AM (15 hours ago) 7:23 AM
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19493)

My use case for this was to have hlsearch only for the current window:

vim9script

var save: list<dict<any>>

autocmd CmdlineEnter [\/\?] {
    set hlsearch

    save = hlget("Search")

    var id: number = save[0].id

    save[0].name = "SearchTemp"
    save[0].id = 0

    hlset(save)

    save[0].name = "Search"
    save[0].id = id

    hi clear Search

    setlocal whl=Search:SearchTemp
}
autocmd CmdlineLeave [\/\?] {
    set nohlsearch

    hi clear SearchTemp

    hlset(save)
    setlocal whl=
}


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/c3951384881@github.com>

Foxe Chen

unread,
7:29 AM (15 hours ago) 7:29 AM
to vim/vim, Push

@64-bitman pushed 1 commit.

  • aa716aa add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/b5dad62435930b7dc8e03ea4a4195b1a27bb20f2/after/aa716aa69b624545284c1e60992ce98bacad79ab@github.com>

Foxe Chen

unread,
7:36 AM (15 hours ago) 7:36 AM
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 6cbca9a add 'winhighlight' option

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/aa716aa69b624545284c1e60992ce98bacad79ab/after/6cbca9ac6d7e2b16b7f399bc4e2cba3fb10ebc7e@github.com>

Foxe Chen

unread,
8:15 AM (15 hours ago) 8:15 AM
to vim/vim, Push

@64-bitman pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/6cbca9ac6d7e2b16b7f399bc4e2cba3fb10ebc7e/after/f582e21a813405898610942a3629f4f1da7cc519@github.com>

Foxe Chen

unread,
8:21 AM (14 hours ago) 8:21 AM
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 24c48da move hl overriding to update_screen()

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/f582e21a813405898610942a3629f4f1da7cc519/after/24c48dabe51286499aaef73ab7c3a548d1b3e366@github.com>

Foxe Chen

unread,
1:57 PM (9 hours ago) 1:57 PM
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 87c14d5 move hl overriding to update_screen()

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/24c48dabe51286499aaef73ab7c3a548d1b3e366/after/87c14d5a005a49925a5a6f81f49dcaf756fdbe03@github.com>

Foxe Chen

unread,
3:34 PM (7 hours ago) 3:34 PM
to vim/vim, Push

@64-bitman pushed 2 commits.

  • 72c0a17 stop window local highlights from another window affecting currently rendering window
  • 8c28f79 update tests

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19493/before/87c14d5a005a49925a5a6f81f49dcaf756fdbe03/after/8c28f7940b41505047f1fea89bc6a00d2343f99d@github.com>

Reply all
Reply to author
Forward
0 new messages