TIL: Better Commit Messages With Atom

Default editor for git commit messages

// in your terminal
git config -- global core.editor "atom --wait"

Alert user that git commit message is too long

// Add the following code to root stylesheet in Atom editor
atom-text-editor::shadow {
.git-commit.invalid.deprecated.line-too-long {
color: @text-color-warning;
text-decoration: none;
}
.git-commit.invalid.illegal.line-too-long {
color: @text-color-selected;
background: @background-color-error;
opacity: 0.9;
}
}

Add git commit template to Atom editor snippets

'.text.git-commit':
'commit-message':
'prefix': 'comm'
'body': """
${1:Subject < 50 chars}

${2:Body in detail}
"""

Resources

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.