I would like use sublime for my Mercurial commit messages, so I set
HGEDITOR="C:\Program Files\Sublime Text 3\subl.exe" -w -n a
This will start Sublime with a file named something like hg-editor-mstdne.commit.hg.txt
.
Then I would like to be able to have it automatically wrap at 72 characters (like Sublime Text line wrap and commit messages). This can be done per syntax, so I have defined a syntax for it
%YAML 1.2
---
name: hg-commit
file_extensions: [.commit.hg.txt]
scope: text.hg
contexts:
main:
- match: "^HG:.*"
captures:
0: comment.line.hg-commit
I can manually select the syntax, but the commit still opens as Plain Text. If I select View->Syntax->'Open all with current extension as' then all other .txt files are also opened with hg-commit syntax.
Are there any ways to get it to use my syntax for hg commit message files only?