Questions tagged [vim-fugitive]

Git integration for the Vim editor

A wrapper for Git that injects its functionality inside Vim, such as

  • View any blob, tree, commit, or tag in the repository
  • Bring up the output of git status
  • interactive vertical blame split
  • git mv on a file and simultaneously renames the buffer
  • grep exposure to search the work tree (or any arbitrary commit)
  • statusline integration
  • open the current file on GitHub

More at the github repository.

92 questions
1
vote
1 answer

Map Vim shortcut for Diffget

I'm mapping shortcuts for :diffget //2 and :diffget //3 and :Gwrite! to make merging easier. So far, on the Mac, I have: map :diffget //2 map :diffget //3 map :Gwrite! But unfortunately, they don't work. Any ideas?
Delos Chang
  • 1,823
  • 3
  • 27
  • 47
1
vote
1 answer

Toggling files in :Gstatus window by pressing - displays "Press ENTER or type command to continue" message

I tried everything I found here and here to get rid of the message to no avail. If I set cmdheight to >1 then it works for a few toggles and then displays the dreaded message again. (I could set cmdheight to e.g 3 to prevent this but the command…
Balint Erdi
  • 1,103
  • 2
  • 12
  • 20
0
votes
1 answer

How do I show the diff in a single window in fugitive.vim?

Best I can tell, all the diff commands in Fugitive open up a split window. Is there a way to just show the added/deleted/modified lines in a single window -- i.e., show the current file's changes (since the last commit, or, ideally, since an…
Sasgorilla
  • 2,403
  • 2
  • 29
  • 56
0
votes
2 answers

Retrieve git_main_branch in Neovim

So I have been getting very acquainted with Neovim/Spacevim lately, and it's freakin awesome! I am in the process of setting up some personal keybindings and commands and what have you, and am currently working on Git stuff. Coming from using VSCode…
Lushmoney
  • 412
  • 11
  • 26
0
votes
1 answer

Neovim Fugitive Merginal: Errors out when toggled on

Just installed Merginal (which is a addon to Fugitive) for Neovim and am getting this error when toggling the buffer (:Merginal): I have my git setup properly and am able to use all other features of Fugitive. Anyone run into this before? Thank…
Riza Khan
  • 2,712
  • 4
  • 18
  • 42
0
votes
2 answers

Make adjustment to previous commit without recreating commit

I used to use gitx to stage changes for commit, but I have switched to a purely terminal workflow + Fugitive.vim. One feature that I really miss from gitx though is the ability to make an adjustment in a previous commit. For example, if some section…
jnicklas
  • 2,155
  • 2
  • 16
  • 14
0
votes
1 answer

What is the shortcut to go to the parent directory when browsing a git tree with fugitive?

I am browsing the repository state with fugitive at a particular git commit, I am able to go only into the directory, but I don't know how to go back up to the parent directory. I end up looking this commit up again and start browsing from the…
Anton Daneyko
  • 6,528
  • 5
  • 31
  • 59
0
votes
1 answer

Auto close Gstatus window after Gcommit or open Gcommit in the same window

Is it possible to auto close the Gstatus window after Gcommit? I found some code, but I can't find out how to make it work. function! s:close_gstatus() for l:winnr in range(1, winnr('$')) if !empty(getwinvar(l:winnr, 'fugitive_status')) …
qwatros
  • 13
  • 2
0
votes
1 answer

nnoremap command with vim-fugitive

This question is inspired by Getting 'git grep' to work effectively in VIM. My .vim/vimrc entries are similar to those in the question: command -nargs=1 Ggr execute 'silent Git! grep -Win --heading' nnoremap :Ggr The Ggr…
davidvandebunte
  • 1,286
  • 18
  • 25
0
votes
2 answers

Checkout file from the commit using cnext

So I've been using vim fugitive plugin and I find the Glog and cnext feature great to see how the file has changed over time. I would like to checkout the file from the commit I've navigated to using the cnext command. Is it possible to do so?
sitilge
  • 3,687
  • 4
  • 30
  • 56
0
votes
0 answers

Vimdiff: Highlight current change in all buffers

I'm using Tim Pope's vim-fugitive plugin to integrate git features into Vim. When I run Gdiff on a conflicted file, it fires up vimdiff to resolve the conflict. The diff tool is great but I find it really hard to know at a glance which changes on…
sdeleon28
  • 329
  • 1
  • 11
0
votes
1 answer

Vimrc: combine commands with fugitive

I'm trying to combine :w :Gcommit -a -m "update" :Gpush to a new Command like :W – I've tried :command! W w | Gcommit -a -m "update" | Gpush But it doesn't work because he treats Gpush as a shell-command instead of a vim-command.
Nudin
  • 351
  • 2
  • 11
0
votes
1 answer

How do I :Ggrep ignoring case for a particular search?

Is there a way to do a one-off search using :Ggrep ignoring case? That is, what I'd do with git grep -i search_term in the shell? The standard :vimgrep suggest embedding the \c modifier into the search pattern but :Ggrep /\csearch_term/ did not…
kostix
  • 51,517
  • 14
  • 93
  • 176
0
votes
1 answer

Change color or add indicator on airline if I modified a file on git repository

I want to have an indicator if I modified a file and I don't create a commit. Any idea? I install fugitive and is very cool but I have only the name of the branch.
user3741098
0
votes
1 answer

having no output for Gstatus in vim-fugitive plugin for vim

I having a problem using fugitive-vim plugin, I have no idea what is Gdiff trying to show me, but not a diff for sure, but I can't even see a status. Im doing the same as in vimcast, and what common sence tell me to do - just enter Gstatus as a…
sandric
  • 2,310
  • 3
  • 21
  • 26