mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
vim-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: vim/vim#15973
84b5b1c660
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
This commit is contained in:
committed by
Christian Clason
parent
f5933d196b
commit
db46b58569
15
runtime/ftplugin/sway.vim
Normal file
15
runtime/ftplugin/sway.vim
Normal file
@ -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<'
|
@ -1151,6 +1151,7 @@ local extension = {
|
|||||||
sface = 'surface',
|
sface = 'surface',
|
||||||
svelte = 'svelte',
|
svelte = 'svelte',
|
||||||
svg = 'svg',
|
svg = 'svg',
|
||||||
|
sw = 'sway',
|
||||||
swift = 'swift',
|
swift = 'swift',
|
||||||
swiftinterface = 'swift',
|
swiftinterface = 'swift',
|
||||||
swig = 'swig',
|
swig = 'swig',
|
||||||
|
@ -726,6 +726,7 @@ func s:GetFilenameChecks() abort
|
|||||||
\ 'svelte': ['file.svelte'],
|
\ 'svelte': ['file.svelte'],
|
||||||
\ 'svg': ['file.svg'],
|
\ 'svg': ['file.svg'],
|
||||||
\ 'svn': ['svn-commitfile.tmp', 'svn-commit-file.tmp', 'svn-commit.tmp'],
|
\ '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'],
|
\ 'swayconfig': ['/home/user/.sway/config', '/home/user/.config/sway/config', '/etc/sway/config', '/etc/xdg/sway/config'],
|
||||||
\ 'swift': ['file.swift', 'file.swiftinterface'],
|
\ 'swift': ['file.swift', 'file.swiftinterface'],
|
||||||
\ 'swiftgyb': ['file.swift.gyb'],
|
\ 'swiftgyb': ['file.swift.gyb'],
|
||||||
|
Reference in New Issue
Block a user