Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have noticed that Sublime text 2 by default associates files with *.scm and *.ss extensions with lisp language. But it's scheme actually. Is it possible to redefine this association somehow (in config maybe)?

Currently, to get the correct syntax highlighting I just go to View -> Syntax -> Scheme every time I open scheme file.

share|improve this question

3 Answers 3

up vote 6 down vote accepted

Extension associations are based on syntax highlighting schemes.

To remove unwanted associations, open ST2 and choose Preferences → Browse Packages..., a folder with packages will open. Find the incorrectly detected package (in this case Lisp) and open a .tmLanguage file (Lisp.tmLanguage) in ST2. It's first lines look like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>comment</key>
    <string></string>
    <key>fileTypes</key>
    <array>
        <string>lisp</string>
        <string>cl</string>
        <string>l</string>
        <string>mud</string>
        <string>el</string>
    </array>
(...)

Those strings in lines 9-13 are file extensions that ST2 will associate with Lisp. You can remove some of those lines (place the cursor on unwanted line and press Ctrl+Shift+K), changes will be applied immediately when you save the file.

To add new associations, open a .tmLanguage file from a package and add new strings among those already defined.

share|improve this answer

View -> Syntax -> Open all with current extension as ...

share|improve this answer

This is already answered in StackOverflow: http://stackoverflow.com/a/8014142/1346682

In the current version of Sublime Text 2 (Build: 2139), you can set the syntax for all files of a certain file extension using an option in the menu bar. Open a file with the extension you want to set a default for and navigate through the following menus: View -> Syntax -> Open all with current extension as... ->[your syntax choice].

Valid also for the current latest version (Build: 3065).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.