Skip to content

Instantly share code, notes, and snippets.

View marcelohenrique180's full-sized avatar
💭
Into the shadows for a while

Marcelo Henrique marcelohenrique180

💭
Into the shadows for a while
View GitHub Profile
@marcelohenrique180
marcelohenrique180 / .vimrc
Created June 9, 2018 16:39
Auto Prefix Commit While Writing It
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()