[vim/vim] runtime(skhd): Add skhd syntax file (PR #19235)

12 views
Skip to first unread message

Kiyoon Kim

unread,
Jan 21, 2026, 8:36:29 PM (2 days ago) Jan 21
to vim/vim, Subscribed

Add syntax highlighting for skhd (simple hotkey daemon for macOS) configuration files. Includes filetype detection for skhdrc and .skhdrc files.


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

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

Commit Summary

  • 84e44d3 runtime(skhd): Add skhd syntax file

File Changes

(10 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/19235@github.com>

Kiyoon Kim

unread,
Jan 21, 2026, 8:45:40 PM (2 days ago) Jan 21
to vim/vim, Push

@kiyoon pushed 1 commit.

  • 45e80fc runtime(skhd): Add skhd syntax file


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19235/before/2b1ce4319ad6fd8aecbbb82a18622c7f5a9ecdd0/after/45e80fc0a5a6d88fb9c0b19491db3a814ffc2366@github.com>

Kiyoon Kim

unread,
Jan 21, 2026, 11:07:23 PM (2 days ago) Jan 21
to vim/vim, Subscribed
kiyoon left a comment (vim/vim#19235)

How do I fix the failing CI?


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/19235/c3782403288@github.com>

dkearns

unread,
Jan 22, 2026, 7:41:51 AM (yesterday) Jan 22
to vim/vim, Subscribed

@dkearns requested changes on this pull request.

Thanks for the PR and extra browny points for the syntax test file.

Could you also add a simple ftplugin that defines, at least, comments and commentstring?


In Filelist:

> @@ -1192,5 +1192,6 @@ IGNORE = \
 		ci/hlgroups.ignore \
 		src/libvterm/CODE-MAP \
 		runtime/syntax/testdir/input/html_html \
+		runtime/syntax/testdir/input/skhdrc \

This line should be deleted. We don't want to ignore it and the input test files are included at https://github.com/vim/vim/blob/10b272c126e906b6bab3621b162ae7faea42472a/Filelist#L915


In runtime/filetype.vim:

> @@ -1055,6 +1055,9 @@ au BufNewFile,BufRead *.scm,*.ss,*.sld,*.stsg,*/supertux2/config,.lips_repl_hist
 " SiSU
 au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
 
+" skhd(hotkey daemon) configuration file
+au BufNewFile,BufRead skhdrc,.skhdrc		setf skhd

This should now be configured in https://github.com/vim/vim/blob/master/runtime/autoload/dist/ft.vim


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/19235/review/3692248234@github.com>

Kiyoon Kim

unread,
Jan 22, 2026, 1:10:52 PM (23 hours ago) Jan 22
to vim/vim, Subscribed

@kiyoon commented on this pull request.


In Filelist:

> @@ -1192,5 +1192,6 @@ IGNORE = \
 		ci/hlgroups.ignore \
 		src/libvterm/CODE-MAP \
 		runtime/syntax/testdir/input/html_html \
+		runtime/syntax/testdir/input/skhdrc \

it's not included because it doesn't have an extension. That's why the CI failed earlier.


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/19235/review/3693854310@github.com>

Kiyoon Kim

unread,
Jan 22, 2026, 1:16:18 PM (23 hours ago) Jan 22
to vim/vim, Push

@kiyoon pushed 1 commit.

  • 2039a4e move to runtime/autoload/dist/ft.vim

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19235/before/45e80fc0a5a6d88fb9c0b19491db3a814ffc2366/after/2039a4e43bd5b8070df4a0101242917c6596d47f@github.com>

Kiyoon Kim

unread,
Jan 22, 2026, 1:18:28 PM (22 hours ago) Jan 22
to vim/vim, Subscribed

@kiyoon commented on this pull request.


In runtime/filetype.vim:

> @@ -1055,6 +1055,9 @@ au BufNewFile,BufRead *.scm,*.ss,*.sld,*.stsg,*/supertux2/config,.lips_repl_hist
 " SiSU
 au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
 
+" skhd(hotkey daemon) configuration file
+au BufNewFile,BufRead skhdrc,.skhdrc		setf skhd

done


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/19235/review/3693885163@github.com>

Kiyoon Kim

unread,
Jan 22, 2026, 1:27:43 PM (22 hours ago) Jan 22
to vim/vim, Push

@kiyoon pushed 1 commit.

  • 073cb22 runtime(skhd): Add skhd syntax file

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19235/before/2039a4e43bd5b8070df4a0101242917c6596d47f/after/073cb22a4d0f6d4996767da9760685d13c6f9ab9@github.com>

Kiyoon Kim

unread,
Jan 22, 2026, 7:56:44 PM (16 hours ago) Jan 22
to vim/vim, Subscribed
kiyoon left a comment (vim/vim#19235)

Could you also add a simple ftplugin that defines, at least, comments and commentstring?

Done!


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/19235/c3787614340@github.com>

dkearns

unread,
5:39 AM (6 hours ago) 5:39 AM
to vim/vim, Subscribed

@dkearns commented on this pull request.


In runtime/syntax/skhd.vim:

> +syn region skhdProcMapBlock
+      \ matchgroup=skhdProcMapDelim
+      \ start=/\v\[\s*$/
+      \ end=/^\s*\]\s*$/
+      \ keepend
+      \ transparent
+      \ contains=skhdProcMapApp,skhdProcMapWildcard,skhdProcMapUnbind,skhdOperator,skhdComment,skhdBash,skhdString
+
+" App name on the left side:  "Google Chrome" :
+syn match skhdProcMapApp /^\s*\zs"[^"]*"\ze\s*:\s*/ contained
+
+" Wildcard entry:  * :
+syn match skhdProcMapWildcard /^\s*\zs\*\ze\s*:\s*/ contained
+
+" Unbind operator on the right side:  "App" ~   or   * ~
+syn match skhdProcMapUnbind /\v^\s*(\"[^"]*\"|\*)\s*\zs~\ze\s*$/ contained
⬇️ Suggested change
-syn match skhdProcMapUnbind /\v^\s*(\"[^"]*\"|\*)\s*\zs~\ze\s*$/ contained
+syn match skhdProcMapUnbind /\v^\s*(\"[^"]*\"|\*)\s*\zs\~\ze\s*$/ contained
+``
+
+A bare `~` matches the previous substitute pattern.  This won't match and will generate E33 errors.
+
+See `:help /~` and `:help E33`.


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/19235/review/3696884948@github.com>

dkearns

unread,
5:42 AM (6 hours ago) 5:42 AM
to vim/vim, Subscribed

@dkearns commented on this pull request.


In Filelist:

> @@ -1192,5 +1192,6 @@ IGNORE = \
 		ci/hlgroups.ignore \
 		src/libvterm/CODE-MAP \
 		runtime/syntax/testdir/input/html_html \
+		runtime/syntax/testdir/input/skhdrc \

I couldn't find the test failure you're referring to but it certainly shouldn't be in the ignored list.

The input test file currently need to named something like skhd.skhd (with the filetype at the head of the filename) and as that won't be filetype detected by name it also needs a modeline like # vim:ft=skhd: at the bottom of the file.

You'll have to regenerate the dump files as they'll now have different names.

I think this might be the first syntax file that's detection is based on name and not extension. We can look at making this a bit simpler in the future.


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/19235/review/3696896530@github.com>

Kiyoon Kim

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

@kiyoon pushed 1 commit.

  • 5be5c55 runtime(skhd): Add skhd syntax file

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19235/before/073cb22a4d0f6d4996767da9760685d13c6f9ab9/after/5be5c55bcec58f874f11a87eb542df1f5768fc10@github.com>

Kiyoon Kim

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

@kiyoon pushed 1 commit.

  • 4df7d6c runtime(skhd): Add skhd syntax file

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19235/before/5be5c55bcec58f874f11a87eb542df1f5768fc10/after/4df7d6c6fce45a5452c45f8224a8a13a3b2a7435@github.com>

Kiyoon Kim

unread,
8:32 AM (3 hours ago) 8:32 AM
to vim/vim, Subscribed

@kiyoon commented on this pull request.


In Filelist:

> @@ -1192,5 +1192,6 @@ IGNORE = \
 		ci/hlgroups.ignore \
 		src/libvterm/CODE-MAP \
 		runtime/syntax/testdir/input/html_html \
+		runtime/syntax/testdir/input/skhdrc \

done!


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/19235/review/3697490750@github.com>

Kiyoon Kim

unread,
8:33 AM (3 hours ago) 8:33 AM
to vim/vim, Subscribed

@kiyoon commented on this pull request.


In runtime/syntax/skhd.vim:

> +syn region skhdProcMapBlock
+      \ matchgroup=skhdProcMapDelim
+      \ start=/\v\[\s*$/
+      \ end=/^\s*\]\s*$/
+      \ keepend
+      \ transparent
+      \ contains=skhdProcMapApp,skhdProcMapWildcard,skhdProcMapUnbind,skhdOperator,skhdComment,skhdBash,skhdString
+
+" App name on the left side:  "Google Chrome" :
+syn match skhdProcMapApp /^\s*\zs"[^"]*"\ze\s*:\s*/ contained
+
+" Wildcard entry:  * :
+syn match skhdProcMapWildcard /^\s*\zs\*\ze\s*:\s*/ contained
+
+" Unbind operator on the right side:  "App" ~   or   * ~
+syn match skhdProcMapUnbind /\v^\s*(\"[^"]*\"|\*)\s*\zs~\ze\s*$/ contained

fixed! Thanks for catching it out


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/19235/review/3697491785@github.com>

Reply all
Reply to author
Forward
0 new messages