Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST3 support? #4

Open
cviebrock opened this issue Sep 14, 2013 · 20 comments
Open

ST3 support? #4

cviebrock opened this issue Sep 14, 2013 · 20 comments

Comments

@cviebrock
Copy link

Any chance of making your plug-in compatible with ST3?

@MattDMo
Copy link

MattDMo commented Nov 3, 2013

It's completely compatible with ST3, I don't know why it's marked ST2-only. You'll have to manually clone the repo into your Packages directory, but other than that it works fine out of the box.

@cviebrock
Copy link
Author

I think you need to follow the instructions here: https://sublime.wbond.net/docs/developers

and change the lines https://github.com/wbond/package_control_channel/blob/master/repository/d.json#L138-L147 to read:

{
    "name": "Default File Type",
    "details": "https://github.com/spadgos/sublime-DefaultFileType",
    "releases": [
        {
            "sublime_text": "*",
            "details": "https://github.com/spadgos/sublime-DefaultFileType/tree/master"
        }
    ]
},

That should make it show up in Package Control as working with ST2 and ST3.

@cviebrock
Copy link
Author

I've done this for you: wbond/package_control_channel#2421

@FichteFoll
Copy link

Merged.

@CNG
Copy link

CNG commented Jan 7, 2014

Not being a Sublime Text or OSX pro yet, I was unsure exactly what was meant by "Sublime base directory". I guessed this was /Users/username/Library/Application Support/Sublime Text 3, but the structure seems to be different than it was in ST2. I don't have language folders under the Packages folder, nor do I seem to have a file called "Java.tmLanguage" like the example anywhere on my system.''

Do the docs need to be updated for ST3 or am I missing something? Thanks!

@FichteFoll
Copy link

ST3 stores the standard packages in the application folder (where it is installed). See http://www.sublimetext.com/docs/3/packages.html

@CNG
Copy link

CNG commented Jan 8, 2014

Thank you @FichteFoll, that's very helpful!

@kaimantsch
Copy link

For ST 3 I can't seem to find the default language definitions there (/Applications/Sublime Text 3.app/Contents/MacOS/Packages) or in the (/Users/kai/Library/Application Support/Sublime Text 3/Packages)

Are they compressed in the Markdown.sublime-package file? Would I need to extract this, leave extracted, and point at it? Or am I missing something here?

Thanks, Kai

@FichteFoll
Copy link

Yes, packages are stored in zip archives which have the .sublime-package extension. See also the docs page I linekd above. You can get https://github.com/skuroda/PackageResourceViewer which eases the work with zipped packages.

@CNG
Copy link

CNG commented Jan 19, 2014

Hi @kaimantsch, do you mean you looked in /Applications/Sublime Text.app/Contents/MacOS/Packages and saw only a Markdown.sublime-package file? You said Sublime Text 3.app but I'm not sure if that was a typo. Mine doesn't have the "3" in the .app filename but does have the "3" in the data directory, ~/Library/Application Support/Sublime Text 3/.

Anyway, my /Applications/Sublime Text.app/Contents/MacOS/Packages contains 48 .sublime-package files corresponding to the various languages.

That said, I'm actually not sure if I have the DefaultFileType plugin working. My default_file_type.sublime-settings file is currently empty, but I seem to have the "open new file as current filetype" behavior working anyway. I guess I forgot where I left off and now am not sure if it was always like that.

@CNG
Copy link

CNG commented Jan 19, 2014

Oh on second reading, you're looking to reference Markdown? For some reason I thought you were saying all you had was a Markdown file.

@kaimantsch
Copy link

Yes, I was hoping to have Markdown be the default but I can't find the .tmLanguage file for it anywhere. (I renamed my app in the /Applications dir. No problems there.)

@CNG
Copy link

CNG commented Jan 19, 2014

If you were to duplicate the "Markdown.sublime-package" file, rename it "Markdown.zip" and extract it, you should find "Markdown/Markdown.tmLanguage". You don't need to actually extract the ZIP, though, but it's how you can be sure of the file name/path.

So to set Markdown as the default file type, I think you would create ~/Library/Application Support/Sublime Text 3/Packages/User/default_file_type.sublime-settings:

{
  "default_new_file_syntax" : "Packages/Markdown/Markdown.tmLanguage",
  "use_current_file_syntax" : false
}

Also note from the docs of this plugin:

This only affects files which are created with the Ctrl+N shortcut (Cmd+N on OSX).

Does that help?

@kaimantsch
Copy link

I have only been using the cmd-N to open/test the feature.

I tried a number of paths:

Packages/Markdown/MultiMarkdown.tmLanguage
/Packages/Markdown/MultiMarkdown.tmLanguage

I then extracted the MultiMarkdown.tmLanguage from the zip file and just dumped it in the App Packages directory and used the full path:

Error loading syntax file "/Applications/Sublime Text 3.app/Contents/MacOS/Packages/MultiMarkdown.tmLanguage

I moved it several more places, including ~/MultiMarkdown.tmLanguage

Complaint is the same about not being able to open:

Error loading syntax file "~/MultiMarkdown.tmLanguage": Unable to open ~/MultiMarkdown.tmLanguage

Other ideas? Is this working for you?

@kaimantsch
Copy link

Correction: I somehow forced a reload that suddenly caused it to work. I went back and even tried Packages/Markdown/MultiMarkdown.tmLangugage and suddenly that works too. I forgot the cardinal rule: "have you tried unplugging it and plugging it back in?" No idea what they worked but seems to be fine now.

Thanks for all the help debugging!

@CNG
Copy link

CNG commented Jan 20, 2014

I haven't tried extracting it or moving it anywhere, but just with the default ST3 install and then with DefaultFileType package installed, I get it to work just fine by having this as my default_file_type.sublime-settings file:

{
  "default_new_file_syntax" : "Packages/Markdown/MultiMarkdown.tmLanguage",
  "use_current_file_syntax" : false
}

Is the use_current_file_syntax setting working for you when you set it to true?

@CNG
Copy link

CNG commented Jan 20, 2014

Hah OK, glad it works. For me, the changes to the settings file seem to take immediately. I can change to another language, save, and then do Cmd+N and it opens a new tab as the new file type immediately.

@kaimantsch
Copy link

The crazy thing is that clear that was happening, at least in part. I would hit cmd-n and it would complain that it couldn't open the file named just as I had typed in the lastest change. So clearly it had read the new file name each time and updated. But somehow... something changed? Suddenly all the same combinations I tried before worked. I went back and tried them all. Anyway, clearly a Sublime text issue and not with your plugin. Hopefully all of this working back and forth will be useful to someone! When in doubt... reboot.

@absolutejam
Copy link

I've got the exact same issue as kaimantsch except that a reboot didn't fix it, neither did a reinstall of the package.

If I look under View > Syntax it has the correct language/syntax selected (From my default_file_type.sublime-settings) but it isn't loading all of the syntax.

I've tried;

{
  "default_new_file_syntax" : "Packages/Markdown/MultiMarkdown.tmLanguage",
   "use_current_file_syntax" : false
}

and when I create a new document, it has the white background (as per the language settings) and the correct option is selected in View > Syntax > MarkdownEditing > MultiMarkDown but none of the highlighting or auto-completion works.

I've also tried tried HTML and XML to test and I get the same symptoms.

@mliq
Copy link

mliq commented Oct 21, 2014

Did you actually extract the .tmlanguage file to Packages/User/ and then reference it there? That worked for me with Markdown Extended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants