Sublime doesn't recognize extension - sublimetext

I've started having this problem recently.
Whatever document I open in sublime, it seems not to recognize it's filetype (php, html, blade, js etc):
I have to manually change the file-type in the bottom right-hand corner every time (here i've changed it php and all worked fine after that):
QUESTION: who can I make sublime detect file type as it did previously?

The answer is very easy. In the same right hand bottom corner, where I was changing the file-type, there is an option at the top "Open all with current extension as...". There you have to choose the filetype and sublime with remember it.
Here is the same question already answered:
How do I set sublime text to auto detect a file type after setting it once?

Related

Where is the windows terminal settings location?

I edited the settings file and there must have been a typo and now the app crashes on startup.
Online the documentation says the settings lives in $env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
I can't figure out what that path means since it doesn't exist on the computer.
I re-installed the app to fix the problem then made sure to see what the actual path is.
It's located in : C:\Users\{USERNAME}\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
In the current version (1.7.1033.0), the application can open the JSON settings file for you via a button. Open the Settings tab, and the bottom left corner will have a button named "Open JSON file". Clicking that button will open a prompt asking with what application to open the file. That text editor can then tell you where the file is located.
If you open the terminal settings, it will open a text editor with the settings.json file. If your default editor is VS Code it will show you the path below the tabs on the top of the screen.
I'm unsure what other editors show you the path, but if it is crucial you can change your default text editor to Code.
There is still the option to open the JSON file through settings. In version 1.15.2875.0 you can still find the "Open JSON file" at the bottom left corner
Screenshot with highlights
This hint was given by a comment by user1340531:
Mine is at C:\Users\{username}\AppData\Local\Microsoft\Windows Terminal\settings.json
(or more generically: %userprofile%\AppData\Local\Microsoft\Windows Terminal\settings.json)
If it's not there, you should consider OP's answer or vyps comment which lets you find out one of these generic paths (they are equivalent):
%userprofile%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
%LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
$env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
If you don't know what these paths mean, I'd recommend playing around with "Windows Run" (Win+R) and the explorer address bar.

Change color of caret in sublime text 3

Trying to configure a custom caret color..Here is what I have done so far but had no result in a successful output..
I have dowloaded the PackageResourceViewer and gone into my theme and changed the <key>caret</key> <string>#F8F8F0</string> to my own custom hex color.
Once this is done I then overwrite the current theme by choosing save as and restarting Sublime Text. After restart, I see no change made to the caret...Hmmm
I have also followed this post on
How do I edit the Solarized (Light) theme in Sublime Text 3
Any one have and suggestions? I would greatly appreciate your help.
When you say you "gone into your theme", did you open or extract? By open, you are essentially viewing a read-only version, so saving it doesn't do anything really.
If you do extract it, try saving it into your user folder, then make sure you choose it via the preferences menu

How to open default project in Sublime Text when starting app (mac)

When I click the sublime text icon (to start/open it) I would like it to default to either a specific folder, or the last folder that was open. This SO question was helpful:
Set Sublime Text's default directory when opened
However I have set hot_exit, remember_open_files, and close_windows_when_empty and none of this seems to work for me.
If I actually 'quit' sublime text down in the dock, then it will open the last project I had open (in addition to another blank window).
Any way to make it remember my project without having to quit the app?
I set hot_fix, remember_open_files, and close_windows_when_empty as described in Set Sublime Text's default directory when opened, and this works on macOS IF you 'quit' sublime rather than closing the app using the 'x' in the upper right hand corner of the app. So for me, when I want to close sublime I go down in the doc and right click on sublime and choose 'quit', and when I open it again, the last project I had open will be displayed.
Another quick option is to use command-q to quit the app.

Customising the syntax colour in Sublime Text 3

I'm in the process of creating my own syntax colour theme for Sublime Text 3. I've done quite a lot but I want to copy most of the JavaScript colour syntax from the default 'Cobalt' theme that comes with ST3 (and possibly mix-and-match from other themes). I can't seem to find the Cobalt theme anywhere on my Mac?
Any ideas on where this might be?
Instead of navigating through /Applications, the easiest way of accessing built-in packages in Sublime Text 3 is to use #skuroda's excellent PackageResourceViewer plugin, available through Package Control. Once installed, restart Sublime and hit ⌘ShiftP to open the Command Palette. Type prv to bring up the PackageResourceViewer options, and select Open Resource. Scroll down to Color Scheme - Default, hit Enter, then scroll down to select Cobalt.tmTheme and hit Enter. You can now hit Esc to get rid of the menu, and start looking through the theme file for the bits you want to copy.
Good luck!
In Sublime Text installation directory, if I'm not mistaken, that's /Applications/ on OS X, there's a Packages directory, which contains a package file Color Scheme - Default.sublime-package which contains all the default color schemes.
.sublime-package is a simple zip file with modified extension, so you may simply copy it somewhere in your home directory, extract it and browse through the Cobalt.tmTheme file.
P.S. If you have trouble opening it with OS X archive manager, you may simply rename it:
mv name.sublime-package name.zip
But as far as I remember, it could be done simply like (correct me here if I'm wrong)
unzip name.sublime-package -d somedir

Is it possible to launch an external image editor from Textmate?

Is it possible to launch an external image editor from the TextMate project drawer? I suppose the same concept would apply to launching any external editor from TextMate. Right now, if I right-click on the image file, I only have an option to open in Preview or Finder.
Thanks!
Yes. There is an (official) TM Bundle that does what you want--it's called "ImageBrowser." I installed recently and i have used it only once. It seems to work fine for the purpose you mentioned in your Question; in particular, it finds images in your current project and displays them in an image browser that runs inside TextMate.
You can get it from the Macromates SVN Repository.
TextMate respects the Finder's (well, LauchService's) "Open with" choice for each file. Whichever program would open when you double-click the file in Finder will appear in TextMate's contextual menu. Simply change this through the Finder's Get Info window for the file in question to the editor of your choice, and TextMate will respect it. It's dynamically populated, so you don't need to restart TextMate.
As far as I know, there's no method to specify a secondary program beyond the default.
I think no is the answer, but like Matt said, explore the usage of the Services menu.

Resources