vim-fugitive

Diff of current and previous version using vim-fugitive

喜你入骨 提交于 2019-12-21 03:17:17
问题 I know that :Glog will populate the quickfix list with all the versions of the file in the current buffer and that I can hit <enter> on these to see the file at that particular version, but is there an easy way to see the diff of a particular version with the previous version (to easily see what has changed)? EDIT: What I'm after is seeing each of these changes in a vertical diff in vim: git log -p -- path/to/file.txt . 回答1: This is what I use: :Gdiff [revision] See :help Gdiff for other

Leave Diff view with Fugitive

本秂侑毒 提交于 2019-12-13 13:49:32
问题 With vim-fugitive, is there an easy way to "unsplit" and :Gedit (return to the current object in the working tree)? E.g. when in Gcommit / Gstatus buffers, you would press D to enter side-by-side diff. Now, pressing ZZ would just leave me with a single editor, viewing the fugitive:// side... To get back to single editor (with the working-tree version I have to do ZZ :Gedit Enter (or ZZZZ to close both sides). I'd like to have something like gq as documented under Gblame : q close blame and

GCommit doesn't work with fugitive.vim under windows xp?

穿精又带淫゛_ 提交于 2019-12-12 16:41:08
问题 I've just discovered fugitive.vim, which is pretty cool. However, I've run into a problem (this is using windows xp, msys git 1.7, fugitive.vim 1.1, and gvim 7.2). Adding files to the index and checking the status works just fine, but when I do a :GCommit , a command prompt flashes for a second and nothing happens. No way to type a commit message and nothing is committed. Is this a bug? Am I doing something wrong? 回答1: It looks like issue 428 of msysgit. (From issue 467) Reported by

Vim Fugitive: Gblame reblame options

喜欢而已 提交于 2019-12-12 08:51:16
问题 I've been using Fugitive's Gblame recently but don't quite understand what "reblame" does. Can someone describe a little more clearly what these options do: - reblame at commit ~ reblame at [count]th first grandparent P reblame at [count]th parent (like HEAD^[count]) 回答1: Think of reblame as navigating to a commit and then running blame on your file or git blame <commit> -- <file> - the simplest case. Use the commit in question under your cursor and reblame the file. ~ Is equivalent to

How do you exit vimdiff mode in vim, specifically, for Fugitive?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 07:37:48
问题 I am using vim with the fugitive extension. It has a :Gdiff command which brings you into vimdiff mode, but what is the right/quick way to close/quit vimdiff mode? I.e., let's say I am editing the file FooBar.txt under Git repository. I fire up :Gdiff, review my changes in vimdiff, and then I want to get back and continue editing FooBar.txt or any other file :) UPDATE1: I'm going to give these quick combos a try next working day :) "vimdiff current vs git head (fugitive extension) nnoremap

Vim Fugitive: Gblame reblame options

a 夏天 提交于 2019-12-04 06:23:23
I've been using Fugitive's Gblame recently but don't quite understand what "reblame" does. Can someone describe a little more clearly what these options do: - reblame at commit ~ reblame at [count]th first grandparent P reblame at [count]th parent (like HEAD^[count]) Think of reblame as navigating to a commit and then running blame on your file or git blame <commit> -- <file> - the simplest case. Use the commit in question under your cursor and reblame the file. ~ Is equivalent to running git blame <rev>~[count] -- <file> P Is equivalent to running git blame <rev>^[count] -- <file> For the

Diff of current and previous version using vim-fugitive

£可爱£侵袭症+ 提交于 2019-12-03 09:58:43
I know that :Glog will populate the quickfix list with all the versions of the file in the current buffer and that I can hit <enter> on these to see the file at that particular version, but is there an easy way to see the diff of a particular version with the previous version (to easily see what has changed)? EDIT: What I'm after is seeing each of these changes in a vertical diff in vim: git log -p -- path/to/file.txt . This is what I use: :Gdiff [revision] See :help Gdiff for other options as well (vertical vs horizontal splits, etc). For example: :Gdiff HEAD or if you have a revision number

Getting 'git grep' to work effectively in vim

非 Y 不嫁゛ 提交于 2019-12-01 16:19:49
Fugitive.vim allows me to run git grep commands; unfortunately, the results are not stored in a quickfix-list, so I need to run :cw after a :Ggrep in order to have an easily parseable result list. I would like to type :Ggr "def my_function" instead of: :Ggrep "def my_function" :cw How can I define this :Ggr command in my .vimrc file? EDIT Once the :Ggr command is defined, I can map to git grep on the word under the cursor, which is really awesome: nnoremap <C-F> :Ggr <cword><CR> This works for me: :command -nargs=+ Ggr execute 'silent Ggrep!' <q-args> | cw | redraw! You can use the <args>

Show base in fugitive.vim conflict diff

核能气质少年 提交于 2019-12-01 05:30:38
By default if you use fugitive.vim 's :Gdiff on a file buffer which is in conflict with git, you will get a three way diff showing HEAD , the working copy (with conflict markers), and the merge . I like to have git config merge.conflictstyle diff3 set, which includes the base (most recent common ancestor of HEAD and merge in the conflict markers. Unfortunately even with diff3 as the conflictstyle in fugitive.vim you still only get 3 panes (no base). Does anyone know how to make show it in another pane? Ideally about the working copy. This comment from Tim Pope seems to provide some clue, but I

Show base in fugitive.vim conflict diff

为君一笑 提交于 2019-12-01 02:20:53
问题 By default if you use fugitive.vim's :Gdiff on a file buffer which is in conflict with git, you will get a three way diff showing HEAD , the working copy (with conflict markers), and the merge . I like to have git config merge.conflictstyle diff3 set, which includes the base (most recent common ancestor of HEAD and merge in the conflict markers. Unfortunately even with diff3 as the conflictstyle in fugitive.vim you still only get 3 panes (no base). Does anyone know how to make show it in