Saturday, September 13, 2014

How to launch kdiff3 to compare 2 neighbouring windows in VIM

Hi
I am trying to launch kdiff3 to compare two neighbouring windows in vim,
could some one suggest me a solution?
Currently my idea is trying to use " register to save the file name of the
first window, and use %:p to get current file name, and then call kdiff3 to
compare these two windows.
But somehow, it does not work. Could someone help me with this issue?
As shown bellow

[code]nnoremap <leader>1 :let @"=expand("%:p")<CR>

function! CompareTwoFiles()
!kdiff3 "" expand("%:p")
endfunc

nnoremap <leader>2 :call CompareTwoFiles()<cr> [/code]




--
View this message in context: http://vim.1045645.n5.nabble.com/How-to-launch-kdiff3-to-compare-2-neighbouring-windows-in-VIM-tp5722657.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: