Reputation: 2434
Is there a way to add a line at the beginning of the file to specify the file type such as the following in emacs or vi:
# -*- mode: ruby -*-
# vi: set ft=ruby :
I would like to be able to set the format of some files that dont have file extensions such as Vagrantfile.
Upvotes: 0
Views: 230
Reputation: 1566
Try this two plugins, together they can parse the modelines correctly:
ft
attrUpvotes: 0
Reputation: 182
In Sublime there is a way to apply syntax highlighting by the file extension. To perform this:
View > Syntax > Open all with current extension as... > [TheSyntaxYouWant]
For the case where you don't have a file extension, you can use some of these plugins that behave like VI or EMACS:
You can also use ApplySintax, but it necessitate to perform some configurations before you can really use it.
Upvotes: 3