Force sublime text to use PATH from the shell value - macos

I am trying to add a simple build system to sublime text 3. Here is my current project configuration :
{
"folders":
[
{
"path": "."
}
],
"settings":
{
},
"build_systems":
[
{
"path": "/opt/local/bin:/opt/local/sbin:/Applications/Cocos/tools/ant/bin:/Applications/Cocos/frameworks:/Applications/Cocos/frameworks/cocos2d-x-3.5/tools/cocos2d-console/bin:/Users/shadaen/.rbenv/shims:/Users/shadaen/.rbenv/bin:/usr/local/bin:./node_modules/.bin:/Users/shadaen/Library/Haskell/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/shadaen/.gem/ruby/1.8/bin:/opt/nginx/sbin:/Users/shadaen/.bash_it/plugins/available/todo",
"name": "HybrisHtml5",
"cmd" : ["./buildAndRunHtml5.sh"]
}
]
}
As you can see I have put a big path option which reflet the current state of my shell path. (echo $PATH)
My question is, is it possible to make sublime text use the current value of $PATH in is configuration ?
For information, I am under OSX Yosemite.

I find out that there is a plugin SublimeFixMacPath which fix the loaded path by sublime text.

Related

Sass doc is giving me duplicate results

My output tree is showing duplicates and I can't figure out why. This is prototype angular project with this file tree. I can't figure out why.
src
app
components
scss
styles.scss
Here's my out put tree
My sassdoc.json config
{
"basePath": "https://mjhandy.github.io/AngularBoilerPlate/docs/sass/",
"package": {
"title": "Angular Boilerplate",
"name": "ngBoilerplate",
"description": "My boilerplate for basic, resuable, Angular components"
},
"dest": "./docs/sassdoc",
"excliude": [
"./src/scss/_mixins.scss"
],
"groups" : {
"structure" : "Structure",
"component" : "Component",
"helpers" : "Helpers",
"global" : "Global Items",
"mixins" : "Mixins"
},
"options": {
"display": {
"watermark": false
}
}
}
My run commands :
sassdoc ./src/**/* -c sassdoc.json
I ran into the same result with the following command within my package.json scripts
sassdoc 'src/assets/styles/sass/**'
According to the official sassdoc documentation they are using this library to parse glob patterns.
The ** notation matches the directory itself, its containing files and its subdirectories.
But the root directory name is suffice for the sassdoc, it will iterate over its tree structure if any.
sassdoc 'src/assets/styles/sass/*'
# or simply
sassdoc 'src/assets/styles/sass'

How to really disable ctrl+shift+arrow keys in Windows Terminal Preview?

Everytime I try to use ctrl-shift-up or ctrl-shift-down inside of the new windows terminal preview, it scrolls the terminal view up or down. I tried going into the profiles.json file and set the "command" : "scrollDown" and "command" : "scrollUp" to "unbound" but it has no effect.
If I try to bind scollUp to something else, let's say ctrl+alt+b, then it correctly adds the keybind to the command. It seems like there's a default windows keybinding that is set to scroll the terminal view up and down using ctrl+shift+arrows.
Not sure if you found the answer, but I was looking for this too. Found the below in a microsfot devblog that works currently:
If there is a default key binding included in the defaults.json file
that you would like to free up, you can set that key binding to null
in your profiles.json.
{
"command": null, "keys": ["ctrl+shift+w"]
}
Link to full article:
https://devblogs.microsoft.com/commandline/windows-terminal-preview-1910-release/
you can add
{ "command": { "action": "sendInput", "input": "\u0000" }, "keys": "ctrl+shift+up" },
{ "command": { "action": "sendInput", "input": "\u0000" }, "keys": "ctrl+shift+down" },
so when you press the keys, it replaces the undesirable command with sending a null character to the input (that, of course, does nothing lol)

TextMate scope for triple quoted Python docstrings

I'm currently setting up VS Code for Python development. I'd like to have triple-quoted docstrings highlighted as comments, not as strings, i.e. grey instead of light green in this picture:
I know that I can adjust this in the TextMate rules for this theme, but I can't figure out the right scope for Python docstrings. I thought I would be something like this:
"editor.tokenColorCustomizations": {
"[Predawn]": {
"comments": "#777777",
"textMateRules": [
{
"scope": "string.quoted.triple",
"settings": {
"foreground": "#777777"
}
}
]
},
}
but that does not have the desired effect, even after restarting the editor. Does anyone know what the right scope is?
Just to expand on the comments above, the scopes are:
For docstrings: string.quoted.docstring.multi.python for """ ''' (or .single for ' ")
For triple quote strings that are not docstrings: string.quoted.multi.python
The scope string.quoted.triple is not used, even though it appears in settings.json autocomplete.
Try using this one
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"string.quoted.multi.python",
"string.quoted.double.block.python",
"string.quoted.triple",
"string.quoted.docstring.multi.python",
"string.quoted.docstring.multi.python punctuation.definition.string.begin.python",
"string.quoted.docstring.multi.python punctuation.definition.string.end.python",
"string.quoted.docstring.multi.python constant.character.escape.python"
],
"settings": {
"foreground": "#777777" //change to your preference
}
}
]

How to customize the color of custom syntax tokens in VSCode extension

TLDR; How can I have an extension colorize the syntax the extension is defining without it actually being a color theme the user has to enable?
I'm attempting to port this Sublime Text plugin (ToDone) to VSCode.
It creates a grammar for todo lists and then uses syntax highlighting to emphasize important tasks, mute completed tasks, etc.
I found "editor.tokenColorCustomizations", via Customize a Color Theme. It works with the new syntax when I use it in my user settings, but fails when I use it in the package.json#contributes portion of the extension manifest.
{
"contributes": {
"languages": [
{
"id": "todone",
"aliases": [
"ToDone",
"To-Done"
],
"extensions": [
".todone",
".todo"
]
}
],
"grammars": [
{
"language": "todone",
"scopeName": "text.todone",
"path": "./todone.tmLanguage"
}
],
"configurationDefaults": {
"[todone]": {
"editor.insertSpaces": false,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "symbol.definition.task-heading.todone",
"settings": {
"foreground": "#ff8800"
}
}
]
}
}
}
}
}
So far, the syntax seems ok — it's exactly what is being used by the Sublime plugin and the colors from the user-settings are applied correctly. Also, the format of the settings seems ok because "editor.insertSpaces" is being applied and the colors are working when present in the user-settings.
Lastly, I get a very disappointing 'Warning' 'Unknown editor configuration setting' message on the "editor.tokenColorCustomizations" setting in the extension package.json.
So, sounds like this setting is not enabled for extensions?
Another possible route I saw was to use decorators. But, I didn't see anything on inspecting the syntax tokens associated with a portion of text in the docs, e.g. some way to iterate through the syntax tokens of the document to apply decorators. So, the decorator route sounds like the hard-way compared to "editor.tokenColorCustomizations".
Any suggestions on how to make this work would be greatly appreciated.
Edit: The code, so far, is on GitHub: tiffon/vscode-todone
It only fails if you specify a specific language. It is working for me if I do not specify the todone extension.
"configurationDefaults": {
"editor.insertSpaces": false,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "symbol.definition.task-heading.todone",
"settings": {
"foreground": "#ff8800"
}
}
]
}
}

Sublime Text 3 - Different colour scheme for each workspace

Is it possible to specify a different colour scheme for each workspace in Sublime Text so that I can easily identify which one I'm working on? In my situation, I have a single project that branches into two duplicate workspaces; one for a client and one for in-house development. In other words, each workspace is an instance of the project directory.
You will have to save your workspace as a separate project.
Open up your .sublime-project file. (Top menu -> Project -> Edit project)
It will look similar to this:
{
"folders":
[
{
"follow_symlinks": true,
"path": "/home/user/some_path/project"
}
]
}
Simply add the color scheme setting:
{
"folders":
[
{
"follow_symlinks": true,
"path": "/home/user/some_path/project"
}
],
"settings":
{
"color_scheme": "Packages/Toxin Color Scheme/Toxin.tmTheme"
}
}
You can get the color scheme path by switching it as you normally do (e.g. from top menu) and opening your User Preferences.

Resources