Sublime MarkdownEditing plugin color scheme and line numbers - sublimetext

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.

Related

Tabs not being recognized from RStudio text editor

If I create a simple Makefile in an Rstudio Text File:
graphic1.jpeg : mouse.csv graphic1.R
Rscript graphic1.R
It will not execute. I get the error message, "Makefile:2: *** missing separator. Stop." because the tab in line 2 is not really a tab.
If I edit the Text File in Text Wrangler, a real tab will be inserted and the file will execute.
I have updated my RStudio Preferences / Code to ensure that the box is unchecked for "insert spaces for tab".
Is this just a bug in RStudio text editor?
If you want to change this setting temporarily e.g. to tabulate a Makefile or a .tsv file, the fastest way is to only change the Project Options, do your stuff, and then revert it back.
The project options take precedence over Global Options, so changing the global ones only makes sense if you want to keep that option enabled for all future projects.
So I just learned from an R-Bloggers post by Jeffrey Hollister that there are two places in RStudio where I need to uncheck "Insert spaces for tab":
1) RStudio / Preferences / Code
2) Tools / Project Options / Code Editing
I am now up and running.

Why does Visual Studio Code insert spaces when editing a Makefile and "editor.insertSpaces": "auto"?

make doesn't like spaces for the body of a target in a Makefile. Has to be a tab.
I changed "editor.insertSpaces" to "auto", thinking this would help. It didn't.
I had to set it to false in order to get the code working.
This is now possible with Language Specific Settings.
https://code.visualstudio.com/docs/getstarted/settings#_language-specific-editor-settings
To customize your editor by language, run the global command Preferences: Configure Language Specific Settings (command id: workbench.action.configureLanguageBasedSettings) from the Command Palette (⇧⌘P) which opens the language picker. Selecting the language you want, opens the Settings editor with the language entry where you can add applicable settings.
Once you have the editor open, enter the following configuration for [makefile]
{
"[makefile]": {
"editor.insertSpaces": false,
"editor.detectIndentation": false
}
}
VS Code does accurately guess the file type for a Makefile, but the language configuration does not specify tab style. There is an outstanding pull request that addresses this issue.
Before that PR lands, you may be able to fix this locally by editing the application itself. On OSX where applications are really just folders, you can find the language configuration for Makefiles in Visual Studio Code.app/Contents/Resources/app/extensions/make. Open up make.configuration.json and add "insertSpaces": false on line 2. That fixed it for me.
Visual Studio Code users that wish to use spaces as their indent character in the global configuration will have trouble editing Makefiles because it requires the user to use tabs as their indent character instead of spaces. Updating the configuration just to edit a few lines is not a viable solution IMO.
You can use the Command Palette (View > Command Palette) and type Convert Indentation to Tabs and hit Enter. You editor should now have updated all indentation to their corresponding tabs equivalent.

Trailing white spaces only for javascript files in Sublime text

In my user preferences in Sublime Text 3, I can set user preferences for trailing white spaces:
"trim_trailing_white_space_on_save": true
This is great for javascript files, but not for Jade (or other templating engines) where I need trailing spaces in my view.
Can I customize this option so certain files types (Jade) can opt-out (or opt-in)?
You can define file type-specific ("syntax specific") preferences in Sublime that override your user settings.
These preferences are set in the same manner as user settings, except that they use a different .sublime-settings file.
To edit syntax-specific preferences for a given file type, open a file of that type in the editor and then select Preferences | Settings - More | Syntax Specific - User from the main menu. (This simply opens the appropriate settings file, e.g. .../Sublime Text 3/Packages/User/Jade.sublime-settings would be opened if you were editing a .jade file).
In your case, I would suggest leaving
"trim_tailing_white_space_on_save": true
in your user preferences, but then set it to false specifically for Jade files by editing .../Jade.sublime-settings, e.g.:
{
"trim_trailing_white_space_on_save": false
}
Note: the above assumes that the Jade syntax has been defined in your copy of Sublime. While not present in the default installation, it will be created if you install a plugin made for working with Jade.

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

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.

Aptana Studio 3 - Syntax highlighting for Handlebars files

How do I get Aptana to apply the same syntax highlighting and auto-complete that exists on .html files to my files that end in .handlebars?
I'm assuming there must be some setting in Preferences to allow this, but I'm not seeing it.
If it helps, I'm using version 3.0.7.2011
Ok, recently figured this one out.
Under Windows > Preferences select General > Editors > File Associations.
Here, you can simple add whatever extension you want, then the editor that you want to apply it to.
Here's a screenshot:
After you click "Ok" you will have whatever syntax highlighting or code completion that the editor you specified has.

Resources