Search code examples
vimfile-type

Combining filetype commands in vim?


I'm using the example vimrc from the vim wiki, and "filetype indent plugin on" was in it. I'm wondering if that is the same as setting "filetype plugin on" and "filetype indent on", or do I have to turn on "filetype plugin" in a separate command?

Also is "filetype plugin indent on" the same as "filetype indent plugin on"?


Solution

  • They can be provided separately:

    filetype plugin on
    filetype indent on
    

    This is the same as the single line command: filetype indent plugin on, or filetype plugin indent on.

    Either command, and filetype indent plugin on turn on filetype detection: filetype on.

    plugin and indent are two separate filetype flags. Type just :filetype to see the individual state of the flags.