Closed freijon closed 2 years ago
I work around this by having a separate init.vim
(or vimrc
) for use with diffing. For example:
source $HOME/.vimrc
" Disable plugin settings that mess with diffs
let g:minimap_auto_start = 0
let g:minimap_auto_start_win_enter = 0
Then map an alias when you want to diff (you can change your git diff
command too):
alias nvimd='nvim -u $HOME/init_no_mm.vim -d'
Some info on custom git difftool commands: https://stackoverflow.com/a/1339962/8862937
Indeed, this works fine as a workaround, thank you.
However, it would be nice to have working Minimap(s) in Diff-mode. Maybe even show the various diffs in the Minimap, like in normal mode. I could see this being very useful. Maybe we can convert this issue into a feature request, if you agree.
I'm not sure if that is possible. The minimap is just another window. We put the source through the minimap generator which gives us a bunch of dots, and we put those dots in the minimap window. As far as vim is concerned, we are editing two buffers in a split view (not quite, but accurate enough for a high level summary). When vim/neovim is opened in diff mode, it diffs all the windows. So opening two files + a minimap becomes a 3-way diff, where of course nothing will match because one window is filled with only braille characters. So I believe this is just a limitation of vim/nvim and how we implemented the minimap. There might be a way to exclude certain windows from a diff, but I haven't looked into it. If you find something in the docs that indicates that is possible, I'll definitely add this as a feature request.
Hi I stumbled upon this issue and ended up wrapping the settings like this which seems to work. Hope this helps.
if ! &diff
let g:minimap_auto_start = 1
let g:minimap_auto_start_win_enter = 1
endif
Check list
Environment info
Version info
Question / Problem and steps to reproduce
When the settings
g:minimap_auto_start = 1
andg:minimap_auto_start_win_enter = 1
are enabled, the diff feature in nvim becomes unusable. The entire document is seen as a difference.This happens when using
nvim -d <file1> <file2>
(it even happens when diff'ing a file with itself). Same withgit difftool