Theme for text files in Sublime Text 3 - text

Since one of the last updates the theme for .txt files in my Sublime Text 3 has changed. I am currently using the Monokai Theme for Sublime and would like to have the same theme options for all file types (black background, line numbers on the left, slim right sidebar/margin). Only when opening .txt files the background switches to white and the sidebars/margins become too wide taking half of the screen space.
An example can be seen on the left side of the screenshot. on the right side my sublime settings are displayed:
I have tried changing the "Preferences" -> "Color Scheme... " to any other color scheme. The changes seem to apply to the other file types I use (.json, .csv, .py etc). Only the .txt files seem not to be affected by any scheme changes.
Changing "Preferences" -> "Theme..." doesn't change much.
Neither could I find any specific settings for .txt files in "Preferences" -> "Settings".

There are two potential sources of the problem - an overzealous plugin or a messed-up .sublime-settings file. First, look in your Packages/User directory, where Packages is the one opened when selecting Preferences → Browse Packages…:
Linux: ~/.config/sublime-text-3/Packages
OS X: ~/Library/Application Support/Sublime Text 3/Packages
Windows Regular Install: C:\Users\YourUserName\AppData\Roaming\Sublime Text 3\Packages
Windows Portable Install: InstallationFolder\Sublime Text 3\Data\Packages
In the User directory, look for files named Text.sublime-settings or Markdown*.sublime-settings, then try deleting them (or renaming them to *.bak so they won't get processed).
If that doesn't work, take the list of all installed plugins from Packages/User/Package Control.sublime-settings and put it in your user preferences in the "ignored_packages" setting. Hopefully that will solve the problem. To identify the offending plugin, start removing plugins from "ignored_packages" one at a time until the behavior comes back.

Related

Spell check with CAPS using Sublime Text

I’ve noticed that Sublime Text 3 seems to ignore CAPITALISED words when using the spell checker.
Quite a lot of my document has strings in caps. I don’t want to mess with the formatting, just check the spelling.
Is there a file I can modify to toggle spell check where capitals are involved in SublimeText3?
I realise this may get thrown out for not being a coding question but I'll show you a Venn diagram of those who use SO and those who know how to really use Sublime Text.
The answer is yes, you can spell-check words in all caps, but it's going to take some effort. There is a setting that is appropriate here:
// Word list to use for spell checking. May also be a list of dictionaries.
"dictionary": "Packages/Language - English/en_US.dic",
The included dictionaries (there is one for en_US and one for en_GB) include some words in all caps, such as AIDS and DNA, but not all, so you'll need to make your own .dic file. Fortunately, this is fairly straightforward. You'll need to extract the original file, convert it to upper case in Sublime, save it, then change your settings to point to both dictionaries.
To extract the dictionary package, install PackageResourceViewer from Package Control. Open the Command Palette with CtrlShiftP (⌘ShiftP on macOS), type in prv, make sure PackageResourceViewer: Extract Package is selected, and hit Enter. Next, select the Language - English package, hit Enter, then hit Enter again when it shows Start Extraction (1 of XX items selected). A little popup should come up telling you the package was extracted successfully.
Next, you'll need to navigate to the correct folder and open the dictionary file in Sublime. Select Preferences → Browse Packages… (macOS: :Sublime Text → Preferences → Browse Packages…) to open the Packages directory in your file manager:
Linux: ~/.config/sublime-text-3/Packages or ~/.config/sublime-text/Packages
macOS/OS X: ~/Library/Application Support/Sublime Text 3/Packages or ~/Library/Application Support/Sublime Text/Packages
Windows Regular Install: C:\Users\YourUserName\AppData\Roaming\Sublime Text 3\Packages or C:\Users\YourUserName\AppData\Roaming\Sublime Text\Packages
Windows Portable Install: InstallationFolder\Sublime Text 3\Data\Packages or InstallationFolder\Sublime Text\Data\Packages
The exact path depends on version and whether or not you upgraded from Sublime Text 3.
Once in Packages, navigate into the Language - English directory and open either en_US.dic or en_GB.dic (depending on your locale and preference) in Sublime. Hit CtrlA (macOS: ⌘A) to Select All. Next, select Edit → Convert Case → Upper Case and all letters will be capitalized. Finally, select File → Save As…. Navigate up one level from Language - English to Packages, then go into the User directory and save the file there as en_US_CAPS.dic or en_GB_CAPS.dic, depending on which original you opened.
Finally, select Preferences → Settings and add the following to your user settings on the right side:
"dictionary": ["Packages/Language - English/en_US.dic", "Packages/User/en_US_CAPS.dic"],
Change both occurrences of US to GB if that's what you're using. Save, and you should be all set.
If you want to clean up a little at the end, you can delete the Packages/Language - English folder that was created earlier, but things should be just fine if you don't.

old file name stuck at the top of sublimetext

Very strange issue here, it's not causing problems but is aesthetically annoying. I had the kindle plugged into my windows machine as to edit the kindle's files. One of the kindle file names is now listed after the name of the python program I'm working on in sublime text. To paint a picture, above the menu drop downs in sublime text, there is the path to the document (IE python program) I'm working on, followed by the random file from the kindle.
The kindle file is no longer on my computer and never had anything to do with sublime text. I've tried restarting the computer and reinstalling sublime text, neither worked. Any ideas what might be going on??? Thanks!
The sublime text window caption shows you the name of the currently open file, followed by the name of the current project in parentheses (if you have a project open at all), followed by the name of the program.
Based on the screenshot in your image:
You currently have the file softmax.py open and it is stored in a folder on your desktop named machine learning\python programs\test\newyorktest\
The name of the Sublime project file is Casting the Circle_A Woman's Book of Ritual_B009FKTQD8_sample.sdr.sublime-project (the caption doesn't show the sublime-project part because that's redundant).
I would imagine that when you set up the project you accidentally chose that name as the name of the project file.
In order to fix your problem, select Project > Save Project As... from the menu and enter a different name for it. The location that you save the file in doesn't matter (it can be inside the folder of your project or in some other location), all that is important is that it has the extension .sublime-project.
Once you pick the new name, Sublime will immediately swap to using the new project file instead of the old one, which will keep your current set of open files, etc, and the caption will change.
You can then seek out and delete the other project file if you want.

Can't change comment color in sublime text editor 3?

I have what I would consider the perfect theme colors for my Sublime Text Editor 3 application; however, the only thing that is very annoying and hard to see is the comment colors. They're the same color as the background but maybe just one shade lighter.
I've seen some other posts on here on editing theme color files within Sublime Text but for some reason it seems like the data isn't taking effect. It's like it's going off of cached data or something.
For example, I'm using the "Monokai" theme. I've edited /opt/sublime_text/Packages/Color Scheme - Default.sublime-package and searched for Monokai. I changed the hex color code under lineHighlight, and restart Sublime. Nothing changes. In fact, I've changed numerous hex color codes under that section and restarted Sublime Text and absolutely nothing has change.d
What am I doing wrong here? I'm running this on Linux Mint 17.3 Cinnamon
I was unable to change comments color by editing Monokai.tmTheme even after purging cache or sublime reinstall.
For Sublime 3.1.1 Build 3176 editing Monokai.sublime-color-scheme works.
1. Open Package Resource Viewer
2. Open Color Scheme
3. Open Monokai color scheme
4. Add you desired color in variables (pick here)
5. Change comment color
6. Enjoy your new comments color!
I've done exactly what you said, changed the value under lineHighlight in Monokai.tmTheme in Color Scheme - Default.sublime-package, restarted Sublime Text and it worked just fine. I'm running Build 3103 on Manjaro Linux.
Sublime Text stores its settings and cache ~/.config/sublime-text-3, I suggest temporarily renaming this folder, which should take you to a freshly installed state. Then make sure Sublime Text really restarts and that your color scheme changes are really in place.
I encountered the same problem. I found the following way solved my problem.
According to #Саша Черных, one can go to
tmtheme-editor.herokuapp.com/#!/editor/theme/Monokai to create and download a customized theme. Then, in Sublime Text 3, from [References -> Browse Packages...], you can find where your Packages folder locates. Just put the downloaded file "Monokai.tmTheme" in that folder, restart app, then it's done.

How to open Sublime Text files in window based on extension?

Is there any way to get Sublime to open all files of a certain extension in the same window? For example, when using a 2x2 grid, I'd like to keep all SCSS files in the upper left, all HAML in upper right, JS lower left and search in lower right. I'd like to use the search function, and have files go to the other three tabs instead of the search window each time.
I've tried the 'open in relevant window' plugin and it doesn't appear to make any difference.
When opening lots of files it gets very tedious opening them and having to manually move them to a window that wasn't active when opening.
Edit: I'm working on a Mac, so I'd need something that works there, or preferably cross platform.
Edit: Op is working on a Mac, I'll leave this in case any windows users are interested in this solution.
---
Perhaps an extra shell extension would help.
If you're familiar with the Registry, you can create a new key that opens all selected files in a new window. Simply create a modified version of what Sublime Text already has.
The existing key for Sublime Text exists here:
HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text\command
With the default value of (depending on version):
C:\Program Files\Sublime Text 3\sublime_text.exe "%1"
You could create a new key like so:
HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text (new window)\command
Then add the -n arguement to the default value:
C:\Program Files\Sublime Text 3\sublime_text.exe -n "%1"
This will create a new window every time you use the shell extension to open files and will keep multiple files organized in the same window.
To take this a step further, if you have any programming experience you could create your own shell extension which takes a list of files and groups them for you, which then in turn can create the new windows programmatically.

Error loading colour scheme in Sublime Text 3

This error appears every time I save file or open a file.
Error loading colour scheme Packages\User\MonokaiGrayDL.tmTheme: Unable to open Packages\User\MonikaiGray.tmTheme
I searched about it but those solutions are for sublime text 2...please help
Menu > Sublime Text > Preferences > Settings - User> remove the line with `"color_scheme"`.
After saving the line was regenerated for me with a reference to a theme that actually exists.
You need to put the theme file inside Packages\Color Scheme - Default.sublime-package.
Open Color Scheme - Default.sublime-package with 7 zip (archive tool-you may use your favorite tool), and drag Monokai Gray.tmTheme into it. Then go to Sublime, and click Preferences -> Color Scheme and find Monokai Gray. When you choose the color scheme, it automatically updates the setting with this:
"color_scheme": "Packages/Color Scheme - Default/MonoKai Gray.tmTheme",
Note: I am using Sublime 3. I am not able to share my screen shot due to lack of reputation.
Sometimes, a couple of opened files ignores color schemes settings modifications, I had the same bug then ran this in the ST3 console :
[ v.settings().erase("color_scheme") for views in [ w.views() for w in sublime.windows() ] for v in views ]
This python code is pretty self explanatory.
With this, no need to close/re-open incriminated files for the bugs to go away.
Source
This happened to me after installing Compare Side-By-Side. The error message specified that SBSCompareTheme.theme could not be found. I don't remember the exact sequence of events, but I remember that at some point, I uninstalled the plugin, and the error message kept appearing.
It turns out that the theme file was referenced in the Local/Session.sublime_session file (~/Application Support/Sublime Text 3/Local/Session.sublime_session under OSX).
I edited that file by hand to remove any reference to the theme file, and the problem went away!
I am using Sublime Text 3.
I remove ColorHighlighter and it works.
I had the same problem:
My issue was that some packages creates a syntax-specific *.sublime-settings file (Markdown.sublime-settings in my case).
The file is located in Library/Application Support/Sublime Text 3/Packages/User.
This happens to me every now and then when my theme in use is being updated via Package Control. Try switching to a different theme, optionally remove and re-install Monokai Gray, then switch back to it.
I was having a similar issue with certain files/syntaxes after deleting a package (MarkdownEditing).
My issue was that some packages creates a syntax-specific *.sublime-settings file (Markdown.sublime-settings in my case). The file is location in Library/Application Support/Sublime Text 3/Packages/User.
This settings-file overwrites your color-scheme settings elsewhere. Removing it solved the issue.
That's easy!
Click Preferences ->Setting-User
you'll find your "color_scheme" attribute is your error message.
change it with a exist ".tmTheme" file.
Restart Sublime.
Sublime 3 here, worked for me after a restart.
I was getting similar error for the package PlainTasks. By renaming the folder PlainTasks-master to PlainTasks and restarting Sublime resolved the issue.
Copy the source code of the .tmTheme file from Github.
Open your non-working .tmTheme file with Sublime text.
Paste contents, save and restart Sublime text.
GO to Preferences->Browse Packages->User->open HTML.sublime-settings
then remove the line with "color_scheme" and save it.
if it doesn't work, just open PHP.sublime-settings instead of HTML.sublime-settings and do the same thing.
delete the user and you can fined it in C:\Users\webduang\AppData\Roaming\Sublime Text 3\Packages
GO to Preference->package control->package control user setting and paste this code..
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"draw_minimap_border": true,
"draw_white_space": "selection",
"font_face": "Source Code Pro Medium",
"font_size": 13,
"ignored_packages":
[
"Markdown",
"Vintage"
],
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
"line_padding_bottom": 3,
"line_padding_top": 3,
"material_theme_accent_orange": true,
"overlay_scroll_bars": 3,
"theme": "Default.sublime-theme",
"trim_trailing_white_space_on_save": true,
"word_wrap": false
}

Resources