How do I edit the Solarized (Light) theme in Sublime Text 3 - syntax-highlighting

I am trying to edit some of the syntax colours in Sublime Text 3. I'm using the Solarized (Light) built in colour scheme but I only want to change a few of the colours. Where is the settings file (on a Mac)?

I have managed to find a solution:
Go to http://tmtheme-editor.herokuapp.com (someone has built a web-based theme editor). Once you have tweaked the colour syntax you can download the themename.tmTheme file. Move that file to /Users/username/Library/Application Support/Sublime Text 3/Packages/ User/ (if you are on a Mac).
Load in the syntax theme from the top menu: Sublime Text > Preferences > Color Scheme > themename.
If you want to tweak you syntax further up can upload the custom theme back in the web-based theme editor and save it out again.
Hope this helps someone else.

I'd recommend using PackageResourceViewer to open the file. You could make your modifications there, and it would save in the proper location to override the built in files. However, I would recommend copying the contents of the file and creating a custom version in your User folder. That way, you can easily move it around and modify it without worrying about the built in color schemes.
The default color scheme files are located in Color Schemes - Default.sublime-package. In ST2, this was extracted to Packages/Color Scheme - Default. PackageResourceViewer will display these folders (as they would normally appear in the Packages folder in ST2. You could navigate to your color scheme from that.

This should be much easier than it is
I used parts of all the other answers to make this work.
Important notes before you begin:
1. I had used this menu item to select a colour scheme: Sublime Text > Preferences > Color Scheme
2. I chose "Monokai.tmTheme"
3. Therefore the file you need containing the colours is: Monokai.tmTheme
4. You will NOT have easy access to that file yet!!
Overall Steps:
The overall steps I found to work are:
1. Get a copy of the Monokai.tmTheme text file
2. Place it in your "/Users/XXX/Library/Application Support/Sublime Text 3/Packages/User" directory
(replace XXX with your username)
3. Again use this menu: Sublime Text > Preferences > Color Scheme
4. Choose the new entry "Monokai - User"
5. Any changes to your Monokai.tmTheme file will immediately be seen by Sublime Text
Getting the Monokai.tmTheme text file :
This is the tricky part.
You have two options
Option A. Use PackageResourceViewer to open the resource:
A1. Tools -> Command Palette
A2. Type "PackageResourceViewer"
A3. Choose "PackageResourceViewer: Open Resource"
A4. Navigate to "Color Scheme - Default"
A5. Navigate to "Monokai.tmTheme"
A6. This will open the contents of the file but it is NOT a real file on your disk! You must copy the contents into a new text document and save it into "/Users/XXX/Library/Application Support/Sublime Text 3/Packages/User/Monokai.tmTheme" as above
Option B. Use the web app to create your .tmTheme file:
B1. Goto http://tmtheme-editor.herokuapp.com
B2. Edit the colours
B3. Download the .tmTheme file
B4. Put it into "/Users/XXX/Library/Application Support/Sublime Text 3/Packages/User/Monokai.tmTheme" as above

Editing is way simpler than advices above.
Go to Sublime installation folder, find there Packages subfolder.
Open Color Scheme - Default.sublime-package as a zip archive (I use Total Commander and Ctrl+PgDn keys).
Find there any scheme you like *.tmTheme, copy to HDD and edit with any XML editor.
Pack modified file back (with Total Commander just copy file to opened archive).

Sublime version, OS & OS version independent way:
In Sublime, at the top menu bar goto "Sublime Text 2/3" -> Preferences -> "Browse Packages...".
This will open the "Packages" folder correctlin Finder/FileExplorer/Nautilus/... depending on OS/version-of-OS.
Find your theme and edit away..
Source

As of May 2018 using Sublime Text 3:
I followed the Overall Steps and Option A. from #davidfrancis with great success to customize the Mariana color scheme.
However, I had to change the file extension from <name>.tmTheme to <name>.sublime-color-scheme. Also, the filename can be anything you want (don't need to keep the default), and it will appear under Preferences > Color Scheme.

Related

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

Sublime MarkdownEditing plugin color scheme and line numbers

I like to utilize Markdown for a lot of the text that I write. To that end I wanted to try out the MarkdownEditing plugin for Sublime Text 3, but am having some user experience issues:
I cannot figure out how to change the color scheme such that it affects the MarkdownEditing syntax editor. Changes to .Packages\User\Preferences.sublime-settings do not effect display settings when in this syntax highlighting mode. However, those changes are reflected in other tabs. How do I change the color scheme when making use of the MarkdownEditing syntax highlighting?
How do I turn on line numbers when making use of this syntax plugin?
TL;DR
If you are using Markdown GFM syntax, open/create "Data/Packages/User/Markdown.sublime-settings" and add:
{
"color_scheme": "Packages/your/custom.tmTheme",
"line_numbers": true
}
See menu: Preferences > Package Settings > MarkdownEditing.
There are 3 different settings there for 3 different syntaxes. First check what "default" settings does and then undo it in "user" settings.
To stop the MarkdownEditing package from overriding your color scheme on Markdown files:
Open Preferences > Settings - User
Find your color_scheme line - e.g. it looks like
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
Copy the entire line
Open Preferences > Package Settings > Markdown Editing > Markdown GFM Settings - Default
Comment out the other color_scheme lines by adding // in front of them
Paste your line instead
Save the file
Markdown files will now use your regular color scheme rather than using their own scheme just for .md files.
If you get an error about "Error trying to parse settings", make sure your line ends with a , if there are lines below it, and does not end with , if it is the last line.
This was one of the most annoying things about this plugin when I installed it a while back, so I promptly got rid of it. However, before doing so, I figured out how to solve your problems. First, since you're using ST3, you'll need to install the quite-useful PackageResourceViewer plugin. Open the Command Palette (CtrlShiftP on Windows), type in prv to bring up the PackageResourceViewer options, and select Extract Package. Scroll down and select MarkdownEditing, hit Enter, and you're all set. You can now open Packages/MarkdownEditing (Packages should be in C:\Users\username\AppData\Roaming\Sublime Text 3, also available by selecting Preferences -> Browse Packages...) in the sidebar and browse through all the different .sublime-settings files for the different syntaxes and for the main plugin, changing things as you want. The syntax-specific files use all the same options found in Preferences -> Settings-Default, so for example you can set "line_numbers": true to turn line numbering back on, and change the value of "color_scheme" to your preferred value.
I had another packaged named Markdownlight which was overriding the color scheme. I had to uninstall it before the color_scheme in the MarkdownEditing user settings took affect.

How to change background color in the Notepad++ text editor?

Does anyone know how to change the background color, font size, and other appearance-based settings in Notepad++? The default is white but I am trying to change it into a dark gray or something else.
Go to Settings -> Style Configurator
Select Theme: Choose whichever you like best (the top two are easiest to read by most people's preference)
You may need admin access to do it on your system.
Create a folder 'themes' in the Notepad++ installation folder i.e. C:\Program Files (x86)\Notepad++
Search or visit pages like http://timtrott.co.uk/notepad-colour-schemes/ to download the favourite theme. It will be an XML file.
Note: I prefer Neon any day.
Download the themes from the site and drag them to the themes folder.
Note: I was unable to copy-paste or create new files in 'themes' folder so I used drag and that worked.
Follow the steps provided by #triforceofcourage to select the new theme in Notepad++ preferences.
From version v8 released 2021-06-07 Notepad++ has additional Dark Mode option.
To enable it go to Settings -> Preferences -> Enable dark mode
Effect:
Next step:
Go to Settings -> Style Configurator
Select Theme: Choose whichever you like best (over half of styles here are dark, but each is different).
Hint: click on theme list and use keyboard arrows 🔼 and 🔽 to switch between themes and test all of them.
Effect after all steps (Obsydian theme here):
There seems to have been an update some time in the past 3 years which changes the location of where to place themes in order to get them working.
Previosuly, themes were located in the Notepad++ installation folder. Now they are located in AppData:
C:\Users\YOUR_USER\AppData\Roaming\Notepad++\themes
My answer is an update to #Amit-IO's answer about manually copying the themes.
In Explorer, browse to: %AppData%\Notepad++.
If a folder called themes does not exist, create it.
Download your favourite theme from wherever (see Amit-IO's answer for a good list) and save it to %AppData%\Notepad++\themes.
Restart Notepad++ and then use Settings -> Style Configurator. The new theme(s) will appear in the list.
If anyone wants to enable dark mode, you may follow the below steps
Open your Notepad++, and select “Settings” on the menu bar, and choose “Style configurator”.
Select theme “Obsidian” (you can choose other dark themes)
Click on Save&Colse
Notepad++ changed in the past couple of years, and it requires a few extra steps to set up a dark theme.
The answer by Amit-IO is good, but the example theme that is needed has stopped being maintained. The DraculaTheme is active. Just download the XML and put it in a themes folder. You may need Admin access in Windows.
C:\Users\YOUR_USER\AppData\Roaming\Notepad++\themes
https://draculatheme.com/notepad-plus-plus
I have just installed the latest version Notepad++ website (currently it is v8.1) which provides an explicit dark mode setting.
Go to "Setting" -> "Preferences..." -> "Dark Mode" -> check the "Enable dark mode" tick box. The editor might need to be restarted to take effect completely.
https://notepad-plus-plus.org/downloads/
If you are not able to add the theme , a workaround is that go to
USER/Appdata/LocalRoaming/Notepad++
make sure you save whatever the data is there in stylers.xml as back up before
There you will find a stylers.xml you can edit that only , with any xml format you need.
( https://raw.githubusercontent.com/dracula/notepad-plus-plus/master/Dracula.xml )
Sometimes even after adding the file , notepadd++ doesn't pick up the theme
To revert back just edit back stylers.xml with the backup file.
After restarting it , you can see notepad ++ has taken that style as default

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

How to Open files and folders in same window in Sublime Text on macOS?

If I open ~/foo.txt then open ~/baz/bar.txt from Terminal, Sublime Text always opens 2 different windows. It's aggravating to have all these different windows open..
I've tried changing a bunch of ST's settings, but nothing seems to fix this.
Is there a way to have ALL files and folders just open up in the same window as if I were manually adding all these folders to the project?
In Sublime Text Menu:
Preferences -> Settings - User
Look for 'open_files_in_new_window'
And change 'true' with 'false'
Rather than editing the SublimeText default settings (as Jahnux73 suggested), you should go to Preferences -> Settings - User, and add the following:
"open_files_in_new_window": false,
The SublimeText default settings file should not be modified, as it may be overwritten by Sublime updates, and so that you'll always be able to restore the default settings. The way Sublime works is that at runtime, it reads and applies the default settings, and then reads and applies the Settings - User file. In the event of a conflict, the User settings take precedence. That way, you can add your own settings without modifying the default configs.
Folder can be directly dragged to sidebar, or from menu bar select
Project --> Add Folder to Project.
And better, since this has the same functionality as File -> Open folder which isn't mapped to a shortcut by default. You can make this a key mapping by going to
File -> Preferences -> Key bindings and append
{ "keys": ["ctrl+shift+o"], "command": "prompt_add_folder" },
then you can use CTRL+SHIFT+O to add a folder.
Drag files or directories to sublime window will add them to current window instead of opening new one.
All the answers above indicate the parameter files only, but this does not work for folders.
I found this solution:
You need to go to the registry path HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3\command
Change command add the parameter -a, get: C:\Program Files\Sublime Text\sublime_text.exe "%1" -a
Also, if You have a custom alias for the console, you can use it like this: subl . -a
For mac OS two changes are needed
1-
Preferences -> Settings - User
Look for 'open_files_in_new_window'
And change 'true' with 'false'
2-
In system Preferences find the Dock and then change its setting for the option “Prefer tabs when opening documents” and choose Always.
Then do :
subl folder_1
subl folder_2
subl folder_3
I explained in details here
All those replies above didn't work. Here I found the real solution to this problem: -
Click Preferences
> Settings - Distraction Free
Then add these lines in user panel:
"open_files_in_new_window": false,
And click Save.
Here you go!!
None of the answers above worked for me.
I had a Sublime app icon pinned to the Dock and every time I opened a new file through the Finder context menu (Open With > Sublime Text.app) it went to a newly opened instance of Sublime that's displayed in "recent apps" zone of the Dock. So I always had 2 icons in the Dock, each with different set of tabs.
I simply removed the first icon from the Dock, and pinned the one from "recent apps" area, and dragged it to the place where the first icon used to be.
This seems to work fine provided that you set "open_files_in_new_window" to "false" (Preferences > Settings), as suggested in other answers.

Resources