Coder Social home page Coder Social logo

airblade / vim-gitgutter Goto Github PK

View Code? Open in Web Editor NEW
8.3K 70.0 297.0 1.35 MB

A Vim plugin which shows git diff markers in the sign column and stages/previews/undoes hunks and partial hunks.

License: MIT License

Shell 0.36% Vim Script 99.64%
vim git neovim gitgutter diff

vim-gitgutter's People

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  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

vim-gitgutter's Issues

No signs are visible

I just installed plugin, opened file in Git repo and editted it a little bit. I don't see any pluses, minuses or whatever. If I simply execute git diff, I can see teh changes. Syntastic do work too! There is no conf or anything for this plugin too, but plugin is installed because I can access those provided commands.

Any ideas?:(

Errors thrown when returning to an empty buffer

Here's how I found this bug:

  1. Open a new tab (no actual file opened here yet)
  2. Switch applications
  3. Come back to Vim
  4. Below errors are thrown:
Error detected while processing function GitGutterAll..GitGutter..<SNR>17_clear_signs:
line    3:
E158: Invalid buffer name: /Users/richtaur/dev/lost_decade/turkey12/
Press ENTER or type command to continue
Error detected while processing function GitGutterAll..GitGutter..<SNR>17_clear_signs:

FYI using MacVim 7.3 (65).

Thanks! Loving this plugin :-)

Add 'count' option to next/prev hunk command

Congrats first, awesome work! I thought a week a ago how cool would it be to see the changed lines 👍

My Feature Request/Question:
I added some mappings to easily jump between hunks:

map ]h   :GitGutterNextHunk<CR>
map [h   :GitGutterPrevHunk<CR>

Is it possible to add 'count' to this? So I can jump 3 hunks down by pressing 3]h?

Re-check files after gaining focus

If I modify a file and write it, I see the signs in the sign column. Then, if I tab out, commit, and tab back in to Vim, they are still there. I have to write again to get them to correctly disappear. I think they should disappear automatically, optimally once the commit is registered, but more likely when you give focus to Vim again. Does this sound feasible?

Way to turn it off and on

Just thought it would be nice. Because I don't use this feature until I'm ready to commit, and it's just to know what to put in the commit message and details.

If you could implement this I would be grateful. 😄

Integration with Syntastic

I'm testing this plugin and I think it's awesome!

Years ago I used to use Netbeans and it shows this kind of diff. I've tested some options for vim, but not sucessfully... And this one just works, congratulations!

But I'm also using https://github.com/scrooloose/syntastic and vim-gitgutter overwrites syntastic signs.

Which git

Would it be possible to add an option to define which git executable to use?

Vim doesn't use $PATH from my zshrc or bash_profile so it's using an old version.

Maybe something like

let g:gitgutter_git_binary = "/usr/local/bin/git"

I need to use the homebrew git and I'd rather not hack the plugin :)

No signs column.

ret

echo g:gitgutter_enabled 1
echo &shell /bin/bash

set nocompatible                  " Must come first because it changes other options.

silent! call pathogen#runtime_append_all_bundles()
silent! call pathogen#helptags()

syntax enable                     " Turn on syntax highlighting.
filetype plugin indent on         " Turn on file type detection.

set nocompatible
set encoding=utf-8
set fileencodings=utf-8,latin2
set autowrite

set softtabstop=2
set shiftwidth=2
set tabstop=2
set expandtab
set sta " a <Tab> in an indent inserts 'shiftwidth' spaces

set ai " Automatically set the indent of a new line (local to buffer)
set si " smartindent  (local to buffer)

set hlsearch    " highlight search
set incsearch   " incremental search, search as you type
set ignorecase  " Ignore case when searching 
set smartcase   " Ignore case when searching lowercase

set t_Co=256

set showcmd
set ch=2

set nowrap
set linebreak  " Wrap at word

autocmd BufEnter * lcd %:p:h

au BufRead,BufNewFile,BufFilePost *.json,*.js set filetype=javascript
au BufRead,BufNewFile,BufFilePost *.coffee    set filetype=coffee
au BufRead,BufNewFile,BufFilePost *.less      set filetype=less

autocmd FileType html set filetype=xhtml
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType c set omnifunc=ccomplete#Complete
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete

set backspace=indent,eol,start
set number
set ruler
set matchpairs+=<:>

highlight NonText guifg=#e5e5e5
highlight SpecialKey guifg=#e5e5e5

if has("autocmd")
  autocmd bufwritepost .vimrc source $MYVIMRC
endif

highlight clear SignColumn

I had tried also with

set nocompatible                  " Must come first because it changes other options.

silent! call pathogen#runtime_append_all_bundles()
silent! call pathogen#helptags()

syntax enable                     " Turn on syntax highlighting.
#~ $ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26 2012 16:45:16)
#~ $ git --version
git version 1.7.10.4

I have no idea what is wrong...

Plugin error on start when user's default shell is set to /bin/tcsh

After installation, editing a file under version control will result in the following error message:

Error detected while processing function GitGutter..<SNR>21_is_active..<SNR>21_is_in_a_git_repo:
line    2:
E484: Can't open file /var/folders/16/9vmrqw0n1pq9g2gqg9bb60_80000gn/T/vjiD4SE/1

how I debugged issue not knowing vimscript
I narrowed it down by examining the shell commands by added the following line to the function s:command_in_directory_of_current_file after line 85

    echo a:cmd

It showed that the following command was raising the error

git rev-parse > /dev/null 2>&1

I figured the problem was that my shell was set to tcsh, which was probably not tested. Sure enough, the following command reported /bin/tcsh.

:set shell

A simple work around is to simply set the default shell that VIM should use by adding this line to your .vimrc

set shell=/bin/sh

Suggestions for a proper bug fix

I would submit a pull request, but I've never tinkered with vimscript before. But one of these options might work:

  • set the shell variable inside the plugin
  • change the way you are redirecting stdout and stderr to work on tcsh

Suggestions for me:

  • change to zsh

Display change sign on new line

$mkdir gitgutter-test
$cd gitgutter-test
$git init
$cat test.txt
this is
a
test
file

then modify test.txt with:

  1. change line2 a to b
  2. add new empty line to b

then it display ~ on new empty line.
QQ 20130304151449

Allow user to define diff cmd args

It might be nice to pass args such as --ignore-space-change. I suppose this could either be raw args to pass on, or specific options that get interpreted into command line args to customize the behavior of the diff cmd.

Make column an optional feature

I'm not quite sure if I'm just overlooking an option to do what I want :). But personally I'd prefer to use let g:gitgutter_highlight_lines = 1 instead of using the column. Would it be possible to make the column an optional feature?

All lines are highlighted.

Great plugin.

On my work machine all lines of (it seems) all files in a git repository have the green '+' symbol. It worked fine on my home machine.

Details: Ubuntu 10.04, not sure what else is relevant, my home directory is exported from /export

I have looked in the source and running the command you use to get the diff "git show HEAD:file.py | diff - file.py" manually gives the correct output.

Error thrown when saving to a network path on Windows

Following error is thrown when you open/save a file on a network path on Windows 7 64-bit:

Error detected while processing function GitGutter..<SNR>60_is_active..<SNR>60_is_in_a_git_repo:
line 2:
E484: Can't open file C:\Users\ljani\AppData\Local\Temp\VIoEE6D.tmp

Steps to reproduce:

  1. Navigate to \localhost\c$ or \othercomputer\somefolder\
  2. Create file test.txt
  3. The error is first displayed when you open the file
  4. Do :w and the error is shown again

Toggle update signs across all buffers on FocusGained.

With a number of buffers open (7) even in a moderate sized git repository (1000 commits) on a relatively fast system (SSD), vim has a noticeable pause (15 seconds) while all the buffers get updated when clicking on gvim.

Is it possible to make update across all buffers on focus a configurable option?

Customize sign characters

It would be nice to have an option to customize the signs.

I've found the signs for deleted lines on https://github.com/akiomik/git-gutter-vim more appropriate, but vim-gitgutter has nicer features. :)

The current delete sign makes me think that the modification is in a different line, git-gutter-vim solves this by marking one line before and after the deletion.

I think the sign definition is here:
https://github.com/akiomik/git-gutter-vim/blob/master/autoload/gitgutter.vim#L36

Undefined s:sign_ids variable.

Hi.

I have problem. I have up-to-date version from git. After ToggleGitGutter i'm getting:

An error was detected while processing function ToggleGitGutter..DisableGitGutter..<
SNR>12_clear_signs:
line    1:
E121: Undefined variable: s:sign_ids
E116: Too many arguments for function has_key(s:sign_ids, a:file_name)
E15: Improper expression: has_key(s:sign_ids, a:file_name)

Ofcourse i run toggle after EnableGitGutter. I have git version 1.7.10.4, pathogen version Version: 2.2

Slow performance with many buffers open

When I first open Vim and start using it, everything works fine. But after opening many buffers (like I always do), vim-gitgutter starts to take a noticeable amount of time. With a few tabs/splits open, there's only a quick flickering of the cursor as it goes from buffer to buffer, not much of a problem at all. But when it gets to around a dozen buffers or more, it can take 3-5 seconds and totally kills my productivity (I switch application tabs a lot).

Not sure what could be done about this. I do think that it appears to be calculating buffers that were opened previously but aren't currently open in a tab/window.

FYI I'm using MacVim 7.3 (65). Thanks!

don't use index

Hi,

I personally never use the git index, instead I use a tool to bypass the index when doing diffs etc.
As such I was a bit surprised when gitgutter showed me less changes than I made to the file. Turns out that the file got added to the index so half my changes became invisible to gitgutter.

I fixed this locally with the following change;
hunk plugin/gitgutter.vim 197

  • let cmd = 'git diff --no-ext-diff --no-color -U0 ' . g:gitgutter_diff_args . ' ' .
  • let cmd = 'git diff-index -M HEAD --no-ext-diff --no-color -U0 ' . g:gitgutter_diff_args . ' ' .

Maybe you want to apply this patch and make sure that other people don't get surprised like me :)

gitgutter disappears when quickfix window is open, with python-mode plugin

Hello, using python-mode plugin https://github.com/klen/python-mode if you have the quick fix window open, the gitgutter will disappear. If you reload the file it will be back, until you save (which refreshes the quickfix window).

Doing a :GitGutterToggle during this does nothing, and doing a :GitGutterEnable, gives:

Quickfix
Error detected while processing function GitGutterEnable:
line 2:
E119: Not enough arguments for function: GitGutter

Kind of "freeze" on Windows 7

I installed it the pathogen way.
But vim kept flickering, I couldn't type anything. After the plugin removed, vim works as before again.

So is Windows supported?

Git:
git version 1.8.1.msysgit.1

Gvim:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2010 17:59:02)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-46
Compiled by Bram@KIBAALE
Big version with GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +float +folding -footer +gettext/dyn -hangul_input
+iconv/dyn +insert_expand +jumplist +keymap +langmap +libcall +linebreak
+lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse
+mouseshape +multi_byte_ime/dyn +multi_lang -mzscheme +netbeans_intg +ole
-osfiletype +path_extra +perl/dyn +persistent_undo -postscript +printer
-profile +python/dyn +python3/dyn +quickfix +reltime +rightleft +ruby/dyn
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop
+syntax +tag_binary +tag_old_static -tag_any_white +tcl/dyn -tgetent
-termresponse +textobjects +title +toolbar +user_commands +vertsplit
+virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu
+windows +writebackup -xfontset -xim -xterm_save +xpm_w32
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME_vimrc"
2nd user vimrc file: "$VIM_vimrc"
user exrc file: "$HOME_exrc"
2nd user exrc file: "$VIM_exrc"
system gvimrc file: "$VIM\gvimrc"
user gvimrc file: "$HOME_gvimrc"
2nd user gvimrc file: "$VIM_gvimrc"
system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DFEAT_CSCOPE
-DFEAT_NETBEANS_INTG -DFEAT_XPM_W32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400
/Fo.\ObjGOLYHTR/ /Ox /GL -DNDEBUG /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME
-DFEAT_GUI_W32 -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL
-DDYNAMIC_TCL_DLL="tcl83.dll" -DDYNAMIC_TCL_VER="8.3" -DFEAT_PYTHON -DDYNAMIC_PYTHON
-DDYNAMIC_PYTHON_DLL="python27.dll" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3
-DDYNAMIC_PYTHON3_DLL="python31.dll" -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL="perl51
2.dll" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=191 -DDYNAMIC_RUBY_DLL="msvcrt-ruby191
.dll" -DFEAT_BIG /Fd.\ObjGOLYHTR/ /Zi
Linking: link /RELEASE /nologo /subsystem:windows /LTCG:STATUS oldnames.lib kernel32.lib advapi32.lib
shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib /machine:i386 /nodefaultlib gdi32.lib version.lib winspool.lib
comctl32.lib advapi32.lib shell32.lib /machine:i386 /nodefaultlib libcmt.lib oleaut32.lib user32.lib
/nodefaultlib:python27.lib /nodefaultlib:python31.lib e:\tcl\lib\tclstub83.lib WSock32.lib e:\xpm\lib\libXpm.lib
/PDB:gvim.pdb -debug

would love to see this working on Windows

Saving file de-colours Powerline

I have an interesting issue with vim-gitgutter and Powerline. When I load up vim with only vim-gitgutter everything works perfectly. When I load up vim with both vim-gitgutter and Powerline, when I save the file my vim status bar (and the vim-gitgutter signs) colours/format are lost. I am not sure why this is the case, but I've tried it in both vim and MacVim.

Pre-Save:
Screen Shot 2013-03-06 at 11 49 54 PM

Post-Save:
Screen Shot 2013-03-06 at 11 50 11 PM

Error when using the plugin

Error detected while processing function GitGutter..<SNR>18_parse_diff:
line    5:
E684: list index out of range: 1
E116: Invalid arguments for function str2nr(matches[1])
E15: Invalid expression: str2nr(matches[1])
line    6:
E684: list index out of range: 2
E15: Invalid expression: (matches[2] == '') ? 1 : str2nr(matches[2])
line    7:
E684: list index out of range: 3
E116: Invalid arguments for function str2nr(matches[3])
E15: Invalid expression: str2nr(matches[3])
line    8:
E684: list index out of range: 4
E15: Invalid expression: (matches[4] == '') ? 1 : str2nr(matches[4])
line    9:
E121: Undefined variable: from_line
E116: Invalid arguments for function add
line    5:
E684: list index out of range: 1
E116: Invalid arguments for function str2nr(matches[1])
E15: Invalid expression: str2nr(matches[1])
line    6:
E684: list index out of range: 2
E15: Invalid expression: (matches[2] == '') ? 1 : str2nr(matches[2])
line    7:
E684: list index out of range: 3
E116: Invalid arguments for function str2nr(matches[3])
E15: Invalid expression: str2nr(matches[3])
line    8:
E684: list index out of range: 4
E15: Invalid expression: (matches[4] == '') ? 1 : str2nr(matches[4])
line    9:
E121: Undefined variable: from_line
E116: Invalid arguments for function add

specify in README that it requires +signs support

Might be obvious, but it would be helpful to note in the README that the plugin will not work without +signs support (i.e. the vim distro on most if not all versions of OSX), with a suggestion to install MacVim.

Infinite spawning of vimruner and git on Windows

When opening a file and gaining focus to the gVim window, it starts to loop spawn vimruner.exe and git.exe processes.
Also the task manager shows a large number of corresponding conhost.exe processes.

Configuration:

  • Windows 7 x64 SP1
  • GVim 7.3-p744
  • Git-1.8.1.2-preview20130201
  • Pathogen (master)
  • Fugitive (master)

Error detected while processing function GitGutter..<SNR>58_init..<SNR>58_define_signs..<SNR>58_define_sign_line_highlights..Pl#Statusline:

Error detected while processing function GitGutter..58_init..58_define_signs..58_define_sign_line_highlights..Pl#Statusline:
line   18:
E684: list index out of range: 0
E15: Invalid expression: g:Pl#THEME[a:statusline].mode_statuslines[mode]
let g:syntastic_auto_loc_list=1
let g:syntastic_enable_balloons = 1
let g:syntastic_check_on_open=0
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 26 2013 13:43:09)
MacOS X (unix) version
Included patches: 1-266
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
+mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra -perl
 +persistent_undo +postscript +printer +profile +python -python3 +quickfix
+reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime
+statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white
-tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands
+vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore
+wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard
-xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/Cellar/vim/7.3.266/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX -no-cpp-precomp  -g -O2 -D_FORTIFY_SOURCE=1
Linking: cc   -L.     -L/usr/local/lib -o vim       -lm  -lncurses -liconv -framework Cocoa     -framework Python   -lruby -lobjc

signs column always there

Hey guys, just installed this after seeing a friend use it. It seems to work ok except for the fact that the signs column is always there from the moment I open file. If I alter and save the file it displays the additions and what not just fine, but even when there are no changes, it always shows the signs bar.

Why have the bar show up if there is nothing to display?

Not working

Using MacVim 7.3.754 installed via Homebrew on OSX 10.8.2

I was already using pathogen with all my plugins, cloned this repo but it just didn't do anything.

Is there any way to test if the plugin's actually loaded?

The other plugins I have installed are,

  • commentary
  • ctrlp
  • fugitive
  • golden-ratio
  • nerdtree
  • powerline
  • unimpaired

Signs disappear on write

Current Behavior:

When I first open a file I see the diff signs in the gutter. When I write my file with :w the gutter flickers on and off then stays off. I can reenable it with :GitGutterEnable.

Expected Behavior:

Diff signs stay visible after writing the file

I am using gvim on Windows XP.

Here is my vimrc if it can help diagnose the issue: http://pastebin.com/xF1MHhcW

I am also using the following plugins through pathogen:

  • python-mode
  • superman
  • vim-fugitive
  • vim-surround

Let me know if I can provide any more information to help diagnose this.

explain in README that this is for change-tracking, not diff-viewing

I was confused when I read the description in the README on the project page. I thought from the description that this project only applies when opening files that have been output from calling git diff. That is, I thought that when you open a file containing something like

@@ -1,5 +1,5 @@
 first
-seocnd
+second
 third

this plugin would just move the first column of each hunk to the left of the line numbers, to make it a bit easier to read the contents of the file.

After reading this comment tree on Hacker News, I realized that this plugin does something very different. It continually diffs the file you are working on with the file as it exists in the last commit, using git diff. It then shows those line-level changes in the sidebar.

So rather than just being a viewer for one type of file, this plugin helps you keep track of what work you’ve done in the current file since you’ve last committed. The README should make this clear.

Error when launching vim: GitGutter..Error detected while processing function GitGutter..<SNR>10_init..<SNR>10_define_signs:

Getting the following when trying to open a file tracked in git.

Error detected while processing function GitGutter..10_init..10_define_signs:
line 7:
E319: Sorry, the command is not available in this version: sign define GitGutterLineAdded text=+ texthl=lineAdded linehl=NONE
line 8:
E319: Sorry, the command is not available in this version: sign define GitGutterLineModified text=~ texthl=lineModified linehl=NONE
line 9:
E319: Sorry, the command is not available in this version: sign define GitGutterLineRemoved text=_ texthl=lineRemoved linehl=NONE
line 10:
E319: Sorry, the command is not available in this version: sign define GitGutterLineModifiedRemoved text=~_ texthl=lineModified linehl=NONE
Error detected while processing function GitGutter..10_find_other_signs:
line 2:

Disable on startup

Hi, great plugin!

I'd like to start Vim with Git Gutter disabled (and enable it by toggling it on). I add the following to my ~/.vimrc:

let s:gitgutter_enabled = 0

I start Vim, no errors. I toggle Git Gutter, and here's the error:

:call ToggleGitGutter()
Error detected while processing function ToggleGitGutter..DisableGitGutter..<SNR>28_clear_signs:                                                                                                                                              
line    1:                                                                                                                                                                                                                                    
E121: Undefined variable: s:sign_ids
E116: Invalid arguments for function has_key(s:sign_ids, a:file_name)
E15: Invalid expression: has_key(s:sign_ids, a:file_name)

Thoughts?

Slow buffer switch

Hi,

This plugin is awesome, thanks for making it!

Unfortunately it appears that it checks the git status every time the user changes buffer. For this reason changing splits is noticeably slowed down. I see the following alternatives solutions for this issue:

  1. load the diff only when a file is opened or saved
  2. load the diff asynchronously
  3. load the diff only when then file is saved
  4. cache the diff for each buffer

I'm not proficient with VimL so takes my suggestions with a grain of salt. I personally think that 1 or 2 (or a combination of both) would be ideal.

Keep the gutter always expanded

Is it possible to keep the GitGutter always expanded?

I noticed that it is collapsed (not shown) when the buffer has no changes.

I want my buffers to have the same width gutter on the left at all times.

characters to indicate removal immediately before change or addition

I propose these signs for wherever removal precedes addition or change:

±

The former could be yellow (green + red), the latter... cyan? These symbols could default to + and ~ for users who can't display the unicode versions, and maybe be allowed to show through a global var.

Add way to revert current line/hunk to HEAD

It would be very nice if there was 'u' like functionality in vim-gitgutter that would revert the current line and/or the current hunk back to HEAD, essentially undoing the working change for that hunk/line.

Errors using Italian language, disappear with LC_ALL="C"

I got these errors running latest GitGutter with my system set in the Italian language. Funny, these go away if I export LC_ALL="C", so I can't post them in English

--- Segni ---
Segni per include/const.h:
    linea=237 id=153, nome=GitGutterDummy

linea    8:
E684: indice lista fuori intervallo: 1
Errore/i eseguendo function GitGutter..<SNR>22_find_other_signs:
linea    8:
E116: Argomenti non validi per la funzione: str2nr(matches[1])
Errore/i eseguendo function GitGutter..<SNR>22_find_other_signs:
linea    8:
E15: Espressione non valida: str2nr(matches[1])
Errore/i eseguendo function GitGutter..<SNR>22_find_other_signs:
linea    9:
E121: Variabile non definita: line_number
Errore/i eseguendo function GitGutter..<SNR>22_find_other_signs:
linea    9:
E116: Argomenti non validi per la funzione: addPremi INVIO o un comando per proseguire

Translation:

Markers for include/const.h:
    line=237 id=153, nome=GitGutterDummy

line     8:
E684: list index out of range: 1
Errors executing function GitGutter..<SNR>22_find_other_signs:
line     8:
E116: Wrong arguments for function: str2nr(matches[1])
Errors executing function GitGutter..<SNR>22_find_other_signs:
line     8:
E15: Invalid expression: str2nr(matches[1])
Errors executing function GitGutter..<SNR>22_find_other_signs:
line     9:
E121: Undefined variable: line_number
Errors executing function GitGutter..<SNR>22_find_other_signs:
linea    9:
E116: Invalid arguments for function: add

conflict with system clipboard (set clipboard=unnamedplus)

After installing vim-gitgutter ( via http://vim.spf13.com/ ) I ran into a bug where copying into system clipboard (setting clipboard=unnamedplus) (Ubuntu 12.04) no longer worked. After debugging the problem I noticed that if I disable gitgutter, it works fine. The problem existed also with all other plugins disabled (in .vimrc.bundles) and only gitgutter enabled.

Although the selected text were not copied to system clipboard, it was copied to the register associated with system clipboard (the +-register).

My vim-gitgutter version:
commit 3f9cf5a
Date: Fri Mar 8 13:29:38 2013 +0100

Tested with vim 7.3 patches: 1-429,

Does not show changes for files outside current git directory

Say I have two git repositories, side by side:

~/repo-one
~/repo-two

If I cd into ~/repo-one then start editing any of its files with vim, the plugin works great (thanks by the way, I love it!).

If, while still inside the ~/repo-one directory I open a file that resides within the ~/repo-two directory, no changes are displayed. cd-ing into the ~/repo-two directory and opening said file from there works fine.

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.