ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Git​Syntaxes

by vovkkk ST2/ST3

Highlighting for git files in Sublime Text

Details

Installs

  • Total 4K
  • Win 1K
  • OS X 1K
  • Linux 959
Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3
Windows 0 2 4 2 2 4 3 6 5 4 1 1 8 3 4 1 3 3 3 3 2 3 5 3 1 1 0 7 3 3 2 0 3 6 11 3 5 1 1 0 1 3 4 2 1 2
OS X 0 5 1 2 1 1 0 5 4 1 1 1 2 2 0 2 4 0 1 0 2 1 1 8 4 1 3 2 4 4 3 3 1 3 8 5 2 2 2 1 1 1 2 1 1 0
Linux 0 3 0 0 0 6 2 1 1 2 1 1 1 1 1 1 1 0 2 3 1 3 1 0 1 3 3 2 4 2 3 3 1 3 4 0 0 1 0 2 0 0 2 2 1 0

Readme

Source
raw.​githubusercontent.​com

Git Syntaxes

Syntax Highlighting for SublimeText

Features

  • 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.)

Customisation

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:

  1. For commits Packages/User/commit-message.sublime-settings
  2. 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").

How to use ST as editor for Git

Note for Windows, you must have Build 3065 or lated to have command line support, Or just add folder into PATH and call sublime_text instead of subl

  • Mac / Linux: subl -n -w
  • Windows: subl.exe -n -w

Preferred Method: Edit .bashrc

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"

Alternate Method: Ammend your .gitconfig

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"


## SFAQ
### Aren’t there similar packages for those syntaxes? Why another one? Why not contribute into existing one?
I’ve [tried](https://github.com/adambullmer/sublime_git_commit_syntax/pull/1) with no luck, no any feedback.
So this package is an attempt (the first one, in fact) to bring all related syntaxes in one place.

### But what about Git, GitSavvy and many others?
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.

### Are you interested in pull requests or collaboration in general?
Sure, absolutely.

### What is ‘s’ in SFAQ for?
<b>S</b>upposedly frequently asked questions.

### Do you even push-up?
Nope.

## Credits
* Commit definitions are provided by [Josh Goebel](https://github.com/yyyc514)
* Base for Config definitions is borrowed from <https://github.com/textmate/git.tmbundle>

<hr>

All sources under [MIT](LICENSE)