Add syntax highlighting for skhd (simple hotkey daemon for macOS) configuration files. Includes filetype detection for skhdrc and .skhdrc files.
https://github.com/vim/vim/pull/19235
(10 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@kiyoon pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
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.![]()
@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
> @@ -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.![]()
@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.![]()
@kiyoon commented on this pull request.
> @@ -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.![]()
Could you also add a simple ftplugin that defines, at least,
commentsandcommentstring?
Done!
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@dkearns commented on this pull request.
> +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.![]()
@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.![]()
@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.![]()
@kiyoon commented on this pull request.
> +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.![]()