Questions tagged [git]
Questions about the integration of the Git revision control system in Vim or about the synchronisation of Vim files via Git repositories.
97 questions
4
votes
2
answers
239
views
Neovim git merge problem
When using neovim as a git mergetool, im having troubles accepting entire blocks of conflicts from either source.
<<<<<<< HEAD
BRANCH 1
=======
BRANCH 2 CHANGES
>>>>&...
1
vote
3
answers
258
views
How develop a vim plugin repository, live testing it, making proper use of git?
I have come across the following problematic: How to develop a Vim plugin using a local repository, while you are at the same time testing its changes, doing commits and so forth.
So in my case I'm ...
1
vote
3
answers
413
views
How to pass the current line number to a shell command as an argument?
I need to get information about the last person who edited the file, so I use git blame to achieve this. All I need is to run git blame -L X,Y and have it pasted in the Vim window.
If I attempt one of ...
0
votes
1
answer
334
views
Looking through previous file versions and restoring hunks?
I want to be able to see a list of previous versions of a file in a git repo, select one of them to see a diff, and choose which parts from that version I want to restore, something like git checkout -...
0
votes
0
answers
54
views
Cannot run file in ftdetect folder using Vundle
I am using Vim 7.4 on Linux with Vundle and Git. I am writing my own plugin called potion (following an example in the book LEARN VIMSCRIPT THE HARD WAY by Steve Losh) that is stored in my GitHub ...
4
votes
1
answer
346
views
Check for diff mode while using git mergetool
I am using Neovim v0.10.0 and have the following config for git difftool:
[diff]
tool = nvimdiff
[difftool]
prompt = False
trustExitCode = true
[difftool "nvimdiff"]
cmd = ...
0
votes
1
answer
250
views
How to configure git config to use MacVim and zsh to use Vim bundled in MacVim?
The following is an excerpt of my .gitconfig
[core]
editor = mvim
autocrlf = false
pager = less -FX
commentchar = "#"
[diff]
tool = vimdiff
guitool = vimdiff
[merge]
...
0
votes
1
answer
222
views
Working with multiple git branches of Neovim config
I am working with multiple NVim configs through multiple git branches but it appears to be broken like it doesn't update the config after I switch branch and restart Neovim. Restarting my computer ...
0
votes
1
answer
87
views
Automatically `git add` after conflicts are resolved in vim
Coming from Spacemacs, one of the things that I miss is that files are automatically git added after all conflicts are resolved. Wondering if there's a way to do that in vim.
2
votes
0
answers
472
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
...
3
votes
2
answers
386
views
visualize Vim undo history
Is there for Vim what Gource is for Git, to visualize Vim undo history?
I'm familiar with Gundo, which display diffs of undo history, but it's not really a visualizer like Gource for Git repos.
1
vote
0
answers
130
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, ...
0
votes
0
answers
835
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 :...
3
votes
1
answer
1k
views
GitLens-like issue linking in vim
In VSCode, GitLens allows you to hover over a line and get a link to the PR containing the most recent change for that line. Basically with a single click you can open up the PR which often contains ...
1
vote
2
answers
627
views
How can I detect if the vim I'm running on is the Git for Windows vim? [duplicate]
I have a shared .vimrc that I use across platforms. It works fine in most circumstances, but looks terrible when I run git commit from the command line. I want to make my color scheme not load when ...
3
votes
2
answers
1k
views
How to fuzzy search a git repository for content that once existed?
I love fzf.vim for file content searching within vim. But how could I use that to search for content that was once in a git repository's files?
This stackoverflow question has basically two ...
4
votes
1
answer
286
views
How to use different rules for highlighting trailing whitespace inside a gitcommit diff?
In my ~/.vimrc, I have:
highlight TrailingWhitespace ctermbg=blue
autocmd BufReadPost * syn match TrailingWhitespace /\s\+\%#\@<!$/
This highlights trailing spaces, except when I am still typing ...
0
votes
1
answer
1k
views
Vim Fugitive not loading
I have recently been trying to separate my neovim config into multiple files. After moving everything involving vim-fugitive and vim-gitgutter into a separate file, git-gutter is not loading and I ...
0
votes
1
answer
2k
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 ...
2
votes
1
answer
2k
views
Is there a Vim plugin similar to Git History Diff?
I like the extension Git History Diff in Visual Studio Code, looks something like this:
I am looking for something similar for Vim.
I've looked at Fugitive and other Vim plugins, but they are awkward ...
6
votes
1
answer
3k
views
IDE-like inline diff highlighting in Vim
I enjoy using Vim and like it better than IDEs on most points. One common IDE feature that I miss, though, is inline diff highlighting:
In this example changed lines are highlighted in blue and ...
1
vote
1
answer
638
views
Why is the commit message inside parentheses wrapped so strangely?
I sometimes need to do some remarks in parentheses in my commit message's detailed part. But when the parenthesized text comes to the rightmost column and is line-broken, the next line for some reason ...
0
votes
2
answers
797
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....
3
votes
1
answer
371
views
shared vimrc on two machines; only run command for one of them
I use git to share my vimrc across multiple machines.
But now I have some commands which I only want on one machine. Namely, this
line:
au! redhat BufReadPost
(derived from this very helpful answer!
...
1
vote
1
answer
349
views
Always move cursor to top of gitcommit buffer
I have the following autocmd in my vimrc.
augroup line_return
au!
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ execute 'normal! g`"zvzz' |
\ ...