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

Default File Type

by spadgos ALL

ST2 Package which automatically sets the syntax for new files

Details

  • 2023.03.05.08.12.26
  • github.​com
  • github.​com
  • 2 years ago
  • 1 week ago
  • 13 years ago

Installs

  • Total 63K
  • Win 50K
  • Mac 10K
  • Linux 3K
Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9
Windows 1 11 4 6 6 4 3 3 2 3 3 5 10 4 2 2 5 4 4 5 5 2 4 4 3 1 9 2 4 4 7 9 11 5 3 5 4 4 2 5 3 9 6 1 4 11
Mac 0 3 0 1 0 1 1 1 0 1 1 0 1 0 0 0 0 1 0 0 1 1 0 1 0 0 1 3 1 0 0 0 0 1 0 0 0 0 1 1 1 2 0 0 2 0
Linux 0 0 1 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 2 1 0 0 0 0 1 0 0 1 0 2 1 0 1 0 0 0 0 0 0 0 0 0 0 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 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