diff --git a/vimfiles.stefan/after/ftplugin/gitcommit.vim b/vimfiles.stefan/after/ftplugin/gitcommit.vim index f6bae85..aec3530 100644 --- a/vimfiles.stefan/after/ftplugin/gitcommit.vim +++ b/vimfiles.stefan/after/ftplugin/gitcommit.vim @@ -1,5 +1,6 @@ " Stefans gitcommit-filetype-plugin -" add branch name to commit message -nnoremap gcc :execute 'normal i'.fugitive#head()A: -nnoremap ccc :Gcommit:execute 'normal i'.fugitive#head()A: +" add branch name to commit message, replace 'feature/DLCPRO-1234-abc' by 'DLCPRO-1234' +nnoremap gcc :execute 'normal i'.substitute(fugitive#head(), '\%(.*/\)*\([^-]\+-\d*\).*', '\1', '')A: +nnoremap ccc :Gcommit:execute 'normal i'.substitute(fugitive#head(), '\%(.*/\)*\([^-]\+-\d*\).*', '\1', '')A: +