Syntax Highlighting for SublimeText
- Highlight all Git files (gitconfig, gitattributes, commit message, interactive rebase todo)
- Toggle comments in all files above with default keystroke whatever it is (usually ctrl + /)
- Many scopes, e.g. you can set separate colour for every command in rebase file (i.e.
pick
,fixup
, etc.)
Sublime Text supports per-syntax settings, for instance, you may want to enable spell check whenever write commit message, or make a font size bigger, or maybe even use completely different colour scheme — all these possible.
Create files:
- For commits
Packages/User/commit-message.sublime-settings
- For rebase
Packages/User/rebase.sublime-settings
Content of those files:
{
"spell_check": true,
"font_size": 22
}
For available settings look at Preferences
→ Settings — Default
(note, some settings are global and cannot be syntax-specific, e.g. "font_options"
).
Note for Windows, you must have Build 3065
or later to have command line support, or just add the folder into PATH
and call sublime_text
instead of subl
- Mac / Linux:
subl -n -w
- Windows:
subl.exe -n -w
This will allow for more editing options than just the git commit, like editing diffs. This also leaves flexibility as it can be easily overridden, by the .gitconfig
for example.
Add the following to your .bashrc
:
On Mac and Linux:
export EDITOR="subl -n -w"
You can run the following command to let git update your .gitconfig
git config --global core.editor 'subl -n -w'
Or add the following line manually to your .gitconfig
[core]
editor = 'subl -n -w'
You also can hide menu (as on screenshot above) and tabs:
editor = "sublime_text -n -w --command toggle_menu --command toggle_tabs"
Aren’t there similar packages for those syntaxes? Why another one? Why not contribute into existing one?
I’ve tried with no luck, or any feedback. So this package is an attempt (the first one, in fact) to bring all related syntaxes in one place.
Those packages add integration in an IDE fashion — so you call git from-within Sublime Text.
This package does an opposite thing — make stuff more readable whenever you call ST from-within git, so ST remains an editor with extra features rather than IDE.
Sure, absolutely.
Supposedly frequently asked questions.
Nope.
- Commit definitions are provided by Josh Goebel
- Base for Config definitions is borrowed from https://github.com/textmate/git.tmbundle
All sources under MIT