diff --git a/README.md b/README.md index 580537d..4d69a21 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Buffer Time Travel](vim/buffer-time-travel.md) - [Check Your Current Color Scheme](vim/check-your-current-color-scheme.md) - [Close the Current Buffer](vim/close-the-current-buffer.md) +- [Coerce The Current Filetype](vim/coerce-the-current-filetype.md) - [Count the Number of Matches](vim/count-the-number-of-matches.md) - [Create A New File In A New Directory](vim/create-a-new-file-in-a-new-directory.md) - [Generate and Edit Rails Migration](vim/generate-and-edit-rails-migration.md) diff --git a/vim/coerce-the-current-filetype.md b/vim/coerce-the-current-filetype.md new file mode 100644 index 0000000..58a93c1 --- /dev/null +++ b/vim/coerce-the-current-filetype.md @@ -0,0 +1,17 @@ +# Coerce The Current Filetype + +If Vim doesn't recognize the filetype of the currently edited file, I can +tell Vim what filetype to use. Consider, for instance, that I have a draft +of a markdown file with the name, `documentation.md.draft`. Vim will not +recognize this as a markdown file and will, thus, not apply markdown +syntax highlighting to that file. I can easily tell Vim to treat this as a +markdown file by setting its filetype: + +``` +:set filetype=markdown +``` + +Markdown syntax highlighting and other relevant options will now be applied +to the current buffer. + +See `:h filetype` for more details.