❌ [Deprecated] Sublime-ShellScriptImproved
========================================
A better ShellScript (Bash) syntax highlight for Sublime Text >= 3143.
Important Note
==============
The official `ShellScript (Bash)` syntax has been rewritten.
All following comparisons are with the one **BEFORE** rewritten.
I deprecated this plugin because the new official Bash highlighting is
much better than the former one (and better than this plugin).
Thus, this plugin is no longer needed I guess.
Pros
----
- It fixes quite lots of bugs which exist in the official `ShellScript (Bash)` syntax.
- It parses things more grammatically while the official one is just like a keyword highlighter.
Cons
----
- It is designed for Bash only while the official one is designed for general shell scripts.
- You may have to add customized scopes to your color scheme if you do not want to use the bundled one.
- Its source code is as messy as the official one's but this does not matter if you are not a maintainer.
Screenshots
===========
Left / Right = Official ShellScript (Bash) / ShellScript Improved
![screenshot](https://raw.githubusercontent.com/jfcherng/Sublime-ShellScriptImproved/gh-pages/images/screenshot/screenshot.png)
Color scheme
============
There are quite a lot of scopes that may be missing in the color scheme you are using.
If you want to add them by yourself, see the `Customization from Your Color Scheme` section.
Or, you can set the syntax specific settings to use the color scheme which is shipped with this package.
To do that,
1. Open a file with `ShellScript Improved` syntax.
1. Go to `Preferences` » `Settings - More` » `Syntax Specific - User`
1. Add the `color_scheme` item into the settings file and then save.
```javascript
{
// use a bundled .tmTheme file while writing shell scripts
"color_scheme": "Packages/ShellScriptImproved/color_schemes/dark.tmTheme",
// or, if you are using Sublime Text >= 3149, using a .sublime-color-scheme file is recommended
"color_scheme": "Packages/ShellScriptImproved/color_schemes/dark.sublime-color-scheme",
}
```
> That color scheme is the exact one I use in my Sublime Text so there is only a dark one.
> You would get the same highlighting as shown in the screenshot.
Customization from Your Color Scheme
====================================
Note that an extra rule is added to my `.tmTheme` in above screenshots in order to set text to its default color, i.e., white on dark theme and black on light theme mostly. (I just can not find other way to set text to the default text color...) This resets the color of `TEXT` in `$(echo TEXT)` and other things like that.
```xml
name
Embedded
scope
meta.embedded
settings
foreground
#FFFFFF
name
Reset Color
scope
meta.reset.color
settings
foreground
#FFFFFF
```
Also, those scopes may be missing in your theme. You may add/adjust them to get a better color highlighting.
```xml
name
Shell - variable
scope
variable.other.normal.shell, variable.other.positional.shell, variable.other.bracket.shell, variable.other.special.shell, variable.other.loop.shell, variable.other.c-style.shell,variable.other.positional.shell
settings
fontStyle
bold
foreground
#AE81FF
name
Shell - bracket variable in meta.reset.color
scope
meta.reset.color variable.other.bracket.shell, meta.reset.color variable.other.bracket.shell variable.other.bracket.shell, meta.reset.color variable.other.bracket.shell variable.other.bracket.shell variable.other.bracket.shell
settings
fontStyle
bold
foreground
#AE81FF
name
Shell - true
scope
variable.other.true.shell
settings
foreground
#AAFFFF
name
Shell - false
scope
variable.other.false.shell
settings
foreground
#FFAAFF
name
Shell - built-in command
scope
support.function.builtin.shell
settings
fontStyle
bold
foreground
#50AAFF
name
Shell - privilege command
scope
support.function.privilege.shell
settings
fontStyle
bold
foreground
#FF0000
name
Shell - external command
scope
support.function.external.shell
settings
fontStyle
bold
foreground
#0684F4
name
Shell - punctuation variable
scope
punctuation.definition.variable.shell
settings
fontStyle
bold
foreground
#AE81FF
name
Shell - punctuation definition
scope
punctuation.definition.string
settings
fontStyle
bold
foreground
#E6DB74
name
Shell - pipe-sign/parentheses in `case`
scope
punctuation.separator.pipe-sign.shell, punctuation.definition.case-pattern.shell
settings
fontStyle
bold
foreground
#F92672
name
Shell - `;;` in `case`
scope
punctuation.terminator.case-clause.shell
settings
fontStyle
bold
foreground
#F92672
name
Shell - command switch
scope
support.command-switch.shell
settings
fontStyle
bold italic
```
See Also
========
- [Tcsh and Csh Mode](https://packagecontrol.io/packages/Tcsh%20and%20Csh%20Mode)
- [SublimeLinter-shellcheck](https://packagecontrol.io/packages/SublimeLinter-shellcheck)
Supporters
==========
Thank you guys for sending me some cups of coffee.
- [deterenkelt](https://github.com/deterenkelt)