Saturday, September 13, 2014

Re: How to launch kdiff3 to compare 2 neighbouring windows in VIM

When I used variable,
[code]

nnoremap <leader>1 :let file1=expand("%:p")<CR>

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

nnoremap <leader>2 :call CompareTwoFiles()<cr>

[/code]
I got following error
[code]
Error detected while processing function CompareTwoFiles:
line 1:
E121: Undefined variable: file1
E15: Invalid expression: file1 expand("%:p")
[/code]



--
View this message in context: http://vim.1045645.n5.nabble.com/How-to-launch-kdiff3-to-compare-2-neighbouring-windows-in-VIM-tp5722657p5722662.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: