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
  • 2 hours ago
  • 5 years ago

Installs

  • Total 48K
  • Win 40K
  • OS X 6K
  • Linux 2K
May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13
Windows 0 5 10 13 17 10 17 4 8 12 15 7 21 4 5 4 8 11 9 11 16 4 2 6 9 15 12 4 3 4 15 7 9 13 6 5 3 9 9 7 7 11 4 4 9 25
OS X 0 0 3 2 6 8 4 4 2 3 3 2 2 0 2 0 3 4 6 2 3 1 0 5 3 4 1 1 3 2 0 2 2 1 3 0 0 3 4 3 6 6 2 7 3 3
Linux 0 0 0 2 1 1 4 0 0 0 1 2 1 3 1 0 1 1 0 0 1 0 0 0 2 0 0 0 0 0 2 0 1 0 1 0 0 1 1 0 2 0 1 0 1 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