4

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.

0

3 Answers 3

8

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.

3

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

1

This is already answered in StackOverflow: https://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).

1
  • tks, thumb up (y)
    – Dan D.
    Feb 13, 2020 at 4:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .