Git的标签自动完成对于小型项目很有用,但是我正在使用两个使用git的大型项目,而这些项目比没有用的更糟糕。每当我键入,说git添加表单< tab>,git需要20秒或更多时间才能找到该文件(在本例中为,在这个时间段内,我不能在终端中执行任何其他操作。有没有办法关闭自动完成功能,或以某种方式使其更快?
它不是git自动完成文件名,它是你的shell。你在做例如时有相同的延迟吗? “cat forms< tab>”?



__git_files () { 
    _wanted files expl 'local files' _files     


I found many posts relating complaints about how painfully slow git
auto-completion can be in large repositories. There were various
suggested patches and suggestions to load the latest zsh. Maybe one
of those things would work, but all I really want is for it to
complete the names of branches and files as they are in the file
system. I did not find any suggestions on how to get this behavior so
I figured it out for myself. I thought I would share this for anyone
who might benefit from it. I just added the following to my .zshrc


Now I can run git commands and get near instant completion while still
getting file completion similar to what ls would provide.

转载注明原文:Git标签自动完成是无用的,可以关闭还是优化? - 代码日志