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.
This commit is contained in:
flatplum
2026-07-29 13:03:53 +00:00
committed by GitHub
parent 182b02afb0
commit 7b34bca2a6
2 changed files with 10 additions and 1 deletions

View File

@@ -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*

View File

@@ -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
--- ```
---<pre>help
--- --------------------------------------------------------------------------------
--- Create a healthcheck *health-dev*