This PR adds support to the kitty
filetype(e.g. ~/.config/kitty/*.conf
, see details here.
I have,
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).
src/testdir/test_filetype.vim
.syntax/kitty.vim
.I am not sure if this needs a new syntax file as it's kinda similar to
bash
and theconf
syntax works fine.
You can check how the file may look like here.
https://github.com/vim/vim/pull/18280
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
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.
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.
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.
Makes sense, thanks
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@OXY2DEV pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
@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.
@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.
@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.
@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.
b:current_syntax
at the end of the file.kitty
.—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
thanks
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@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.
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.
@jparise commented on this pull request.
> +" 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.
@OXY2DEV commented on this pull request.
> +" 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.
@jparise commented on this pull request.
> +" 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.
@OXY2DEV commented on this pull request.
> +" 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.
@chrisbra commented on this pull request.
> +" 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.