[vim/vim] runtime(filetype): Added suppprt for kitty (PR #18280)

16 views
Skip to first unread message

Mouinul Hossain

unread,
Sep 12, 2025, 6:36:13 AM (6 days ago) Sep 12
to vim/vim, Subscribed

This PR adds support to the kitty filetype(e.g. ~/.config/kitty/*.conf, see details here.

I have,

  • Updated the runtime/filetype.vim file with the appropriate autocmd.

Note

As this filetype relies on environment variables($KITTY_CONFIG_DIR, $XDG_CONFIG_HOME etc.) I have simplified the file path pattern. I have also made it so that any kitty.conf file is detected as thios filetype(let me know if this is a concern).

  • Updated src/testdir/test_filetype.vim.
  • Added syntax/kitty.vim.

I am not sure if this needs a new syntax file as it's kinda similar to bash and the conf syntax works fine.
You can check how the file may look like here.


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

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

Commit Summary

  • 8c2daca runtime(filetype): Added suppprt for kitty

File Changes

(2 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/18280@github.com>

zeertzjq

unread,
Sep 12, 2025, 6:44:38 AM (6 days ago) Sep 12
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#18280)

https://github.com/fladson/vim-kitty has a syntax file.


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/18280/c3284771026@github.com>

Christian Brabandt

unread,
Sep 12, 2025, 10:49:04 AM (6 days ago) Sep 12
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18280)

Should be okay from a licensing perspective. However I'd prefer if @fladson does either pushes it himself here or at the very least ACKs this distribution with Vim. Thanks.


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/18280/c3285589617@github.com>

Mouinul Hossain

unread,
Sep 12, 2025, 11:11:34 AM (5 days ago) Sep 12
to vim/vim, Subscribed
OXY2DEV left a comment (vim/vim#18280)

I am writing my own syntax files instead. I don't think the default queries that ship's with Vim needs to be too complex.

If somebody wants to use more advanced ones they can simply use vim-kitty or tree-sitter-kitty(in case of Neovim).

And I don't know if you have seen the queries used by vim-kiity but they would need to be generated every time kitty adds a new option/action which is fine for a plugin, but I am not sure it would be fine for something that will be shipped with the editor.


So, I am making a simpler syntax. It won't be 100% accurate but should be enough for regular use.


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/18280/c3285667754@github.com>

Christian Brabandt

unread,
Sep 12, 2025, 11:14:11 AM (5 days ago) Sep 12
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18280)

Makes sense, thanks


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/18280/c3285676362@github.com>

Mouinul Hossain

unread,
Sep 13, 2025, 5:51:01 AM (5 days ago) Sep 13
to vim/vim, Push

@OXY2DEV pushed 1 commit.

  • 479b569 runtime(syntax): Added basic syntax for kitty


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18280/before/8c2dacaf1ebf52bcace6d401d1c91de89bdb2628/after/479b56976319989633309de9413bd378e3acbfb6@github.com>

Mouinul Hossain

unread,
Sep 13, 2025, 5:56:26 AM (5 days ago) Sep 13
to vim/vim, Subscribed
OXY2DEV left a comment (vim/vim#18280)

@chrisbra I have added basic syntax for kitty.

Screenshot_2025-09-13-15-51-49-657_com.termux-edit.jpg (view on web)

Important

I haven't added syntax for \ line continuation as it's different from other languages(\n\\, instead of the regular \\\n used by other languages)

Let me know if I need to change something. In the meantime, I will try to add support for line continuations.


You can find an example file here.


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/18280/c3287984291@github.com>

zeertzjq

unread,
Sep 13, 2025, 6:02:03 AM (5 days ago) Sep 13
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/testdir/test_filetype.vim:

> @@ -419,6 +419,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     jsp: ['file.jsp'],
     julia: ['file.jl'],
     just: ['justfile', 'Justfile', '.justfile', 'config.just'],
+    kitty: ['kitty.conf', '~/.config/kitty/colorscheme.conf'],

This should come between kdl and kivy.


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/18280/review/3220207597@github.com>

Mouinul Hossain

unread,
Sep 13, 2025, 6:33:40 AM (5 days ago) Sep 13
to vim/vim, Push

@OXY2DEV pushed 1 commit.

  • 5dd7578 src(testdir): Updated test order

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18280/before/479b56976319989633309de9413bd378e3acbfb6/after/5dd75787cc155e4634cb2fbc0d3294811a9ace5a@github.com>

Mouinul Hossain

unread,
Sep 13, 2025, 11:24:19 AM (4 days ago) Sep 13
to vim/vim, Push

@OXY2DEV pushed 1 commit.

  • e610611 runtime(syntax): Completed basic syntax for kitty

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18280/before/5dd75787cc155e4634cb2fbc0d3294811a9ace5a/after/e61061180c66ea21fcf5712df0cac0fd66d2af4d@github.com>

Mouinul Hossain

unread,
Sep 13, 2025, 11:26:52 AM (4 days ago) Sep 13
to vim/vim, Subscribed
OXY2DEV left a comment (vim/vim#18280)

@chrisbra @zeertzjq I have finalized the syntax file.

Line continuations are now working correctly,

Screenshot_2025-09-13-21-23-00-029_com.termux-edit.jpg (view on web)

Let me know if I need to change something else.


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/18280/c3288519510@github.com>

zeertzjq

unread,
Sep 14, 2025, 2:46:45 AM (4 days ago) Sep 14
to vim/vim, Subscribed

@zeertzjq commented on this pull request.

Choose a good, descriptive name for your syntax file.  Use lowercase letters
and digits.  Don't make it too long, it is used in many places: The name of
the syntax file "name.vim", 'filetype', b:current_syntax and the start of each
syntax group (nameType, nameStatement, nameString, etc).

Start with a check for "b:current_syntax".  If it is defined, some other
syntax file, earlier in 'runtimepath' was already loaded: >

	if exists("b:current_syntax")
	  finish
	endif

Set "b:current_syntax" to the name of the syntax at the end.  Don't forget
that included files do this too, you might have to reset "b:current_syntax" if
you include two files.
  • You need to set b:current_syntax at the end of the file.
  • The syntax group names are inconsistent. They should all start with kitty.


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/18280/review/3221823044@github.com>

Mouinul Hossain

unread,
Sep 14, 2025, 3:57:26 AM (4 days ago) Sep 14
to vim/vim, Push

@OXY2DEV pushed 1 commit.

  • 222ac01 runtime(syntax): Updated syntac files for kitty

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18280/before/e61061180c66ea21fcf5712df0cac0fd66d2af4d/after/222ac011d740cbca1a992a815a3542b21179fdcc@github.com>

Mouinul Hossain

unread,
Sep 14, 2025, 3:57:50 AM (4 days ago) Sep 14
to vim/vim, Push

@OXY2DEV pushed 1 commit.

  • 23c7ffa runtime(syntax): Updated syntac files for kitty

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18280/before/222ac011d740cbca1a992a815a3542b21179fdcc/after/23c7ffa473f0411ee294442a26aa18241dae863c@github.com>

Christian Brabandt

unread,
Sep 15, 2025, 3:09:10 PM (2 days ago) Sep 15
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18280)

thanks


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/18280/c3293545237@github.com>

Christian Brabandt

unread,
Sep 15, 2025, 3:13:24 PM (2 days ago) Sep 15
to vim/vim, Subscribed

Closed #18280 via a946ccf.


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/18280/issue_event/19708960387@github.com>

Dietrich Moerman

unread,
Sep 15, 2025, 4:37:51 PM (2 days ago) Sep 15
to vim/vim, Subscribed
dietrichm left a comment (vim/vim#18280)

@OXY2DEV There is a typo in:

hi link kittyParameter Specual


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/18280/c3293863036@github.com>

Christian Brabandt

unread,
Sep 15, 2025, 4:39:09 PM (2 days ago) Sep 15
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18280)

I'll fix it right now


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/18280/c3293868765@github.com>

Jon Parise

unread,
Sep 15, 2025, 8:14:15 PM (2 days ago) Sep 15
to vim/vim, Subscribed

@jparise commented on this pull request.


In runtime/syntax/kitty.vim:

> +" Maintainer:        MD. Mouinul Hossain Shawon <mdmouinulhossainshawon [at] gmail.com>
+" Last Change:       Sun Sep 14 13:56:41 +06 2025
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn sync fromstart
+
+" Option """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Format: `<option_name> ...`<
+
+syn match kittyString /\S\+/ contains=Alpha contained
+syn match kittyNumber /[+\-*\/]\{0,1}[0-9.]\+/ contained
+syn match kittyAlpha /@[0-9.]\+/ contained
+syn match kittyColor /#[0-9a-fA-F]\{3,6}/ nextgroup=Alpha contained

Should this be nextgroup=kittyAlpha?


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/18280/review/3226663183@github.com>

Mouinul Hossain

unread,
Sep 15, 2025, 8:19:19 PM (2 days ago) Sep 15
to vim/vim, Subscribed

@OXY2DEV commented on this pull request.


In runtime/syntax/kitty.vim:

> +" Maintainer:        MD. Mouinul Hossain Shawon <mdmouinulhossainshawon [at] gmail.com>
+" Last Change:       Sun Sep 14 13:56:41 +06 2025
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn sync fromstart
+
+" Option """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Format: `<option_name> ...`<
+
+syn match kittyString /\S\+/ contains=Alpha contained
+syn match kittyNumber /[+\-*\/]\{0,1}[0-9.]\+/ contained
+syn match kittyAlpha /@[0-9.]\+/ contained
+syn match kittyColor /#[0-9a-fA-F]\{3,6}/ nextgroup=Alpha contained

Yes, because you can use colour names(e.g. red@0.3).

And I didn't want to make a huge regex pattern for it(or use a very long syn keyword). I was also unsure if it would have performance issues since there's quite a few colour names.


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/18280/review/3226671120@github.com>

Jon Parise

unread,
Sep 15, 2025, 8:28:37 PM (2 days ago) Sep 15
to vim/vim, Subscribed

@jparise commented on this pull request.


In runtime/syntax/kitty.vim:

> +" Maintainer:        MD. Mouinul Hossain Shawon <mdmouinulhossainshawon [at] gmail.com>
+" Last Change:       Sun Sep 14 13:56:41 +06 2025
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn sync fromstart
+
+" Option """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Format: `<option_name> ...`<
+
+syn match kittyString /\S\+/ contains=Alpha contained
+syn match kittyNumber /[+\-*\/]\{0,1}[0-9.]\+/ contained
+syn match kittyAlpha /@[0-9.]\+/ contained
+syn match kittyColor /#[0-9a-fA-F]\{3,6}/ nextgroup=Alpha contained

Understood, but I think there's a typo: contains=Alpha versus contains=kittyAlpha?


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/18280/review/3226687914@github.com>

Mouinul Hossain

unread,
Sep 15, 2025, 8:34:14 PM (2 days ago) Sep 15
to vim/vim, Subscribed

@OXY2DEV commented on this pull request.


In runtime/syntax/kitty.vim:

> +" Maintainer:        MD. Mouinul Hossain Shawon <mdmouinulhossainshawon [at] gmail.com>
+" Last Change:       Sun Sep 14 13:56:41 +06 2025
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn sync fromstart
+
+" Option """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Format: `<option_name> ...`<
+
+syn match kittyString /\S\+/ contains=Alpha contained
+syn match kittyNumber /[+\-*\/]\{0,1}[0-9.]\+/ contained
+syn match kittyAlpha /@[0-9.]\+/ contained
+syn match kittyColor /#[0-9a-fA-F]\{3,6}/ nextgroup=Alpha contained

Uh, how do I push the changes?


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/18280/review/3226694631@github.com>

Christian Brabandt

unread,
Sep 16, 2025, 1:49:35 AM (yesterday) Sep 16
to vim/vim, Subscribed

@chrisbra commented on this pull request.


In runtime/syntax/kitty.vim:

> +" Maintainer:        MD. Mouinul Hossain Shawon <mdmouinulhossainshawon [at] gmail.com>
+" Last Change:       Sun Sep 14 13:56:41 +06 2025
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn sync fromstart
+
+" Option """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Format: `<option_name> ...`<
+
+syn match kittyString /\S\+/ contains=Alpha contained
+syn match kittyNumber /[+\-*\/]\{0,1}[0-9.]\+/ contained
+syn match kittyAlpha /@[0-9.]\+/ contained
+syn match kittyColor /#[0-9a-fA-F]\{3,6}/ nextgroup=Alpha contained

Make a new PR with your changes please


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/18280/review/3227476481@github.com>

Reply all
Reply to author
Forward
0 new messages