Reputation: 52787
I want to use the Notepad++ Color Scheme (https://packagecontrol.io/packages/Notepad%2B%2B%20Color%20Scheme) for printing in Sublime Text 3.
I've installed 2 printing (HTML export) packages to attempt this:
Print to HTML
ExportHtml
Print to HTML
puts a nice menu option in Sublime's "File" menu, but I don't see any options for changing the print/export color scheme. Therefore, I'm trying to use ExportHtml
, which does have color scheme options.
However, I can't figure out how to use them.
I used Ctrl+Shift+P then search for Package Control: Install Package
to install ExportHtml
.
To see the export menu for ExportHtml
go to Ctrl+Shift+P then Export to HTML: Show Export Menu.
This shows all of the export options for printing. Choose one and it will open your code up, syntax-highlighted and all, in a browser, for instance, for nice printing.
To make my changes, I want to add a menu entry to the settings to give me a "Browser Print - Color (Notepad++ colors)"
option.
To access the settings, I went to Preferences
--> Package Settings
--> ExportHtml
--> Settings
. Documentation on the color_scheme
can be found here: http://facelessuser.github.io/ExportHtml/usage/.
I then added the following to my user settings in an attempt to add a menu entry to the "html_panel" in the main settings:
{
// Define configurations for the drop down export menu
"html_panel": [
// Browser print color (selections and multi-selections allowed)
{
"Browser Print - Color (Notepad++ colors)": {
"numbers": true,
"wrap": 900,
"browser_print": true,
"multi_select": true,
"color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Color.tmTheme",
"style_gutter": false,
"diable_nbsp": true
}
}
],
}
FIRST PROBLEM: This causes my one menu entry to replace the others when I want it to be added to them. When I go to Ctrl+Shift+P then Export to HTML: Show Export Menu
I don't see my menu option added to the others, I see it replacing them. Is there a way to fix this without having to copy all menu entries, or do I just need to copy them?
SECOND PROBLEM: I installed the Notepad++ Color Scheme
via the Ctrl+Shift+P Package Control: Install Package
tool too, and it works fine, but I don't know how to link it to the "color_scheme" parameter in the configuration settings just above. I've searched all around the folders in my Linux home directory and don't know where this package is installed or what to put in the code above to make it use this color scheme.
How do I fix the above 2 problems?
Upvotes: 0
Views: 906
Reputation: 22791
For this particular package, the only way for you to (safely) add an item to the html_panel
setting is to copy the whole of that setting from the default file into your own version, and then make the change there. There's no shortcut around that, unfortunately.
Sublime handles many of its resource files (including sublime-settings
files) by allowing multiple packages to have files with the same name which contribute to the settings, and then merging them together in a specific order, where the User
package (where your Sublime customizations are stored) is always last.
That means that if your User
version of the file is empty, the settings all come from the package version, and settings that you add to your User
settings override the ones in the packaged version.
Thus if you add the setting html_panel
to your custom file, you're overriding the default version, so without copying the entire setting to your user file, the command will only show you the one you added.
For the second part of your question, the line that you want to modify in the entry to add that color scheme is this:
"color_scheme": "Packages/Notepad++ Color Scheme/Default Stylers.tmTheme",
Recent versions of Sublime have an item in the Preferences
menu named Color Scheme...
that shows you a list of color schemes and lets you select one.
If you're not familiar with the general process of figuring out the full name of a color scheme, the easiest way to find out would be:
Preferences > Color Scheme...
and select the color scheme that you want to usePreferences > Settings
to open your user settings; the value of the color_scheme
setting in your user settings tells you how to set the color scheme upPreferences > Color Scheme...
to reset back to the color scheme you want to use in generalAs far as package locations, there are three places where packages can be installed.
First, if you select Preferences > Browse Packages...
you will be taken to your Packages
folder. This folder contains all of the packages that are installed as "loose" files (that will become clear in a moment). Most packages that Package Control installs aren't installed this way, so you will probably see many packages missing.
On Linux, the location of this folder is ~/.config/sublime-text-3/Packages
.
Secondly, from the folder above if you navigate one folder level up in your file browser, you will see a folder named Installed Packages
. If you look inside there, you will see a set of files of type sublime-package
, which is really just a zip
file with a different name. Each file is named for the package that it represents and contains the contents of the package.
On Linux, the location of this folder is ~/.config/sublime-text-3/Installed\ Packages
.
Thirdly, if you look inside of the folder that Sublime is installed in, you will see a folder named Packages
, and inside of that folder is another set of sublime-package
files. These are the packages that ship with Sublime to provide default functionality. They're shared by everyone on the same computer, so you shouldn't mess with this folder at all unless you're fully aware of all of the ramifications (and really not even then).
The location of this folder depends on where you installed Sublime. If you're not sure where that is, you can open the Sublime console with View > Show Console
and then enter the following text and press enter:
sublime.executable_path()
Upvotes: 1