From 7c4bb23ff38a459911a742657572bc273e528ddf Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 3 Jan 2018 19:57:22 +0100 Subject: defaults: do :filetype stuff unless explicitly "off" Until now, the default `:filetype ...` setup was skipped if the user config touched `:filetype` in any way (including implicitly via `:syntax on`). No one needs that, and it's very confusing. Instead, proceed with `:filetype ... on` unless the user explicitly called `:filetype ... off`. closes #7765 --- runtime/doc/filetype.txt | 6 ++---- runtime/doc/starting.txt | 9 ++++----- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 78402b47fe..74c453f79a 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -24,10 +24,8 @@ Each time a new or existing file is edited, Vim will try to recognize the type of the file and set the 'filetype' option. This will trigger the FileType event, which can be used to set the syntax highlighting, set options, etc. -Detail: The ":filetype on" command will load one of these files: - Mac $VIMRUNTIME/filetype.vim - MS-DOS $VIMRUNTIME\filetype.vim - Unix $VIMRUNTIME/filetype.vim +Detail: The ":filetype on" command will load this file: + $VIMRUNTIME/filetype.vim This file is a Vim script that defines autocommands for the BufNewFile and BufRead events. If the file type is not found by the name, the file $VIMRUNTIME/scripts.vim is used to detect it from the diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 30c0641ef7..e9188ba641 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -439,15 +439,14 @@ accordingly. Vim proceeds in this order: :runtime! filetype.vim :runtime! ftplugin.vim :runtime! indent.vim -< This step is skipped if ":filetype ..." was called before now or if - the "-u NONE" command line argument was given. +< Skipped if ":filetype … off" was called or if the "-u NONE" command + line argument was given. 5. Enable syntax highlighting. This does the same as the command: > :runtime! syntax/syntax.vim -< Note: This enables filetype detection even if ":filetype off" was - called before now. - This step is skipped if the "-u NONE" command line argument was given. +< Skipped if ":syntax off" was called or if the "-u NONE" command + line argument was given. 6. Load the plugin scripts. *load-plugins* This does the same as the command: > -- cgit