diff options
author | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2024-07-23 14:35:45 +0300 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-08-03 14:14:42 +0200 |
commit | 37910f270341d8b36f2f26b6d628274b85e2522b (patch) | |
tree | 060e0b56df304ab7719791adb621a9212557d515 /runtime/doc/dev_vimpatch.txt | |
parent | 95e0289cb24e349b0ac1b170adefc57b767d2e78 (diff) | |
download | rneovim-37910f270341d8b36f2f26b6d628274b85e2522b.tar.gz rneovim-37910f270341d8b36f2f26b6d628274b85e2522b.tar.bz2 rneovim-37910f270341d8b36f2f26b6d628274b85e2522b.zip |
docs(filetype): add note about prefering explicit lists over pattern
Diffstat (limited to 'runtime/doc/dev_vimpatch.txt')
-rw-r--r-- | runtime/doc/dev_vimpatch.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/dev_vimpatch.txt b/runtime/doc/dev_vimpatch.txt index 98a4246057..a36b2a613b 100644 --- a/runtime/doc/dev_vimpatch.txt +++ b/runtime/doc/dev_vimpatch.txt @@ -310,11 +310,16 @@ FILETYPE DETECTION *dev-vimpatch-filetype* Nvim's filetype detection behavior matches Vim, but is implemented as part of |vim.filetype| (see $VIMRUNTIME/lua/vim/filetype.lua). +Prefer explicit filenames/extensions over patterns, especially for case +insensitive matches (see https://github.com/neovim/neovim/pull/29800): > + "*[mM]akefile" regex -> "makefile", "Makefile" filenames + "*.js\c" regex -> "js", "jS", "Js", "jS" extensions + Pattern matching has several differences: - It is done using explicit Lua patterns (without implicit anchoring) instead of Vim regexes: > "*/debian/changelog" -> "/debian/changelog$" - "*/bind/db.*" -> "/bind/db%." + "*/bind/db.*" -> "/bind/db%." < - Filetype patterns are grouped by their parent pattern to improve matching performance. For this to work properly, parent pattern should: |