Automatically use specific language in Notepad++ for files with no extension
Specifically, I want NPP to remember to use Ruby syntax highlighting whenever I open a Vagrantfile. These don't have an extension, and I tried adding "Vagrantfile" to the user extensions in the style configurator, but it did not work.
Anyone get this working?
Solution 1:
There is a plugin which can detect the language based on vi modelines and shebangs etc.:
http://sourceforge.net/projects/npppythonplugsq/files/Modeline%20Parser/
This Notepad++ plugin will read Vim modeline to have per file settings. It also supports shebang (#!) to select language.
You need to install the Python Script plugin from the plugin manager, and manually install ModelineParser_0.2.zip. If needed it may be possible to add your own custom recognition strings.
Source
Solution 2:
You should add the extension of your vagrantfile, e.g. pkg, not the word "vagrantfile" itself!
In Notepad++, go to Settings -> Style Configurator. From the language list on the far left, choose Ruby. Below that there is a field titled User ext. Write in it all the file extensions, seperated by spaces, that you want to be treated as Ruby.