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
  • 3 hours ago
  • 6 years ago

Installs

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

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