From 7b34bca2a6579c4dc8b8767fbfee5f7d98c977d4 Mon Sep 17 00:00:00 2001 From: flatplum Date: Wed, 29 Jul 2026 13:03:53 +0000 Subject: [PATCH] docs(health): avoid warnings for dynamic filetypes #41036 Problem: Dynamic filetypes defined by `vim.filetype.add` may show health warnings. Solution: Document a way to suppress these harmless warnings. --- runtime/doc/health.txt | 5 +++++ runtime/lua/vim/health.lua | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/runtime/doc/health.txt b/runtime/doc/health.txt index 33a15064ed..42d7be2ade 100644 --- a/runtime/doc/health.txt +++ b/runtime/doc/health.txt @@ -72,6 +72,11 @@ in the health report: >vim autocmd FileType checkhealth :set modifiable | silent! %s/\v( ?[^\x00-\x7F])//g < +Sometimes you might need to suppress filetype warnings if you have specified +them dynamically. For example with the yaml.ansible filetype: >vim + autocmd FileType checkhealth :set modifiable | silent! g/Unknown filetype 'yaml\.ansible'/d +< + -------------------------------------------------------------------------------- Create a healthcheck *health-dev* diff --git a/runtime/lua/vim/health.lua b/runtime/lua/vim/health.lua index 331dca71f3..8cfc4ab79d 100644 --- a/runtime/lua/vim/health.lua +++ b/runtime/lua/vim/health.lua @@ -63,7 +63,11 @@ --- ```vim --- autocmd FileType checkhealth :set modifiable | silent! %s/\v( ?[^\x00-\x7F])//g --- ``` ---- +--- Sometimes you might need to suppress filetype warnings if you have specified them dynamically. +--- For example with the yaml.ansible filetype: +--- ```vim +--- autocmd FileType checkhealth :set modifiable | silent! g/Unknown filetype 'yaml\.ansible'/d +--- ``` ---
help
 --- --------------------------------------------------------------------------------
 --- Create a healthcheck                                    *health-dev*