Created
September 21, 2022 15:36
-
-
Save Kawsay/4021c08fc75dc9ef466e98eee096fe22 to your computer and use it in GitHub Desktop.
This file contains 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
" We're using branch names like: | |
" - feature/hd-1234_tiny_description | |
" - feature/HD_4321_tiny_description | |
" - chore/tiny_description | |
" where '1234' refers to a Jira ticket. | |
" | |
" The following, if working on a feature, extracts Jira ticket number | |
" and set it as branch name in vim-airline. | |
let g:airline#extensions#branch#format = 'GetJiraTicketNumber' | |
function GetJiraTicketNumber(name) abort | |
if a:name =~# 'feature' | |
return matchlist(a:name, 'feature\/HD[-_]\(\d\{4}\)')[1] | |
else | |
return a:name | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment