aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-13 17:38:30 +0800
committerGitHub <noreply@github.com>2025-03-13 17:38:30 +0800
commit6e588519c8b355599bd6b3dfce822325cee80deb (patch)
tree50d031879663e26173728cbf3db5778f22ba8918 /runtime/lua/vim
parent543e40624ea58bceacbd0ae62a797a7d22b74ee3 (diff)
downloadrneovim-6e588519c8b355599bd6b3dfce822325cee80deb.tar.gz
rneovim-6e588519c8b355599bd6b3dfce822325cee80deb.tar.bz2
rneovim-6e588519c8b355599bd6b3dfce822325cee80deb.zip
vim-patch:9.1.1196: filetype: config files for container tools are not recognized (#32873)
Problem: filetype: config files for container tools are not recognized Solution: detect the ones that aren't detected yet as toml filetype (David Mandelberg) The .containerignore format doesn't look exactly the same as gitignore, but very close. And .dockerignore is already using gitignore. References: https://github.com/containers/common/blob/main/docs/containerignore.5.md https://github.com/containers/common/blob/main/docs/containers.conf.5.md https://github.com/containers/storage/blob/main/docs/containers-storage.conf.5.md https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md https://github.com/containers/image/blob/main/docs/containers-registries.conf.d.5.md I wasn't sure exactly how to interpret what containers.conf(5) was saying about modules, so I looked at https://github.com/containers/common/tree/main/pkg/config/testdata/modules to get examples, and based the detection off those. closes: vim/vim#16852 https://github.com/vim/vim/commit/7546afbf525861f586ea2deabf71e3a2940abd4d Co-authored-by: David Mandelberg <david@mandelberg.org>
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/filetype.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index b2ddd461cc..a642a2a224 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -1583,6 +1583,7 @@ local filename = {
['.gitattributes'] = 'gitattributes',
['.gitignore'] = 'gitignore',
['.ignore'] = 'gitignore',
+ ['.containerignore'] = 'gitignore',
['.dockerignore'] = 'gitignore',
['.fdignore'] = 'gitignore',
['.npmignore'] = 'gitignore',
@@ -2264,6 +2265,12 @@ local pattern = {
['/%.ssh/.*%.conf$'] = 'sshconfig',
['^%.?tmux.*%.conf$'] = 'tmux',
['^%.?tmux.*%.conf'] = { 'tmux', { priority = -1 } },
+ ['/containers/containers%.conf$'] = 'toml',
+ ['/containers/containers%.conf%.d/.*%.conf$'] = 'toml',
+ ['/containers/containers%.conf%.modules/.*%.conf$'] = 'toml',
+ ['/containers/registries%.conf$'] = 'toml',
+ ['/containers/registries%.conf%.d/.*%.conf$'] = 'toml',
+ ['/containers/storage%.conf$'] = 'toml',
['/%.config/upstart/.*%.conf$'] = 'upstart',
['/%.config/upstart/.*%.override$'] = 'upstart',
['/%.init/.*%.conf$'] = 'upstart',