Sublime Forum

Default file type of new file using sublime-DefaultFileType


I’m trying to make all new files have the extension .md. That is, whenever I press Command+N on Mac (or Ctrl+N on Windows), I want the file type to be Markdown.

I found sublime-DefaultFileType which seems to do what I wanted – almost. From the Configuration section in the readme, it looks like you need to supply the path to the language you want as default in your prefs file. The example they give is this:


The problem is that I do not have a Packages/Java/Java.tmLanguage file; as a matter of fact, I do not even have the Packages/Java directory. Furthermore, I searched for .tmLanguage files in my Sublime Text user folder, and it seems as though the only ones I have exist inside the Backup or Cache directories, which is rather surprising, I think.

Something I should note is that the package’s other behavior, use_current_file_syntax, which uses the current file’s syntax for the new file, actually does seem to work. I just don’t seem to have the .tmLanguage required for the main purpose of the package.

Am I missing something here? Is there any way to use this package to do what I want, or does anyone know of another package I can achieve this simple request with?



The short answer to your question is that the language you want is 'Packages/Markdown/Markdown.sublime-syntax' (if you’re running an older version of Sublime and that doesn’t work, replace sublime-syntax with tmLanguage).

The longer answer to your question is that there are three different places that packages exist in Sublime:

  1. In the Packages folder, which you can get to by selecting Preferences > Browse Packages... from the menu
  2. In the Installed Packages folder, which you can get to by performing the steps in #1 and then going up one directory level in the file browser
  3. In a folder alongside wherever Sublime is currently installed.

For #1, the packages are stored unpacked in folders based on their names. The only definite package you’re ever going to see there is the User package, which holds your own custom configurations to Sublime. Aside of that, it’s possible that you may see a few packages there or none at all.

For #2 and #3, the packages are stored as sublime-package files, which are just zip files with a different extension. Being archives, searching for files within them doesn’t generally work.

The packges in Installed Packages are third party packages installed by you (or rather, Package Control in most cases), which installs almost all packages there. The only exceptions to that are packages that need to be “unpacked” into the Packages folder (#1) because they contain files that items outside of Sublime need to access, such as a library or binary.

Markdown is one of the packages that ship with Sublime, so you won’t find it in Packages or Installed Packages and instead alongside the binary.

If you’re running a recent development build of Sublime, you can get a list of all package files by using the new View Package File command in the command palette; selecting that command and entering the text markdown will filter the list to all files with that name, which will point at the file that you want (for me it’s the first item in the list).

If you’re not using a recent version (or really, even if you are), an indispensable tool in your toolbox would be PackageResourceViewer. If you install that, you can select PackageResourceViewer: Open Resource from the command palette, then browse through package files and open them.

One last thing to note is that knowing that sublime-package files are just zip files comes with a strong compulsion to unpack them, modify the contents, and pack them again. You should avoid that compulsion at all cost because upgrades to packages are done by replacing the package as a whole, so your changes will mysteriously vanish into the ether at some point if you do that.



This is a really great, detailed answer. Thank you very much!

I have used PackageResourceViewer before, and it is definitely invaluable. It’s cool that Sublime Text now has something similar built in (I hadn’t known that before!).

I would like to mention that to make sure that all new files open as markdown files, you need to set the use_current_file_syntax needs to be set to false.

If anyone is reading this and would like to set the default to Markdown extended, simply use this as your path:

"Packages/Markdown Extended/Syntaxes/Markdown Extended.sublime-syntax"


I’m so glad I found this post! I was trying to the exact thing @sn0w wanted to do.

Thank you @OdatNurd for providing such a detailed explanation. Like @sn0w, I’ve also used PackageResourceViewer (in ST2) and was not aware of the “View Package File” feature. It’s very convenient and much easier to deal with than PRV.

Also, for those who come across this post in the future, the path that works for me turned out to be


Thank you both :smiley:

1 Like


I am trying to use sublime-DefaultFileType to default the python extension on a CTRL-N.
Sublime text 3.2.2
Python 3.8.2
OS: Windows 10
What path value should be used for :-
“default_new_file_syntax”: “?”,
“use_current_file_syntax”: true

I cannot locate a Python.sublime-syntax file anywhere within the Packages directory.
Thanks Ken



Try creating a new thread