diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-10-17 08:52:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 08:52:40 +0200 |
commit | 042eb74ff1ed63d79f8a642649cd6be6ec4b0eb9 (patch) | |
tree | 6205f02b6bc84742b04e83544e2accd88f37670b /runtime/doc/filetype.txt | |
parent | 9701c9dc9f157c4d09d1783aab9913d05b0d73b1 (diff) | |
download | rneovim-042eb74ff1ed63d79f8a642649cd6be6ec4b0eb9.tar.gz rneovim-042eb74ff1ed63d79f8a642649cd6be6ec4b0eb9.tar.bz2 rneovim-042eb74ff1ed63d79f8a642649cd6be6ec4b0eb9.zip |
feat(runtime)!: remove filetype.vim (#20428)
Made obsolete by now graduated `filetype.lua` (enabled by default).
Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.
Diffstat (limited to 'runtime/doc/filetype.txt')
-rw-r--r-- | runtime/doc/filetype.txt | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index ac54a6b6ca..9952ef6415 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -175,15 +175,13 @@ This means that the contents of compressed files are not inspected. *new-filetype* If a file type that you want to use is not detected yet, there are a few ways -to add it. In any way, it's better not to modify the $VIMRUNTIME/filetype.lua -or $VIMRUNTIME/filetype.vim files. They will be overwritten when installing a -new version of Nvim. The following explains the legacy Vim mechanism (enabled -if |g:do_legacy_filetype| is set). For Nvim's default mechanism, see -|vim.filetype.add()|. +to add it. The recommended way is to use |vim.filetype.add()| to add it to +Nvim's builtin filetype detection mechanism. If you want to handle the +detection manually, proceed as follows: A. If you want to overrule all default file type checks. This works by writing one file for each filetype. The disadvantage is that - there can be many files. The advantage is that you can simply drop this + there can be many files. The advantage is that you can simply drop this file in the right directory to make it work. *ftdetect* 1. Create your user runtime directory. You would normally use the first @@ -273,28 +271,14 @@ D. If your filetype can only be detected by inspecting the contents of the means that your rules override the default rules in $VIMRUNTIME/scripts.vim. - *remove-filetype* -If a file type is detected that is wrong for you, install a filetype.lua, -filetype.vim or scripts.vim to catch it (see above). You can set 'filetype' to -a non-existing name to avoid that it will be set later anyway: > - :set filetype=ignored - -If you are setting up a system with many users, and you don't want each user -to add/remove the same filetypes, consider writing the filetype.vim and -scripts.vim files in a runtime directory that is used for everybody. Check -the 'runtimepath' for a directory to use. If there isn't one, set -'runtimepath' in the |system-vimrc|. Be careful to keep the default -directories! - - *g:do_legacy_filetype* -To disable Nvim's default filetype detection and revert to Vim's legacy -filetype detection, add the following to your |init.vim|: > - let g:do_legacy_filetype = 1 -< *g:did_load_filetypes* + *remove-filetype* +If a file type is detected that is wrong for you, you can set 'filetype' to +a non-existing name such as `ignored` to avoid that it will be set later anyway. + + *g:did_load_filetypes* The builtin filetype detection provided by Nvim can be disabled by setting -the `did_load_filetypes` global variable. If this variable exists, neither -the default `$VIMRUNTIME/filetype.lua` nor the legacy `$VIMRUNTIME/filetype.vim` -will run. +the `did_load_filetypes` global variable. If this variable exists, the default +`$VIMRUNTIME/filetype.lua` will not run. *plugin-details* The "plugin" directory can be in any of the directories in the 'runtimepath' |