Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kristijanhusak/vim-dirvish-git
Git support for dirvish.vim
https://github.com/kristijanhusak/vim-dirvish-git
dirvish git neovim vim
Last synced: 12 days ago
JSON representation
Git support for dirvish.vim
- Host: GitHub
- URL: https://github.com/kristijanhusak/vim-dirvish-git
- Owner: kristijanhusak
- License: mit
- Created: 2018-04-24T20:22:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-21T04:42:46.000Z (over 2 years ago)
- Last Synced: 2024-10-10T12:18:50.489Z (24 days ago)
- Topics: dirvish, git, neovim, vim
- Language: Vim script
- Homepage:
- Size: 17.6 KB
- Stars: 54
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-dirvish-git
Plugin for [dirvish.vim](https://github.com/justinmk/vim-dirvish) that shows git status flags.
Same as [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin) for [NERDTree](https://github.com/scrooloose/nerdtree).Currently tested only on Linux.
![screenshot](https://i.imgur.com/izrVegA.png)
## Requirements
* [dirvish.vim](https://github.com/justinmk/vim-dirvish)
* (Neo)Vim with `conceal` feature (`has('conceal')` should return `1`)
* git## Installation
Install the plugin alongside [dirvish.vim](https://github.com/justinmk/vim-dirvish) with your favorite plugin manager.I'm using [vim-plug](https://github.com/junegunn/vim-plug)
```vimL
Plug 'justinmk/vim-dirvish'
Plug 'kristijanhusak/vim-dirvish-git'
```Thats it!
## Mappings
Following mappings are available by default:`]f` - jump to next "git" file
`[f` - jump to previous "git" fileTo change mappings to use for example `` for next and `` for previous file add this to your vimrc:
```vimL
autocmd vimrc FileType dirvish nmap (dirvish_git_next_file)
autocmd vimrc FileType dirvish nmap (dirvish_git_prev_file)
```## Customization
Ignored files are not marked by default. If you want them to be marked, add this to your vimrc:```vimL
let g:dirvish_git_show_ignored = 1
```These are default indicators used that can be overridden in vimrc:
```vimL
let g:dirvish_git_indicators = {
\ 'Modified' : '✹',
\ 'Staged' : '✚',
\ 'Untracked' : '✭',
\ 'Renamed' : '➜',
\ 'Unmerged' : '═',
\ 'Ignored' : '☒',
\ 'Unknown' : '?'
\ }
```To change font color you can update any of these highlighting groups.
Here's short example how it's set up by default:
```vimL
let l:modified = 'guifg=#EBCB8B ctermfg=3'
let l:added = 'guifg=#A3BE8C ctermfg=2'
let l:unmerged = 'guifg=#BF616A ctermfg=1'silent exe 'hi default DirvishGitModified '.l:modified
silent exe 'hi default DirvishGitStaged '.l:added
silent exe 'hi default DirvishGitRenamed '.l:modified
silent exe 'hi default DirvishGitUnmerged '.l:unmerged
silent exe 'hi default DirvishGitIgnored guifg=NONE guibg=NONE gui=NONE cterm=NONE ctermfg=NONE ctermbg=NONE'
silent exe 'hi default DirvishGitUntracked guifg=NONE guibg=NONE gui=NONE cterm=NONE ctermfg=NONE ctermbg=NONE'
" Untracked dir linked to Dirvish default dir color
silent exe 'hi default link DirvishGitUntrackedDir DirvishPathTail'
```To override any of these, just add a highlight group to your vimrc.
Just make sure it's **after** your colorscheme setup```vimL
colorscheme gruvbox
" Highlight dirvish modified files with blue color
hi DirvishGitModified guifg=#0000FF
```Icons are shown by default, to hide the icons and only show the Git status with
colors, add this to your vimrc:```vimL
let g:dirvish_git_show_icons = 0
```## Thanks to:
* [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin)