Created
June 9, 2018 16:39
-
-
Save marcelohenrique180/b2fdd22ecbfad7981ab9314e71493c2d to your computer and use it in GitHub Desktop.
Auto Prefix Commit While Writing It
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GitBranchIssue() | |
let current_branch = system("git rev-parse --abbrev-ref HEAD") | |
let prefix = substitute(current_branch, '\([A-Z]\+-[0-9]\+\).\+', '\1 ', '') | |
return prefix | |
endfunction | |
iab commit <C-R>=GitBranchIssue() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment