Skip to content

Instantly share code, notes, and snippets.

@huytd
Created August 4, 2016 16:26
Show Gist options
  • Save huytd/78c676a797f81eb08cdedf5400e1b6a3 to your computer and use it in GitHub Desktop.
Save huytd/78c676a797f81eb08cdedf5400e1b6a3 to your computer and use it in GitHub Desktop.
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
@TamaMcGlinn
Copy link

Why is the first wincmd with $ and the second without?

@farisachugthai
Copy link

First one shouldnt have a "$" in case thats giving you problems. Otherwise this worked perfectly for me.

@IngoMeyer441
Copy link

Why is the first wincmd with $ and the second without?

  • $wincmd w focuses the last window because $ always references the highest window number.
  • wincmd J moves the focused window to the bottom, so in this case the window for the merged file view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment