[vim/vim] Add clickable regions to statusline with %[FuncName] item (PR #19841)

3 views
Skip to first unread message

mattn

unread,
Mar 26, 2026, 11:17:42 PM (7 hours ago) Mar 26
to vim/vim, Subscribed

Add support for clickable regions in the statusline using %[FuncName] syntax. When a user clicks on a region, the specified Vim function is called with a dictionary argument. The function can return non-zero to trigger a statusline redraw.

%[FuncName] starts a clickable region, %[] ends it. If %[] is omitted, the region extends to the end of the statusline. %N[FuncName] passes an identifier N to the callback as minwid.

The callback receives a Dictionary with:

  • minwid: identifier from %N[Func] (0 if not specified)
  • nclicks: number of clicks (1, 2, or 3)
  • button: "l" (left), "m" (middle), "r" (right)
  • mods: modifier keys, combination of "s" (shift), "c" (ctrl), "a" (alt)
  • winid: window-ID of the clicked statusline

Use has('statusline_click') to check availability.

func! ClickFile(info)
    if a:info.button ==# 'l' && a:info.nclicks == 2
        browse edit
    endif
    return 0
endfunc
set statusline=%[ClickFile]%f%[]\ %l:%c

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

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

Commit Summary

  • 58e54ab Add clickable regions to statusline with %@FuncName@ item
  • 55e5cc4 Change statusline click notation from %@FuncName@ to %[FuncName]
  • 233a453 Merge remote-tracking branch 'origin/master' into statusline-click

File Changes

(16 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/19841@github.com>

mattn

unread,
Mar 26, 2026, 11:31:24 PM (7 hours ago) Mar 26
to vim/vim, Push

@mattn pushed 1 commit.

  • ee84edf Merge remote-tracking branch 'origin/master' into statusline-click


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19841/before/233a453cdb5276700a956596997315767dc2e575/after/ee84edfec0e2c90d08ec4617d3a992eb40b0731f@github.com>

mattn

unread,
Mar 26, 2026, 11:37:43 PM (7 hours ago) Mar 26
to vim/vim, Subscribed
mattn left a comment (vim/vim#19841)

I plan to add clickable region support for tabpanel as well in a follow-up.


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

mattn

unread,
Mar 26, 2026, 11:52:48 PM (6 hours ago) Mar 26
to vim/vim, Push

@mattn pushed 1 commit.

  • 0f30a67 Fix compiler warnings in statusline click code


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19841/before/27370a60fba5b2719039f0538526af15fe4c1a4a/after/0f30a6769f6fb7ac191ee8edd72427163874847d@github.com>

Reply all
Reply to author
Forward
0 new messages