Giter Site home page Giter Site logo

nerdtree-git-plugin's Introduction

nerdtree-git-plugin

Github Action License: WTFPL GitHub contributors

A plugin of NERDTree showing git status flags.

The original project git-nerdtree will not be maintained any longer.

Imgur

Installation

Use your favorite package manager. Here is the example of using vim-plug

Plug 'preservim/nerdtree' |
            \ Plug 'Xuyuanp/nerdtree-git-plugin'

New project

Yanil: Another nerdtree like plugin for neovim(>= 0.5.0) only. I'm focusing on this project.

FAQ

Got error message like Error detected while processing function 177[2]..178[22]..181[7]..144[9]..142[36]..238[4]..NERDTreeGitStatusRefreshListener[2]..NERDTreeGitStatusRefresh: line 6: E484: Can't open file /tmp/vZEZ6gM/1 while nerdtree opening in fish, how to resolve this problem?

This was because that vim couldn't execute system function in fish. Add set shell=sh in your vimrc.

This issue has been fixed.

How to config custom symbols?

Use this variable to change symbols.

let g:NERDTreeGitStatusIndicatorMapCustom = {
                \ 'Modified'  :'',
                \ 'Staged'    :'',
                \ 'Untracked' :'',
                \ 'Renamed'   :'',
                \ 'Unmerged'  :'',
                \ 'Deleted'   :'',
                \ 'Dirty'     :'',
                \ 'Ignored'   :'',
                \ 'Clean'     :'✔︎',
                \ 'Unknown'   :'?',
                \ }

There is a predefined map used nerdfonts, to enable it

let g:NERDTreeGitStatusUseNerdFonts = 1 " you should install nerdfonts by yourself. default: 0

How to show ignored status?

let g:NERDTreeGitStatusShowIgnored = 1 " a heavy feature may cost much more time. default: 0

How to cooperate with vim-devicons

Plug 'preservim/nerdtree' |
            \ Plug 'Xuyuanp/nerdtree-git-plugin' |
            \ Plug 'ryanoasis/vim-devicons'

Make sure they are in the right order.

How to indicate every single untracked file under an untracked dir?

let g:NERDTreeGitStatusUntrackedFilesMode = 'all' " a heavy feature too. default: normal

How to set git executable file path?

let g:NERDTreeGitStatusGitBinPath = '/your/file/path' " default: git (auto find in path)

How to show Clean indicator?

let g:NERDTreeGitStatusShowClean = 1 " default: 0

How to hide the boring brackets([ ])?

let g:NERDTreeGitStatusConcealBrackets = 1 " default: 0

NOTICE: DO NOT enable this feature if you have also installed vim-devicons.

Shameless Self Promotion

Yanil: Yet Another Nerdtree In Lua

Credits

nerdtree-git-plugin's People

Contributors

afonsocarlos avatar airblade avatar aldlevine avatar balogic avatar ebardiect avatar eyalz800 avatar feddischson avatar hydawn avatar inebritov avatar jackliu91 avatar jazmit avatar kcuzner avatar martinhj avatar n10v avatar oscarm3615 avatar pdx91 avatar pickrelated avatar pirey avatar robinfehr avatar runoshun avatar scrooloose avatar skinner33 avatar taqenoqo avatar wabri avatar xuyuanp avatar yonderbread avatar yzzy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nerdtree-git-plugin's Issues

The plugin doesn't work for me

I followed the installation instruction ( I use Vundle as my vim plugin-repositories management tool), and after installing the NERDTree and nerdtree-git-plugin, when I use :NERDTreeToggle to show the tree, the NERDTree functions well, but I cannot see the git icon on my local git repository. Do I miss some instruction in my .vimrc file ?

The related pieces of my .vimrc is as following:

call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'lsdr/monokai'
call vundle#end()

Other vcs support

What about adding another vcs? Is it possible to add mercurial? hg status output is similar to git status -s.

Does not work with git worktrees

Since a git worktree does not have a .git subdirectory, but instead .git is a text file stating where the .git directory actually is located, this plug-in doesn't work for worktrees.

It would be very awesome for it to support worktrees as well, and I would be happy to help with development in my spare time if you can point me to an area of the code that deals with that.

Doesn't work if vim's current working path is not under Nerdtree root path

Hello,

After applying commit 18d52b5, this plugin doesn't work if vim's current working path is not under Nerdtree root path which is under a git repo.

Try running command "git -c color.status=false status -s /path/under/a/git/repo" outside the repo, git gives "fatal: Not a git repository (or any of the parent directories): .git"

Indicator for ignored paths

An indicator for ignored paths would be nice - given #15 lands this could be used to show the ignored paths in recessed colors.

How to set NERDTree

How I set NERDTree to start at the same time of vim from .vimrc?

And what is yout color scheme?

Filemode changes cause incorrect GIT indicators

Awesome vim plugin, thanks very much.

I've updated the file mode on a entire project folder and then I used the git config tool to ignore file mode changes.

git config core.fileMode false

Now when I run git status it shows what I expected as a result....
screen shot 2015-08-19 at 10 50 42 am

But when I open up vim, it shows the '*' next to all of my files...
screen shot 2015-08-19 at 10 51 03 am

I don't think this is what I should be seeing. Please let me know if I'm doing something wrong, otherwise maybe its a bug.

VimL syntax incompatibility?

When i'm attempting to :NERDTree immediately after :w this error occurs:

Error detected while processing function <SNR>53_FileUpdate..243..124..314:
line    4:
E884: Function name cannot contain a colon: {listener}(event)

Vim 7.4

automatic refresh to nerdtree

If there is any way to refresh nerdtree automatically
for example after saving the file or when toggling nerdtree

I'm using neovim

Error on save

I'm getting this error on save:

Error detected while processing function <SNR>105_FileUpdate:                                                                                                                                                                                                                   
line    4:                                                                                                                                                                                                                                                                      
E716: Key not present in Dictionary: IsOpen()                                                                                                                                                                                                                                   
E15: Invalid expression: !g:NERDTree.IsOpen()                                                                                                                                                                                                                                   
line   10:                                                                                                                                                                                                                                                                      
E716: Key not present in Dictionary: CursorToTreeWin                                                                                                                                                                                                                            
line   11:                                                                                                                                                                                                                                                                      
E121: Undefined variable: b:NERDTreeRoot                                                                                                                                                                                                                                        
E15: Invalid expression: b:NERDTreeRoot.findNode(g:NERDTreePath.New(a:fname))                                                                                                                                                                                                   
line   12:                                                                                                                                                                                                                                                                      
E121: Undefined variable: node                                                                                                                                                                                                                                                  
E15: Invalid expression: node == {}                                                                                                                                                                                                                                             
line   15:                                                                                                                                                                                                                                                                      
E121: Undefined variable: node                                                                                                                                                                                                                                                  
line   16:                                                                                                                                                                                                                                                                      
E121: Undefined variable: node                                                                                                                                                                                                                                                  
E15: Invalid expression: node.parent                                                                                                                                                                                                                                            
line   17:                                                                                                                                                                                                                                                                      
E121: Undefined variable: node                                                                                                                                                                                                                                                  
E116: Invalid arguments for function empty(node)                                                                                                                                                                                                                                
E15: Invalid expression: !empty(node)                                                                                                                                                                                                                                           
Error detected while processing function <SNR>105_FileUpdate..NERDTreeRender..nerdtree#renderView:                                                                                                                                                                              
line    1:                                                                                                                                                                                                                                                                      
E121: Undefined variable: b:NERDTree     

Please let me know what other information you might need to help?

Documentation

Please write something in the readme about the keys to use while in nerd tree to stage/unstage/etc.

Not working for CentOS 6.7

I am on CentOS 6.7. Installed vim7.4, nerdtree but this plugin doesn't work.

  1. do we support CentOS 6.7?
  2. is there any log file available to see the plugin error? Or is there any command to view the plugin settings?

Thanks,
Jeffery

No indicators

Environment

OS: Ubuntu 16.04.1
Vim Version: 7.4

Plugins

Vundle
NerdTree
NerdTree-Git-Plugin
Vim-Airline
Vim-Markdown
Syntastic

.vimrc

.vimrc gist

ISSUE

Unable to show indicators. I have tried moving items in the .vimrc around as well as opening files in GVim, vi and vim. I have also tried having NERDTree open when opening a file and not having it open. In a nutshell, I'm not able to get it to work. At this point, there isn't anything that I can think of to try differently. There may be something simple that I'm not doing but I can't figure it out.

Works only with sudo

I install this plugin by "junegunn/vim-plug". Then I run vim in my project folder:
gitgutter

There is no changes. But when I copy .vimrc to /root folder (and install plugins there) after executing "sudo vim" plugin works:
sudo

My system is debian 8 x64. Folder .vim/ is readable and writable by user. You can see my .vimrc here: https://github.com/inebritov/dotfiles/blob/master/.vimrc

Not working for subdirectories

I thinks thats more an feature request than a bug. Git status it is only run in the root directory, but in my projects i have multiple repos in subdirectories and changes there are therefor not highlighted.

Doesn't work with fish shell

Hello,

When using the fish shell, opening vim gives the following:

NERDTree: Please wait, caching a large dir ...
Error detected while processing function 206[2]..207[27]..210[7]..173[9]..171[32]..284[4]..NERDTreeGitStatusRefreshListener[2]..NERDTreeGitStatusRefresh:
line   13:
E484: Can't open file /var/folders/1h/q9nt7m6d2fs61_v177kq1_h00000gn/T/v6F4rWd/6
Press ENTER or type command to continue
Error detected while processing function 206[2]..207[27]..210[7]..173:
line    9:
E171: Missing :endif
Press ENTER or type command to continue

Surrounding [] not shown in tmux

I don't know whether your [ and ] are special UTF-8 characters or whatever, but these characters are not printed in tmux for me. Would be nice to be fixed.

Also, if I have

let g:NERDTreeIndicatorMapCustom = {
    \ "Modified"  : "mod",
"...
}

thinks like some/path/some/bla/mod.rs are highlighted, which is clearly not what we want here, right? Would be nice if you'd fix these!

Anyways: Great plugin, just started using nerdtree and already in love with this plugin!

Conflicted with syntastic in MacVim.

After installed this plugin, syntastic no longer auto check after I executed :w, but manual call :SyntasticCheck still works fine.

I tested with the same .vimrc in terminal vim and this problem disappeared, so it only happen in MacVim.

Has there more details I should provide?

vim become very slow

I think it's very useful,
but when I use it, vim will become very slow,
I use vim --startuptime to test the startup time and found that the BufEnter autocommands time will become very large.

Usage documentation

Hi,

I've installed nerdtree + nerdtree-git-plugin with Vundle.
When I open nerdtree in a git directory and make changes in a file, nothing happend.
Where do I go from here ?

P.S: What are your other plugins in the README.md gif ? powerline + some kind of git commit plugin ?

Not works when CD

Hi. This plugin works only when I add
cd directrory_with_git
to my vimrc file.
But I work not only with 1 directory and when I change directory in NERDtree to another project with git (press cd and then C to enter), then there are no indicators near files and directories.

Filter untouched files

I want to know your opinion about this feature, since you travel the way from fork NERDTree to become a plugin

I have proposed this to NERDTree

preservim/nerdtree#441

I think it is a missing feature to your plugin and really useful

Vim . causes quite a few errors - OSX Terminal

As long as I'm just opening a file "vim index.html" or even just vim, everything works great. Once I try to open a directory "vim .", a number of errors appear.

Easy workaround is just don't open with vim . I'll have to look at getting used to that.

screen shot 2014-12-13 at 1 53 00 pm

Breaks if you open a directory with `vim .`

Steps to reproduce,

  1. install nerdtree and nredtree-git
  2. cd to project directory
  3. type vim .

1st Nerdtree window (where you would expect to see the directory listing as usual) is empty. It appears in the main window though (as usual without nerdtree-git)

Output:
"." is a directory
Error detected while processing function 176..177..180..143..141..223..NERDTreeGitStatusRefreshListener..NERDTreeGetGitStatusPrefix:
line 16:
E121: Undefined variable: b:NERDTreeCachedGitFileStatus

Undefined variable: g:NERDTreePathNotifier

Trying to run nerdtree-git-plugin on the following vim version (Ubuntu 14.04):

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan  2 2014 19:39:59)
Included patches: 1-52

My config is now nearly empty, I only load pathogen to load nerdtree (the only installed vim-plugin at this point):

execute pathogen#infect()

The error I get is the following, and it doesn't happen if I don't have git_status.vim in the nerdtree_plugin directory:

Error detected while processing function <SNR>23_SetupListeners:
line    1:
E121: Undefined variable: g:NERDTreePathNotifier
line    2:
E121: Undefined variable: g:NERDTreePathNotifier
line    3:
E121: Undefined variable: g:NERDTreePathNotifier

Thanks for taking the time!

git mv support

Feature request for NERDTree move to use git mv instead of reporting that the original file was deleted and a new one added.

Error when open nerdtree

When I open nerdtree with this plugin it`s return errors, shown below

Error detected while processing function
177[2]..178[22]..181[7]..144[9]..142[36]..238[4]..NERDTreeGitStatusRefreshListener[2]..NERDTreeGitStatusRefresh:
line 6:
E484: Can't open file /tmp/vZEZ6gM/1

I install this plugins using pathogen and last fresh version from github.
Arch linux x64

I found problem.

I use fish instead of bash and when I add

if &shell =~# 'fish$'
    set shell=sh
endif

into my .vimrc, everything works fine

Add "--ignore-submodules" to the git-status query

I have a few submodules in my .vimrc directory that make my git-status query quite slow so I aliased them to include --ignore-submodules.

The nerdtree-git-plugin queries the git directory without the ignore parameter, which makes my NERDTree extremely unresponsive. Doing this to line 76 fixed it for me:

let l:statusesStr = system('cd ' . l:root . ' && git -c color.status=false status -s --ignore-submodules')

Is this safe to include into the repo? :) The plugin only uses git-status to query the information about the current directory anyways, doesn't it?

.vimrc customizable indicators?

My font of choice doesn't have all the Unicode indicators this plugin uses by default. I tried adding let g:NERDTreeIndicatorMap.Untracked = "*" to the bottom of my .vimrc, but then I get E121: Undefined variable: g:NERDTreeIndicatorMap.

How does this plugin play with fugitive?

I noticed that after I add file via status message + '-' I need to write the file to see status updated in nerdtree. Is that a design or am I doing something wrong?

Thanks

Plugin not work on vundle install

Plugin crush nerdtree plugin

simplified .vimrc

set nocompatible                " choose no compatibility with legacy vi
filetype off                    " For plugins
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
call vundle#end()

full .vimrc
https://gist.github.com/gunlinux/e9090fc89f9601b608ac

start error log

Error detected while processing function <SNR>31_NERDTreeGitStatusKeyMapping:
line    2:
E117: Unknown function: g:NERDTreeAddKeyMap
line    3:
E117: Unknown function: g:NERDTreeAddKeyMap

nerdtree run error log

Error detected while processing function 194..195..180..183..146..144..240..NERDTreeGitStatusRefreshListener..g:NERDTreeGetGitStatusPrefix:
E117: Unknown function: g:nerdtree#runningWindows
E15: Invalid expression: g:nerdtree#runningWindows()
Error detected while processing function 194..195..180..183..146:
E171: Missing :endif
Error detected while processing function 194..195:
E171: Missing :endif
rm -rf ~/.vim
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim
:PluginInstall

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.