Gcommit: extract ticket number from branch name

This commit is contained in:
Stefan Liebl 2017-11-13 14:36:02 +01:00
parent dd6066ddb7
commit 7ffc7365df

View File

@ -1,5 +1,6 @@
" Stefans gitcommit-filetype-plugin " Stefans gitcommit-filetype-plugin
" add branch name to commit message " add branch name to commit message, replace 'feature/DLCPRO-1234-abc' by 'DLCPRO-1234'
nnoremap <buffer> gcc :execute 'normal i'.fugitive#head()<CR>A: nnoremap <buffer> gcc :execute 'normal i'.substitute(fugitive#head(), '\%(.*/\)*\([^-]\+-\d*\).*', '\1', '')<CR>A:
nnoremap <buffer> ccc :Gcommit<CR>:execute 'normal i'.fugitive#head()<CR>A: nnoremap <buffer> ccc :Gcommit<CR>:execute 'normal i'.substitute(fugitive#head(), '\%(.*/\)*\([^-]\+-\d*\).*', '\1', '')<CR>A: