Git Product home page Git Product logo

vim-fern-git-status's Introduction

fern-git-status.vim

fern renderer Support Vim 8.1 or above Support Neovim 0.4 or above Support Git 2.25 or above MIT License Doc

reviewdog

fern-git-status is a fern.vim plugin to add git status on node's badge asynchronously like:

fern-git-status

Usage

Just install the plugin and visit a git repository which has some dirty status.

Status

The plugin shows status of nodes as short format of git status like:

X          Y     Meaning
-------------------------------------------------
         [AMD]   not updated
M        [ MD]   updated in index
A        [ MD]   added to index
D                deleted from index
R        [ MD]   renamed in index
C        [ MD]   copied in index
[MARC]           index and work tree matches
[ MARC]     M    work tree changed since index
[ MARC]     D    deleted in work tree
[ D]        R    renamed in work tree
[ D]        C    copied in work tree
-------------------------------------------------
D           D    unmerged, both deleted
A           U    unmerged, added by us
U           D    unmerged, deleted by them
U           A    unmerged, added by them
D           U    unmerged, deleted by us
A           A    unmerged, both added
U           U    unmerged, both modified
-------------------------------------------------
?           ?    untracked
!           !    ignored
-------------------------------------------------

The status of directory indicates that the directory contains index (left) or work tree (right) changes. For example, single - on right side means that the directory contains some work tree changes but index changes.

Colors

See :help fern-git-status-highlight to customize the colors.

Performance

Disable the following options one by one if you encounter performance issues.

" Disable listing ignored files/directories
let g:fern_git_status#disable_ignored = 1

" Disable listing untracked files
let g:fern_git_status#disable_untracked = 1

" Disable listing status of submodules
let g:fern_git_status#disable_submodules = 1

" Disable listing status of directories
let g:fern_git_status#disable_directories = 1

🚀 For large repositories it is also recommended to enable the Git (2.24+) manyFiles feature in the working directory as follows:

git config feature.manyFiles true

See also

vim-fern-git-status's People

Contributors

lambdalisue avatar bluz71 avatar

Stargazers

 avatar Chen Jiyang avatar daiki chiba avatar Vitaly Kogogin avatar Don avatar leoatchina avatar Ryosuke Horiuchi avatar  avatar  avatar melody avatar Lafixier Rafinantoka avatar Shuta Hirai avatar Morten Skøtt avatar apxxxxxxe avatar qwaxgo avatar  avatar Hiroya Onoe avatar Andy Shevchenko avatar Leonardo Valeri Manera avatar Takuma Hashimoto avatar David Guevara avatar arrow2nd avatar Wuelner Martínez avatar tomoya hiroe avatar Neil Castelino avatar  avatar TaoTao avatar asmka avatar  avatar ik5 avatar skanehira avatar Joseph Harriott avatar Göran Gustafsson avatar jason avatar Yuta Sano avatar masakazu.sawada avatar Rikuoh Tsujitani avatar Nikolaus Schlemm avatar Hanley Lee avatar Richard Mathieson avatar Luke Wang avatar Ruslan avatar  avatar Omar Seifelnasr avatar Ibrahim Abou Elenein avatar  avatar ◤◢◤◢◤◢◤◢ avatar Guilherme Rodz avatar  avatar Gokul Soumya avatar Domagoj avatar Zachary A Guerrero avatar Adailton Nascimento avatar Cheng JIANG avatar  avatar Jonathan Escamilla avatar Leonid V. Fedorenchik avatar Brad Svercl avatar tamago324 avatar Patrik Wenger avatar  avatar Rick Price avatar  avatar Ryota Takishita avatar Tim avatar  avatar Kyosuke Takayama avatar tg-z avatar  avatar voidense avatar Igor avatar  avatar uesyn avatar Ihor Urazov avatar Bálint Fülöp avatar  avatar yukimemi avatar hrsh7th avatar Yuta Katayama avatar Kamil avatar Daniel Singer avatar Luma avatar kuator avatar Rafael Bodill avatar Tsuyoshi CHO avatar

Watchers

 avatar James Cloos avatar Daniel M. Capella avatar Adailton Nascimento avatar  avatar

vim-fern-git-status's Issues

Colors

Is it possible to change the colors of the notifiers? I noticed my colors aren't exactly right and they are matching the directory colors instead.

Colouring when first opening neovim

Obviously a low priority bug, but when opening the current directory in neovim using the terminal (e.g., using the command nvim .), colouring for git-status doesn't appear.
If opening fern after first opening neovim (eg. :Fern . or :e .), colouring is present.

The problem can be reproduced on neovim v0.5.0 with the below vimrc.

if exists('+compatible') && &compatible
  set nocompatible
endif

" Disable Vim's native pack feature
set packpath=

" Clone https://github.com/lambdalisue/fern.vim in somewhere
" and specify that directory to the below
" set runtimepath^=~/ghq/github.com/lambdalisue/fern.vim

filetype plugin indent on
syntax on
"----------------------------------------------------------------

" Add extra settings here to reproduce the issue...
call plug#begin('~/.vim/plugged')
    Plug 'lambdalisue/fern.vim'
    Plug 'lambdalisue/fern-hijack.vim'
    Plug 'lambdalisue/fern-git-status.vim'
call plug#end()
"----------------------------------------------------------------
echomsg "Custom minimal vimrc has loaded"

Thank you for the plugin!

It would be nice to have `<Plug>(fern-action-git-status-toggle)` mapping

Hello @lambdalisue,

The g:fern_git_status_disable_startup flag is available to disable fern-git-status by default. That is useful, since git status, even with performance optimisation, can still be an expensive task.

I would like to have a mapping to allow the toggling of fern-git-status just as I currently have for toggling marks and hidden files:

nmap <buffer> m <Plug>(fern-action-mark-toggle)j
nmap <buffer> h <Plug>(fern-action-hidden-toggle)

I use these often.

If possible, I would like something similar for fern-git-status:

nmap <buffer> g <Plug>(fern-action-git-status-toggle)

When I hit g I get git-status details (due to g:fern_git_status_disable_startup being set to 1), even if this causes pause or slowdown. When I no longer want git-status details, maybe because performance is a little slower, I hit g again and they disappear as if the fern-git-status was never loaded to begin with.

If this is too hard, just close this. But if possible, it would be very handy.

Best regards.

Add Icons

Exists some way to change the current structure to icons like Powerline?

Custom styling instead of `[!!]`, `[ M]`, `[??]`, `[--]`

Hello,

By default fern-git-status will emit git status type details, two characters inside square bracket taking up four spaces.

That is fine as a default.

But, I would like to use just a single Unicode character such as or to indicate dirty state. I don't want [ M] in my file tree.

The g:fern_git_status#indexed_character and g:fern_git_status#stained_character flags are good, but they take up four spaces since square bracket and space will surround those characters. Single character symbol is my aim.

Is that possible now? If not, then I would request it as an enhancement request.

Many thanks, you are doing great work.

Support Windows

I startup vim and neovim with a minimal vimrc, still couldn't show git status. VIMRC is below:

if has('vim_starting')
  set nocompatible
endif
set packpath=
set runtimepath+=\~/vimfiles/plugged/fern.vim
set runtimepath+=\~/vimfiles/plugged/fern-plugin-git.vim
filetype plugin indent on
syntax on
nnoremap \<silent> <Leader>e :Fern . -drawer -keep -toggle\<CR>

Throws error on every start of `:Fern`

I get the error below when using fern and fern-git-status.vim. The error goes away as soon as I no longer load fern-git-status.vim.

[fern] ERROR: {'throwpoint': '/nix/store/yl9cddnld5gq63vadc9pgb18m3r9mg9z-vimplugin-fern-vim-2021-01-20/share/vim-plugins/fern-vim/autoload/fern/logger.vim, line 82', 'exception': 'Vim(let):E741: Value is locked: g:fern#logger#DEBUG'}

And this is the line it links to

let g:fern#logger#DEBUG = g:fern#DEBUG

Does not work with msys2 git

Git for windows is

>git rev-parse --show-toplevel
C:/home/develop/Cica

but with msys2, it shows

$ git rev-parse --show-toplevel
/home/<username>/develop/Cica

thus the plugin does not work on msys2

Allow hiding git ignored files/directories

I was wondering if it'd be in scope for this plugin to allow hiding gitignored files/directories. Toggle functionality similar to fern-action-hidden:toggle would be really nice to have. Say fern-git-status-action-ignored:toggle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.