This is really nice, but I wish the background color of the gutter would automatically match the rest of my background. The gray band [1] is pretty unappealing IMO.
Also noteworthy is that that the gutter only updates when the file is saved.
I've also got a similar plugin https://bitbucket.org/sirpengi/iwilldiffer that works with hg as well as git. Mine uses python though, nice to see an implementation that's all in viml. Neither of our plugins are async though (so vim ui will block while the diff is running), which is the biggest hurdle I want to cross.
Eclipse pretty much does this out of the box. I guess so do IntelliJ and Visual Studio. You can also display the name of the last person to change a line in the same position (ie. svn/git blame), which is very useful to quickly find out who to talk to regarding a section of a file. The commit message is displayed on mouseover.
Yes, IntelliJ handles this pretty nicely. For modified lines, you can mouse over to see what you changed. For all changes, you can click a context menu to revert any given change. (Of course, that does require touching a mouse... though I believe you can set up a key mapping for it.)
Is there any way to make it so that the gutter is always present? There's a bit of a noticeable jump to include it when I save a file, it's sort of annoying me.
probably not, the way vim works if there are no more signs attached to a document the gutter goes away. This isn't plugin related, it's just a manner of how vim works.
Although I suppose you can work around this by displaying a fake sign (color match gutter background?), but that has its downsides (depending on colorscheme, the sign can show up. and vim doesn't support whitespace characters for signs, at least not from what I can see).
I wish it could be made to stand on the right side of a vim buffer. This way it would still be present on demand but would not shift the whole buffer one column to the right.
Maybe because there are more vim users than sublime users on hn? FWIW i did see that story on front-page of hn and it's what prompted me to immediately write my vim-port. I finished it like a few days after that.
An aside question; what's the deal with "pathogen"?
I've been using the "/bin/cp" command for years installing vim plugins and it's worked remarkably well; requiring just about 1 invocation on average...
If you decide you no longer want a particular plugin, or want to upgrade it, it can be hard to tease out the files you /bin/cp'd into place. Adding a single folder under bundle makes removal easier later.
ETA: also note that git-cloning into bundle means that upgrading is just a question of entering the plugin directory and running git pull.
Each plugin resides in it's own directory, rather than being scattered around your .vim dir. Try to remove one of your installed plugins, you'll have to dig around and it'll be messy.
Also it makes it easier to update, since all you need to do is replace the folder with the newer version and you're all set.
To elaborate on the response others have offered about everything being in one folder, I'll further note that it allows you to keep track of the plugin through git, so you can very easily grab updates when desired.
It lets you put your various vim things inside a single 'bundle' directory instead of having files in plugin/ftplugin and whatnot. Very convenient and easy to setup.
I'm really impressed with this -- I would love to see this see functionality for other VCSes (subversion, etc) so that I could use it with my non-git projects. The vimscript looks pretty clean -- maybe I have a new weekend project ahead of me.
Any way to bind "toggle the gutter" so I can press my "set nonumber" button and have it toggle the gutter as well? [edit] Apparently I didn't read down far enough! This functionality exists already through the plugin. This works for me: nnoremap <F2> :set nonumber! <bar> ToggleGitGutter<CR>
I find it really useful in particular for working with Mercurial patch queues. I have a command in my .vimrc that will run ReversePatchReview on the topmost patch in my patch queue. It pops up a diff tab for each file that has changed. I can easily use "[c" and "]c" to jump between changes within each file.
This setup makes it incredibly easy to review the changes a patch makes, and it's so convenient that I often write quite a bit of my code inside these diff views. I don't think I could live without vim-patchreview when working with Mercurial.
Awesome work! Cheers airblade. One nitpicky thing though, why do you use "_" and not "-" for removed lines? Can't see why you wouldn't want it vertically centered!
[+] [-] jsulak|13 years ago|reply
[+] [-] fafner|13 years ago|reply
But sadly the Emacs mode calls git synchronously which can lead to a significant slow down when switching buffers. I hope that gets fixed.
[+] [-] shurcooL|13 years ago|reply
[+] [-] TwistedWeasel|13 years ago|reply
[+] [-] jaytaylor|13 years ago|reply
Also noteworthy is that that the gutter only updates when the file is saved.
[1] Screenshot: http://imgur.com/TIGKVRS
[+] [-] airblade|13 years ago|reply
I'll (I'm the author) probably make this the default because it seems quite a common wish.
[+] [-] graywh|13 years ago|reply
[+] [-] shuzchen|13 years ago|reply
[+] [-] airblade|13 years ago|reply
[+] [-] getoffmalawn|13 years ago|reply
[+] [-] morsch|13 years ago|reply
[+] [-] msluyter|13 years ago|reply
[+] [-] amadeus|13 years ago|reply
[+] [-] cr4zy|13 years ago|reply
[+] [-] ylaassel|13 years ago|reply
[+] [-] airblade|13 years ago|reply
[+] [-] soupboy|13 years ago|reply
[+] [-] bryanallen22|13 years ago|reply
[+] [-] krallin|13 years ago|reply
[+] [-] swah|13 years ago|reply
[+] [-] jisaacks|13 years ago|reply
[+] [-] ianbishop|13 years ago|reply
I tried
but that does seem to work.I'll have a poke through the source.
[+] [-] emilis_info|13 years ago|reply
http://superuser.com/questions/558876/how-can-i-make-the-sig...
[+] [-] shuzchen|13 years ago|reply
Although I suppose you can work around this by displaying a fake sign (color match gutter background?), but that has its downsides (depending on colorscheme, the sign can show up. and vim doesn't support whitespace characters for signs, at least not from what I can see).
[+] [-] lloeki|13 years ago|reply
[+] [-] jisaacks|13 years ago|reply
It just makes sense that someone would port it and become the #1 story.
[+] [-] shuzchen|13 years ago|reply
[+] [-] kristopolous|13 years ago|reply
I've been using the "/bin/cp" command for years installing vim plugins and it's worked remarkably well; requiring just about 1 invocation on average...
What problem does that thing solve?
[+] [-] MBlume|13 years ago|reply
ETA: also note that git-cloning into bundle means that upgrading is just a question of entering the plugin directory and running git pull.
[+] [-] agscala|13 years ago|reply
Also it makes it easier to update, since all you need to do is replace the folder with the newer version and you're all set.
[+] [-] lftl|13 years ago|reply
[+] [-] bostonvaulter2|13 years ago|reply
[+] [-] SeoxyS|13 years ago|reply
- removal - git submodules - conditional loading of plugins
[+] [-] unknown|13 years ago|reply
[deleted]
[+] [-] mercurial|13 years ago|reply
[+] [-] finnh|13 years ago|reply
Is this expected? I save quite frequently, it's an unconscious reflex at this point.
[+] [-] shuzchen|13 years ago|reply
[+] [-] jaytaylor|13 years ago|reply
[+] [-] jayroh|13 years ago|reply
[+] [-] prg318|13 years ago|reply
edit: just a quick hack for a "vim svn gutter": https://github.com/prg318/vim-gitgutter
The code is really clean and it would be fairly trivial to adopt this for use with any other VCS. Open source yay!
[+] [-] johncoltrane|13 years ago|reply
Both sign-diff (http://www.vim.org/scripts/script.php?script_id=2712) and changesPlugin (http://www.vim.org/scripts/script.php?script_id=3052) are VCS-agnostic: they show differences between the saved state and the current state.
[+] [-] methodin|13 years ago|reply
[+] [-] swift|13 years ago|reply
I find it really useful in particular for working with Mercurial patch queues. I have a command in my .vimrc that will run ReversePatchReview on the topmost patch in my patch queue. It pops up a diff tab for each file that has changed. I can easily use "[c" and "]c" to jump between changes within each file.
This setup makes it incredibly easy to review the changes a patch makes, and it's so convenient that I often write quite a bit of my code inside these diff views. I don't think I could live without vim-patchreview when working with Mercurial.
[+] [-] tpflug|13 years ago|reply
https://github.com/gilligan/textobj-gitgutter
[+] [-] bilalq|13 years ago|reply
[+] [-] airblade|13 years ago|reply
[+] [-] nXqd|13 years ago|reply
And there is more customisable as well
https://github.com/mhinz/vim-signify
[+] [-] purephase|13 years ago|reply
[+] [-] awef|13 years ago|reply
[+] [-] marcamillion|13 years ago|reply