install.fairie/dotfiles/.vim/plugged/vim-airline/autoload/airline/extensions/vimagit.vim
Git E2E Dev Test Username 6892bd7dbd git subrepo clone https://github.com/vim-airline/vim-airline.git ./dotfiles/.vim/plugged/vim-airline
subrepo:
  subdir:   "dotfiles/.vim/plugged/vim-airline"
  merged:   "0ed7b8b"
upstream:
  origin:   "https://github.com/vim-airline/vim-airline.git"
  branch:   "master"
  commit:   "0ed7b8b"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:36:08 -04:00

30 lines
878 B
VimL

" MIT License. Copyright (c) 2016-2021 Jerome Reybert et al.
" Plugin: https://github.com/jreybert/vimagit
" vim: et ts=2 sts=2 sw=2
" This plugin replaces the whole section_a when in vimagit buffer
scriptencoding utf-8
if !get(g:, 'loaded_magit', 0)
finish
endif
let s:commit_mode = {'ST': 'STAGING', 'CC': 'COMMIT', 'CA': 'AMEND'}
function! airline#extensions#vimagit#init(ext) abort
call a:ext.add_statusline_func('airline#extensions#vimagit#apply')
endfunction
function! airline#extensions#vimagit#get_mode() abort
if ( exists("*magit#get_current_mode") )
return magit#get_current_mode()
else
return get(s:commit_mode, b:magit_current_commit_mode, '???')
endif
endfunction
function! airline#extensions#vimagit#apply(...) abort
if ( &filetype == 'magit' )
let w:airline_section_a = '%{airline#extensions#vimagit#get_mode()}'
endif
endfunction