]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.0953: filetype: APKBUILD files not correctly detected v9.1.0953
authorHugo Osvaldo Barrera' via vim_dev <vim_dev@googlegroups.com>
Wed, 18 Dec 2024 16:52:48 +0000 (17:52 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 22 Dec 2024 14:11:50 +0000 (15:11 +0100)
commit7cb24917a112ba473cb351bdcdc48b8adbd46793
tree980af4a79ea93655eb9106cd09327e44db51919c
parent92195ae72f141a1d454d930a0b395c63d08f5fe0
patch 9.1.0953: filetype: APKBUILD files not correctly detected

Problem:  filetype: APKBUILD files not correctly detected
Solution: detect 'APKBUILD' files as apkbuild filetype,
          include a apkbuild syntax script (which basically
          just sources the sh.vim syntax file)
          (Hugo Osvaldo Barrera)

Vim plugins (e.g.: ALE, nvim-lspconfig, etc) rely on filetype to
determine which integrations/helpers are applicable. They expect
filetype=apkbuild for APKBUILD files.

On the other hand, plugins also enable bash-specific linters and
functionality when filetype=bash, but APKBUILD files are POSIX sh, not
bash, so these often provide bogus results.

Change the filetype for APKBUILD to a 'apkbuild', so that tools and
ftplugin can properly target these files. This filetype will use the
existing `sh` syntax rules, since these are applicable for them.

Signed-off-by: Hugo Osvaldo Barrera' via vim_dev <vim_dev@googlegroups.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/filetype.vim
runtime/syntax/apkbuild.vim [new file with mode: 0644]
src/testdir/test_filetype.vim
src/version.c