ASIC/FPGA Design and Verification Out Source Services
vim diff vertsplit function to fired on a diff -qr ...
-
This page shows how facilitate the analysis of the output of the command :
diff -rq . /usr/guest/New_Delivery | vi -
So diff is fired recursively on two arbitrary directories. The output may
look like in the next example.
Files ./Name.cs and ../Delegate/Name.cs differ
In this simple example, we have only one file, which differs.
-
So execute the command and pipe the results to vi. Next we save the result somewhere
in a temporary location. To invoke the gvimdiff from within
(cursor on the desired differed line)
the edited file we type
vdf
-
We will see the difference using a color scheme of peachpuff,
since this looks the best, when in comes to files with syntax such as
verilog, e, c, c++ etc...
-
The function has to be added to your ~/.gvimrc. It is listed below:
"A new diff which is the output of the standard diff -rq . /usr/pini/NewDir
fun! VertDiff()
let l:file_a = substitute(getline('.'), "Files \.\/", "", "")
let l:file_a = substitute(l:file_a, " and.*", "", "")
let l:file_b = substitute(getline('.'), "Files .*and ", "", "")
let l:file_b = substitute(l:file_b, " differ", "", "")
" echo l:file_a
execute 'colorscheme peachpuff'
execute 'e ' . l:file_a
execute 'vert diffsplit ' . l:file_b
endfun
nmap vdf :call VertDiff()
First
Second
|