Skip to main content

Questions tagged [plugin-fugitive]

For questions pertaining to Time Pope's Git wrapper for Vim.

Filter by
Sorted by
Tagged with
0 votes
1 answer
72 views

Git status for the current working directory

As you know :G generally applies for the git directory of the current file. How do you make it work for the current working directory?
eyal karni's user avatar
  • 1,136
0 votes
0 answers
312 views

Making vim-fugitive compatible with file explorers

I have the vim-fugitive plugin and use :G a lot. If I have NERDTree as a plug or netrw enabled then :G will open either a NERDTree file or a netrw file instead of the usual fugitive file with the ...
hilbor's user avatar
  • 15
0 votes
1 answer
636 views

Opening files from vim-fugitive's :GcLog

When I'm in :GcLog how do I go to the source file? The documentation shows: <CR> Open the file or |fugitive-object| under the cursor. But, I've only been able to open up &...
Zach W's user avatar
  • 103
0 votes
1 answer
951 views

How to recover file changes discarded with fugitive_X in the fugitive summary buffer?

In the fugitive summary buffer, the powerful X command does as explained in :help fugitive_X: Discard the change under the cursor. This uses checkout or clean under the hood. A command is echoed ...
Paul Rougieux's user avatar
0 votes
2 answers
408 views

Create keybindings for a specific buffer(s)

I'd like to create keybindings that would only work in fugitive buffer, e.g. gp to run :G pull and gP to run :G push (frankly, it's kind of strange that there are no default shortcuts for this in ...
xaxa's user avatar
  • 177
5 votes
1 answer
653 views

How to toggle Fugitive status window

Fugitive provides a :Git commands that opens a window with basically the output of git status. To close it, I need to switch to that window and close it, which is tedious. How do I toggle this window?
henna's user avatar
  • 85
2 votes
2 answers
949 views

vim-fugitive: Netrw not found. Define your own :Browse to use :GBrowse

:GBrowse is giving Netrw not found. Define your own :Browse to use :GBrowse since netrw is disabled by telescope.nvim. I tried to define :Browse like this: :command! -nargs=1 Browse !open <args>...
RubenLaguna's user avatar
2 votes
0 answers
299 views

vim-fugitive support for diff --color-words

I use vim and git primarily for editing prose documents in LaTeX or Markdown, not for coding. For this reason, my go-to git diff command is git wdiff, where the relevant part of .gitconfig reads ...
Alex Roberts's user avatar
1 vote
0 answers
84 views

Textual diff for .pdf files -- How does fugitive accomplish such a feat?

In a fugitive :Gstatus buffer, I often press = on a filename. This toggles an inline diff, showing or hiding the changes made to that file. Interestingly, this also works on binary .pdf files, showing ...
husB's user avatar
  • 2,133
1 vote
0 answers
111 views

Any vim plugins to integrate git status for each file in file window explorer?

is there any vim plugins could show git status for each file in file window explorer? Please notice that I am not asking integrate git status in statusline, but in file explorer like nerdtree/defx, ...
linrongbin's user avatar
1 vote
0 answers
83 views

vim fugitive - stage all files matching pattern

I am trying to stage all files matching a pattern from the fugitive status window (:G). I tried something like :g/<pattern>/:normal s but for some reason, only the first matching file is staged. ...
Pierre's user avatar
  • 111
0 votes
0 answers
699 views

Review two branches

description I like the fugitive :Git to review uncommitted code. I would like to do same between branches + uncommitted code. Basically to locally review MR or PR. From fugitive there are :Gclog and :...
mickro's user avatar
  • 101
0 votes
1 answer
389 views

fatal: no such path 'A' in HEAD using fugitive plugin

I've my little vim distro with tpope/vim-fugitive installed. Using Git blame in little project (little means with few folders) works fine. Used with files with a deep tree of folders give me a bad ...
sensorario's user avatar
3 votes
3 answers
965 views

Call plugin-defined function in .vimrc

I use tpope/vim-fugitive and airblade/vim-gitgutter and I want to selectively enable gitgutter only in git repositories. Since vim-fugitive provides FugitiveIsGitDir which returns 0 or 1, this could ...
Alexandru Dinu's user avatar
1 vote
2 answers
321 views

How to refresh Nerdtree while switching the git branch

This question comes from here: https://github.com/tpope/vim-fugitive/issues/1586 In a word, I'm using the two plugins: Nerdtree and vim-fugitive. What I need is when I execute :Git checkout mybr, I ...
Yves's user avatar
  • 1,023
2 votes
0 answers
72 views

Unreadable characters in command section and Quickfix window [duplicate]

Good day! Do yo have any idea how to fix this issue? Please refer to the screenshot. I don't have the slightest clue why these characters are appearing. My vim-fugitive plugin was working fine before....
Oneb's user avatar
  • 21
0 votes
1 answer
1k views

Fugitive: jump from diff to the current version

When exploring a commit using :Gedit HEAD, when I click o or Enter into the change, it shows me a vimdiff of the two file versions of the change. From there I often need to jump to the current version ...
Vicente Bolea's user avatar
1 vote
1 answer
728 views

How to remap command based on buffer type?

I have coc.vim installed and added suggested mappings, then I installed vim-fugitive and I want to remap the "Toggle an inline diff of the file under the cursor." fugitive_= to Tab but the coc.vim is ...
zer09's user avatar
  • 239
0 votes
1 answer
660 views

Gbrowse not opening the browser

I've been using Vim Fugitive plugin for some time now. Recently, I tried the Vim rhubarb plugin. So for a github-repo it should work out of the box but `:GBrowse doesn't open the browser at all. ...
ankitj's user avatar
  • 101
10 votes
2 answers
2k views

How to break-up gutter fights?

There a number of types of plugins use the Vim gutter to display Git status, syntax correctness, linting and code formatting. But how can conflicts be managed when multiple plugins want to update the ...
Mark Stosberg's user avatar
4 votes
2 answers
2k views

I am running into problems while using Gpush command from vim-fugitive plugin

I have recently started using the vim-fugitive plugin, and currently I am facing problem with the Gpush command. I tried :Gpush % which gives me errors in the quick fix window saying fatal: ...
Imran Ali's user avatar
  • 171
2 votes
1 answer
177 views

fun with symlink and buffers

I have a funny problem. I have the following symlink in /Users/eyalkarni/ AKA ~ .vimrc -> /Users/eyalkarni/vimpy3/.vimrc vimpy3 is a git repository. I opened ~/.vimrc in neovim and now I can't ...
eyal karni's user avatar
  • 1,136
0 votes
2 answers
726 views

Is it possible to use vim-fugitive outside of the repository (in local mounted directory)

I have a git repository: ~/home/foo/repo I mounted core to another directory: mount --bind ~/home/foo/repo ~/home/bar Now I want to edit my code with vim and use vim-fugitive. vim ~/home/bar/myCode....
Kfir's user avatar
  • 11
1 vote
0 answers
180 views

Vim "Follows" Hard links

I have a git repository that contains my vimrc file and a couple of other utilities, called myvimrcgit. I then hard link my vimrc to ~/.vimrc, so that they point to the same inodes. Now, when I go to ...
SalmonKiller's user avatar
0 votes
1 answer
3k views

Vim Airline no GitBranch name [doing echo fugitive#head() shows correct branch]

I have Fugitive vim and Airline vim installed via Vundle. I installed them as follow: Plugin 'https://github.com/tpope/vim-fugitive.git' Plugin 'vim-airline/vim-airline' Airline status works fine. ...
mle0312's user avatar
  • 341
2 votes
1 answer
267 views

Retrieving failed fugitive commit message

I PGP sign my commit messages, and every once in a while GPG will fail for whatever reason (invalid cache, incorrect pin, etc), and my fugitive buffer will close, loosing all my changes. It doesn't ...
bronzehedwick's user avatar
0 votes
1 answer
62 views

Is it possible to non-recursively remap a command?

So Fugitive defines :Glog. This is, apparently, aliased to a call to the script-local s:Log() function (according to :command Glog.) My muscle-memory has been using glog at the command-line, for ...
ELLIOTTCABLE's user avatar
13 votes
1 answer
7k views

Getting "fugitive: No Gbrowse handler found"

When I run :Gbrowse from vim-fugitive, I get fugitive: No Gbrowse handler found for 'https://github.com/dbcli/mssql-cli' Can it just spool that out to xdg-open?
Evan Carroll's user avatar
  • 1,404
2 votes
1 answer
1k views

how to create a buffer like a fugitive temporary buffer

When we call :Gdiff on a file, fugitive will create a buffer with a name fugitive:///path/to/file/. The modifiable option is off and readonly option is on. Most importantly, the file does not exist on ...
doraemon's user avatar
  • 1,667
2 votes
1 answer
215 views

How to load commits in a certain date range with fugitive?

I am able to do git log --pretty=format:"%h" --after="2018-06-7" --until="2018-06-10", in the shell, but if I try to do it in vim with fugitive like this: :Glog --after="2018-6-7" --until="2018-06-10"...
Anton Daneyko's user avatar
1 vote
1 answer
564 views

How to get 50 char long warning color highlight in vim gitcommit message without fugitive

I'm using vim-fugitive. However, I'm using a black and white colorscheme. So, I don't see any warning for the 50 char long subject line of git commit message. I want to know how I can add a highlight ...
3N4N's user avatar
  • 5,774
3 votes
2 answers
3k views

How to open a split-diff for selected file out of the commit

Using Vim-fugitive plugin I open a commit with :Gedit HEAD~5 The buffer looks like this: tree a75d4eea2207e408db6343a4869274b701b42135 parent 7fa89fec125ce60a341f7c37dd769a8a31c49359 author ...
Boris Brodski's user avatar
0 votes
2 answers
3k views

neovim: how to close the terminal buffer by just pressing enter?

NVIM v0.2.2 Build type: Release LuaJIT 2.0.5 Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -...
quanta's user avatar
  • 131
21 votes
2 answers
5k views

How to patch add in Fugitive plugin?

This screen I got after running the :Gstatus command: Then I moved the cursor to init.vim file and pressed the p key, i.e. run git add –patch for the current file. Now I have this screen: As you can ...
megas's user avatar
  • 389
5 votes
3 answers
2k views

How do I go back when I view a certain git hash

I'm using the vim-fugitive plugin for git blame annotations. When I'm on a certain line, I type :Gblame and it shows me the git commits: When I click on a git commit hash, I go to it, how can go ...
abbood's user avatar
  • 743
1 vote
2 answers
838 views

QuickFixCmdPost autocommand after Glog

I run Glog! from fugitive to populate the quickfix window and set the following autocmd for QuickFixCmdPost (The following questions general and are not specific to Glog, I just use it as example) ...
doraemon's user avatar
  • 1,667
4 votes
1 answer
455 views

Fugitive Gbrowse while being ssh on a server

I work remotely via ssh on my dev machine which runs a tmux. I want to pipe the output of the Gbrowse back to my laptop. Is there any reasonable way to do that.
user1448118's user avatar
1 vote
0 answers
226 views

How fugitive-specific is the 'git' filetype?

When you run fugitive's :Gblame, it opens a buffer whose 'filetype' is fugitiveblame. You can hit q to close its window. You can also hit o to view the commit for the line your cursor is on in a ...
ivan's user avatar
  • 1,470
1 vote
1 answer
268 views

How to execute a command when leaving the 'fugitiveblame' window?

When executing :Gblame, it opens up a window for the blame information. When close that window with q, I want to execute wincmd = I've tried the following, they don't seem to work: autocmd BufLeave ...
synic's user avatar
  • 115
4 votes
1 answer
277 views

How can I make Neovim return to the tab that was active before running `:Git diff`?

How can I make Neovim automatically return to the tabpage that was active before running :Git diff %? Before I commit my work in git, I often run :Git diff to review changes (the :Git command is ...
nelstrom's user avatar
  • 289
3 votes
1 answer
481 views

How to always append parameters for a Ggrep command?

I'm using the Fugitive plugin. It has the :Ggrep command which is very useful for searching the repo. One annoying thing is that I have huge .map files and I want to omit them from my search. I ...
valk's user avatar
  • 143
36 votes
5 answers
18k views

Git Fugitive how to git add a visually selected chunk of code

I would like to know if i could select some code in visual mode and git add it ? I checked with fugitive.vim but i didn't find how to do it. Is it possible ? Or is there any other plugin to do it ?
albttx's user avatar
  • 1,195
2 votes
2 answers
332 views

Keep cursor in fugitive-:Gstatus window when view diffs/splits

I have tried to attach to following fugitive mapping: nnoremap <buffer> <silent> D :<C-U>execute <SID>StageDiff('Gdiff')<CR> a :h window-move-cursor mapping: diff --...
Hotschke's user avatar
  • 4,790
6 votes
2 answers
2k views

Make vim-fugitive care about the current working directory when a file is not being edited

Background: I am doing more and more stuff directly from inside Neovim, and less and less from the terminal or even the terminal emulator. So instead of going to the desired directory to work in, and ...
still_dreaming_1's user avatar
4 votes
1 answer
233 views

How do I get back to the current working copy while viewing git revisions?

When using :Glog or other git plugins like :GV (gitv?) and checking revisions or commit you end up in Read-Only mode viewing something like fugitive:///.git//300ed70aa473b7e8f983a2590c2af908cd0a0621/...
firedev's user avatar
  • 2,422
2 votes
1 answer
1k views

Changing value of $MYVIMRC

I store my .vimrc in my dotfiles repository located at ~/dotfiles/.vimrc, which I want to manage with Git using vim-fugitive. I have symlinks from my home directory to my dotfiles, i.e. ~/.vimrc -> ...
cbaumhardt's user avatar
  • 2,159
30 votes
7 answers
16k views

Easiest way to switch git branches

Right now I'm using fugitive to manage almost everything git related, but I can't find a good workflow to quickly visualize and switch between available branches. I can do :Git checkout <branch-...
Sergio D. Márquez's user avatar
14 votes
1 answer
3k views

Why are my windows scrolling together?

I have two windows open on the same buffer and I want to edit two parts of the same file at the same time. I can't because the windows are scrolling together. I have noscrollbind set so I am ...
Stephen Rasku's user avatar
1 vote
3 answers
992 views

Open Gstatus in new tab

I am using the vim-fugitive plugin and I encounter a strange behaviour. I don't know if it's really related to the plugin or not. I am trying to open the Gstatus page in a new tab. So I am creating a ...
nobe4's user avatar
  • 16.1k
4 votes
1 answer
2k views

VimDiff incorrectly showing all lines as changed

I am using Vim with fugitive.vim plugin. Sometimes when diffing files versus their HEAD version from Fugitive's Gstatus window, Vim shows all lines in a file as changed, when in reality only one or ...
vitvly's user avatar
  • 215