From 2eddd6f7c07980e6e1734a490c3f3d7a598436e6 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 23 Mar 2025 10:37:59 +0100 Subject: vim-patch:9.1.1231: filetype: SPA JSON files are not recognized Problem: filetype: SPA (single page application) JSON files are not recognized (used by pipewire and wireplumber) Solution: detect pipewire and wireplumber configuration files as spajson filetype, include filetype, indent and syntax scripts for this new filetype (David Mandelberg). I looked at all the files found by this command to see if the syntax highlighting looked reasonable: ``` find {~/.config,/etc,/usr/share}/{pipewire,wireplumber} -type f -name \*.conf ``` References: * pipewire config files: https://docs.pipewire.org/page_config.html * wireplumber config files: https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/conf_file.html and * https://pipewire.pages.freedesktop.org/wireplumber/daemon/locations.html closes: vim/vim#16950 https://github.com/vim/vim/commit/4e7b4308fb92628434bd7e07ab92910c33051431 Co-authored-by: David Mandelberg --- runtime/ftplugin/spajson.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 runtime/ftplugin/spajson.vim (limited to 'runtime/ftplugin') diff --git a/runtime/ftplugin/spajson.vim b/runtime/ftplugin/spajson.vim new file mode 100644 index 0000000000..d03d1d5070 --- /dev/null +++ b/runtime/ftplugin/spajson.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: SPA JSON +" Maintainer: David Mandelberg +" Last Change: 2025 Mar 22 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:###,:##,:# +setlocal commentstring=#\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" -- cgit