ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Default File Type

by spadgos ST2/ST3

ST2 Package which automatically sets the syntax for new files

Details

  • 2011.11.27.11.03.34
  • github.​com
  • github.​com
  • 6 years ago
  • 34 minutes ago
  • 6 years ago

Installs

  • Total 48K
  • Win 40K
  • OS X 6K
  • Linux 2K
Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6
Windows 11 11 19 10 13 4 10 23 15 25 16 10 3 8 10 9 12 8 10 2 2 9 9 15 13 9 2 5 15 16 4 13 9 5 8 12 14 12 18 9 2 6 8 16 14 12
OS X 0 3 6 2 3 2 1 5 5 1 2 2 1 0 3 5 2 0 1 1 0 4 3 8 3 2 2 4 5 2 4 4 5 0 4 0 0 1 2 2 2 1 3 3 2 6
Linux 1 1 0 1 0 1 1 0 0 0 2 0 0 1 0 2 1 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 2 0 0 1 1 0 1

Readme

Source
raw.​githubusercontent.​com

This package sets the default file type of new files to be either the same as the current file, or a predefined default.

This only affects files which are created with the Ctrl+N shortcut (Cmd+N on OSX).

Installation

With Package Control

If you have the Package Control package installed, you can install DefaultFileType from inside Sublime Text itself. Open the Command Palette and select “Package Control: Install Package”, then search for DefaultFileType and you're done!

Without Package Control

Go to your Sublime Text 2 Packages directory and clone the repository using the command below:

git clone https://github.com/spadgos/sublime-DefaultFileType.git DefaultFileType

Configuration

Create a file in your Packages/User directory called default_file_type.sublime-settings and you can set these options:

  • default_new_file_syntax (String) This is the path, relative to the Sublime base directory to the language file you'd like to load as the default. Default value is "Packages/Java/Java.tmLanguage"
  • use_current_file_syntax (Boolean) Set this to true to use the current file's syntax for the new file. If false, then the default (above) will always be used. Default value is true

Let me know if you have any problems or feature requests by adding an issue here: https://github.com/spadgos/sublime-DefaultFileType