mirror of
https://github.com/neovim/neovim.git
synced 2026-03-28 19:32:01 +00:00
Problem: filetype: wks files are not recognized.
Solution: Detect *.wks, *.wks.in and *.wks.inc as wks filetype,
include a filetype and syntax plugin (Anakin Childerhose)
The OpenEmbedded Image Creation tool, `wic` uses wic kickstarter files
to define image partition and bootloader layouts.
wks files can end with .wks, .wks.in for templated wks files, and
.wks.inc for including in other .wks files.
The autocmd for *.wks.inc needs to come before *.inc in
runtime/ftdetect.vim
Reference:
https://docs.yoctoproject.org/ref-manual/kickstart.html#openembedded-kickstart-wks-reference
https://git.openembedded.org/openembedded-core/tree/scripts/lib/wic/canned-wks
closes: vim/vim#19796
8c116bbe79
30 lines
718 B
VimL
30 lines
718 B
VimL
" Vim syntax file
|
|
" Language: OpenEmbedded Image Creator (WIC) Kickstarter files wks
|
|
" Maintainer: Anakin Childerhose <anakin@childerhose.ca>
|
|
" Last Change: 2026 Mar 23
|
|
|
|
if exists("b:current_syntax")
|
|
finish
|
|
endif
|
|
|
|
let s:cpo_save = &cpo
|
|
set cpo&vim
|
|
|
|
syn case match
|
|
|
|
syn match wksComment "#.*$"
|
|
syn match wksCommand "\<bootloader\>"
|
|
syn match wksCommand "\<\(part\|partition\)\>" skipwhite nextgroup=wksMountPoint
|
|
syn match wksMountPoint "\(/[^ \t]*\|swap\)" contained
|
|
|
|
syn match wksOption "--[a-zA-Z_-]\+"
|
|
|
|
hi def link wksComment Comment
|
|
hi def link wksCommand Statement
|
|
hi def link wksMountPoint Identifier
|
|
hi def link wksOption Special
|
|
|
|
let b:current_syntax = "wks"
|
|
let &cpo = s:cpo_save
|
|
unlet s:cpo_save
|