Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itchyny/vim-gitbranch
Provides the branch name of the current git repository
https://github.com/itchyny/vim-gitbranch
vim vim-plugins vim-scripts
Last synced: 7 days ago
JSON representation
Provides the branch name of the current git repository
- Host: GitHub
- URL: https://github.com/itchyny/vim-gitbranch
- Owner: itchyny
- License: mit
- Created: 2014-05-01T15:09:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-11-30T01:27:18.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T06:08:47.847Z (23 days ago)
- Topics: vim, vim-plugins, vim-scripts
- Language: Vim script
- Homepage:
- Size: 6.84 KB
- Stars: 202
- Watchers: 6
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-gitbranch
## Usage
This plugin provides a function which returns the name of the git branch.
```vim
:echo gitbranch#name()
```You can use this function to integrate with statusline plugins.
For example, in order to show git branch using [lightline.vim](https://github.com/itchyny/lightline.vim), configure as follows.
```vim
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'gitbranch#name'
\ },
\ }
```
See the [README.md of lightline](https://github.com/itchyny/lightline.vim) 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.