Provides the branch name of the current git repository
Vim script
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8118dc1 May 27, 2017
Permalink
Failed to load latest commit information.
autoload use robust operator !=# instead of != Mar 10, 2015
doc add doc Feb 10, 2015
plugin use % instead of <amatch> on BufEnter May 12, 2015
LICENSE add LICENSE May 27, 2017
README.md add README.md May 27, 2017

README.md

vim-gitbranch

Usage

This plugin provides a function which returns the name of the git branch.

:echo gitbranch#name()

You can use this function to integrate with statusline plugins.

For example, in order to show git branch using lightline.vim, configure as follows.

let g:lightline = {
      \ 'active': {
      \   'left': [ [ 'mode', 'paste' ],
      \             [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
      \ },
      \ 'component_function': {
      \   'gitbranch': 'gitbranch#name'
      \ },
      \ }

See the README.md of lightline for further details.

Installation

Install with your favorite plugin manager.

Author

itchyny (https://github.com/itchyny)

License

This software is released under the MIT License, see LICENSE.