I see one of these two lines in .vimrc files. This one seems to be most common:filetype plugin indent onBut how does it differ from this line:filetype indent onI've found documentation for the latter, but I'm still confused.
What is the difference between `filetype plugin indent on` and `filetype indent on`?
indentation;filetype
filetype plugin indent on is like a combination of these commands:filetype onfiletype plugin onfiletype indent onIt turns on detection, plugin and indent at once. You can check for yourself by reading :help :filetype-overview.DetectionWhat does filetype detection do? From the docs: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.This is less confusing if you realise that the filetype command is distinct from the filetype option. (The command :filetype..., the option: :set filetype...)PluginWhat does the plugin part do? From the docs:This actually loads the file ftplugin.vim in 'runtimepath'.The result is that when a file is edited its plugin file is loaded (if there  is one for the detected filetype).The file being loaded is not necessarily named ftplugin.vim, it could be ftplugin/html_example.vim for instance.IndentWhat does the indent part do? From the docs:This actually loads the file indent.vim in 'runtimepath'.The result is that when a file is edited its indent file is loaded (if there  is one for the detected filetype). indent-expressionAgain, the file may not be named indent.vim, it could be named indent/html_example.vim for instance.