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 | |
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')
-rw-r--r-- | runtime/doc/filetype.txt | 38 | ||||
-rw-r--r-- | runtime/doc/lua.txt | 5 | ||||
-rw-r--r-- | runtime/doc/news.txt | 11 | ||||
-rw-r--r-- | runtime/doc/options.txt | 3 | ||||
-rw-r--r-- | runtime/doc/starting.txt | 2 |
5 files changed, 22 insertions, 37 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' diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 7330453778..ce16c208cd 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -2045,9 +2045,6 @@ add({filetypes}) *vim.filetype.add()* See $VIMRUNTIME/lua/vim/filetype.lua for more examples. - Note that Lua filetype detection is disabled when |g:do_legacy_filetype| - is set. - Example: > vim.filetype.add({ @@ -2084,7 +2081,7 @@ add({filetypes}) *vim.filetype.add()* }) < - To add a fallback match on contents (see |new-filetype-scripts|), use > + To add a fallback match on contents, use > vim.filetype.add { pattern = { diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 41d47f7a90..1dc9adcab1 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -13,7 +13,7 @@ BREAKING CHANGES *news-breaking* The following changes may require adaptations in user config or plugins. -Cscope is now removed (see |cscope| and |nvim-features-removed|): +• Cscope is now removed (see |cscope| and |nvim-features-removed|): - Commands removed: - `:cscope` - `:lcscope` @@ -30,9 +30,9 @@ Cscope is now removed (see |cscope| and |nvim-features-removed|): - Eval functions removed: - `cscope_connection()` -Note: support for |ctags| remains with no plans to remove. + Note: support for |ctags| remains with no plans to remove. -See https://github.com/neovim/neovim/pull/20545 for more information. + See https://github.com/neovim/neovim/pull/20545 for more information. ============================================================================== NEW FEATURES *news-features* @@ -49,6 +49,11 @@ REMOVED FEATURES *news-removed* The following deprecated functions or APIs were removed. +• `filetype.vim` is removed in favor of |lua-filetype| + (Note that filetype logic and tests still align with Vim, so additions or + changes need to be contributed there first.) + See https://github.com/neovim/neovim/pull/20674. + ============================================================================== DEPRECATIONS *news-deprecations* diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 184a9aeea4..5a828ba249 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4912,8 +4912,7 @@ A jump table for the options with a short description can be found at |Q_op|. $XDG_CONFIG_HOME/nvim/after") global List of directories to be searched for these runtime files: - filetype.vim filetypes by file name |new-filetype| - scripts.vim filetypes by file contents |new-filetype-scripts| + filetype.lua filetypes |new-filetype| autoload/ automatically loaded scripts |autoload-functions| colors/ color scheme files |:colorscheme| compiler/ compiler files |:compiler| diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index baa60f431f..e45df9eb73 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -458,7 +458,7 @@ accordingly, proceeding as follows: 7. Enable filetype detection. This does the same as the command: > - :runtime! filetype.lua filetype.vim + :runtime! filetype.lua < Skipped if ":filetype off" was called or if the "-u NONE" command line argument was given. |