Changing Notepad++’s default source code language for new documents

Notepad++ is a great editing tool for web developers. I know many, including myself, who use this together with Adobe Dreamweaver for their HTML development because there are just some things that Notepad++ does better than Dreamweaver including syntax colouring and HTML tag  matching.

When you first start using Notepad++, it tries to determine the language of your source code using the filename extension. If you are just using a blank unsaved document, it may just treat your HTML code as plain text, offering no syntax colouring or tag matching. To enable these features, you either need to save your file with a proper filename extension or click on Language and then choose a different language like HTML, PHP, JSP, CSS, JavaScript, XML or SQL to name a few. If you work in HTML a lot, it can become a pain to always have to keep setting the language each time you open a new window.

The good news is that you can change the default file format in Notepad++ to HTML. It's easy. Here's how…

  • Launch Notepad++
  • Click Settings > Preferences
  • Click on the New Document/Default Directory tab
  • Change the Default Language to HTML
  • Click the Close button

From that point on, you will no longer always have to manually set the language to HTML for new documents.

You will still be able to manually change the language anytime to meet your needs and Notepad++ will still automatically detect the programming language of your files based on filename extension.


Comments

Changing Notepad++’s default source code language for new documents — 6 Comments

  1. Is there a way to use a user-defined language as default? It does not show any user-defined language on the “Default Language” dropdownlist.

      • Hi Michael,
        Thanks for the quick response.
        The link talks about custom support language to support to Notepad++ but i am looking for default the language, which is already available with Notepad++ but settings are getting stored only for permanently once i close and open again its going back default mode but sql language .
        I was wanted to set always the default document language to be sql but thats happenning. Could you please how to achieve this.

        Thanks in advance
        Chandra

        • Hi Michael,
          SOME TYPO ON MY LAST POST, I have corrected the message
          Thanks for the quick response.
          The link talks about custom support language to support to Notepad++ but i am looking for settings the default the language to SQL which is already available with Notepad++ . The problem i am facing is settings are getting captured on permanently basis. once we set the language its working for that moment but when i close and open,its going back to default mode but sql language .
          I was wanted to set always the default document language to be sql but thats happening. Could you please let me know how to achieve this.
          Thanks in advance
          Chandra

          • Hi Chandra,

            The default language setting in Notepad++ is only applicable when creating new files. For existing files, the language of the editor syntax highlighting is actually determined by the filename extension. If you want existing files to open in Notepad++ as an SQL language file, the filename must end in .sql or .SQL.

            By default, naming a file called export.sql will actually be called export.sql.txt behind the scenes. You may never realize it unless you look at the file type column in the Details view. In this case, Notepad++ will always open the file as a text file instead of as an SQL file.

            In order to rename the filename extension, you must tell Windows Explorer to show file name extensions in the Folder options.

            Hope this helps.

            Best regards,

            Michael

  2. I am not able to setup defaulting language for Notepad ++.I am have tried the following steps
    Settings -> Preferences ->Select New Document -> Set Default Language as SQL but the settings are not effecting.
    Could you please let me know the steps how to achieve this.

Add a comment:

Your email address will not be published. Required fields are marked *