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?

Answer

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

Attribution
Source : Link , Question Author : ChimericDream , Answer Author : Community

Leave a Comment