January 2015
Beginner to intermediate
85 pages
1h 58m
English
In Chapter 3, The Autoload System, we named our mpc playlist’s buffer by giving it the filename mpc.mpdv. With a filename, we now can work with Vim’s filetype support.
Standard Vim supports a lot of different filetypes. We turn on filetype recognition using the :filetype command in our vimrc; usually we set the command like this, which also tells Vim to indent files if it can do that for the filetype:
| | filetype plugin indent on |
With this set, Vim can recognize a file extension or line of code in a file and then set indentation levels, define custom commands, and enable the correct syntax highlighting.
Filetype recognition is buffer-local; that is, Vim sets the filetype option separately for each buffer. ...
Read now
Unlock full access