mirror of
https://github.com/vim/vim.git
synced 2025-10-16 07:24:23 -04:00
Problem: filetype: Not all PKL files are recognized Solution: Detect *.pcf as pkl filetype, detect using the pkl-lsp:// protocol as pkl filetype, include PKL syntax script (Jan Claußen) This adds basic syntax support for the new PKL language by Apple. What works: - Shebang support - Comment support - Integers (decimal, hex, octal and binary) support - Floating point support including exponentials - Basic datatype support - Unicode escape delimiters - Escape code support - String interpolation - Support up to five pounds for custom delimiters - Folding of multi-line comments and blocks What doesn't work: The language heavily uses parameterized type declarations, which can get very complex. It is very hard to highlight this properly. There is official Tree-sitter support for this. Since it is hard to pull this off in a vim syntax file, I opted for basic support of the data types. References: https://github.com/apple/pkl-pantry fixes: #18271 closes: #18274 Signed-off-by: Jan Claußen <jan.claussen10@web.de> Signed-off-by: Christian Brabandt <cb@256bit.org>
17 lines
401 B
VimL
17 lines
401 B
VimL
" Vim filetype plugin
|
|
" Language: Pkl
|
|
" Maintainer: Riley Bruins <ribru17@gmail.com>
|
|
" Last Change: 2025 Jul 14
|
|
" 2025 Oct 03 by Vim Project Add foldmethod #18274
|
|
|
|
if exists('b:did_ftplugin')
|
|
finish
|
|
endif
|
|
let b:did_ftplugin = 1
|
|
|
|
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
|
|
setlocal commentstring=//\ %s
|
|
setlocal foldmethod=syntax
|
|
|
|
let b:undo_ftplugin = 'setl com< cms< fdm<'
|