Mercurial > vim
changeset 36431:dc3814856298 draft v9.1.0826
patch 9.1.0826: filetype: sway files are not recognized
Commit: https://github.com/vim/vim/commit/84b5b1c660beb2f9e27de70687e41d39a023ae81
Author: Riley Bruins <ribru17@hotmail.com>
Date: Sat Nov 2 15:44:43 2024 +0100
patch 9.1.0826: filetype: sway files are not recognized
Problem: filetype: sway files are not recognized
Solution: detect '*.sw' files as sway filetype, include
a filetype plugin (Riley Bruins)
References:
https://github.com/FuelLabs/sway.
Comments taken from their syntax documentation. File extension taken
from the same documentation/GitHub's own recognition of these file types
closes: #15973
Signed-off-by: Riley Bruins <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 02 Nov 2024 16:00:07 +0100 |
parents | 4d109666908b |
children | c4d2d7807577 |
files | .github/MAINTAINERS runtime/filetype.vim runtime/ftplugin/sway.vim src/testdir/test_filetype.vim src/version.c |
diffstat | 5 files changed, 22 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -263,6 +263,7 @@ runtime/ftplugin/squirrel.vim @ribru17 runtime/ftplugin/ssa.vim @ObserverOfTime runtime/ftplugin/sshdconfig.vim @jiangyinzuo runtime/ftplugin/svelte.vim @igorlfs +runtime/ftplugin/sway.vim @ribru17 runtime/ftplugin/swayconfig.vim @jamespeapen runtime/ftplugin/systemverilog.vim @Kocha runtime/ftplugin/swig.vim @jmarrec
--- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -2430,6 +2430,9 @@ au BufNewFile,BufRead *.sml setf sml " Sratus VOS command macro au BufNewFile,BufRead *.cm setf voscm +" Sway (programming language) +au BufNewFile,BufRead *.sw setf sway + " Swift au BufNewFile,BufRead *.swift,*.swiftinterface setf swift au BufNewFile,BufRead *.swift.gyb setf swiftgyb
new file mode 100644 --- /dev/null +++ b/runtime/ftplugin/sway.vim @@ -0,0 +1,15 @@ +" Vim filetype plugin +" Language: Sway +" Maintainer: Riley Bruins <ribru17@gmail.com> +" Last Change: 2024 Nov 01 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl commentstring=//\ %s +" From Rust comments +setl comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// + +let b:undo_ftplugin = 'setl com< cms<'
--- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -729,6 +729,7 @@ def s:GetFilenameChecks(): dict<list<str svelte: ['file.svelte'], svg: ['file.svg'], svn: ['svn-commitfile.tmp', 'svn-commit-file.tmp', 'svn-commit.tmp'], + sway: ['file.sw'], swayconfig: ['/home/user/.sway/config', '/home/user/.config/sway/config', '/etc/sway/config', '/etc/xdg/sway/config'], swift: ['file.swift', 'file.swiftinterface'], swiftgyb: ['file.swift.gyb'],