Step 1 of manual configuration: Configure. vimrc
Objective: vimdiff can automatically wrap a long line of information in wrap.
" ~/.vimrc"BEGIN for vimdifffunc Wrap() set wrapendfuncmap <F10> :call Wrap()<CR><C-W><C-W> :call Wrap()<CR><C-W><C-W>imap <F10> <ESC>:call Wrap()<C-W><C-W> :call Wrap()<C-W><C-W>"END for vimdiff
Step 2: Configure ~ /. Subversion/config
Purpose: Replace the default SVN diff comparison tool with a custom script. If it is uncomfortable, change it back.
### Set diff-cmd to the absolute path of your 'diff' program.### Subversion's internal diff implementation.# diff-cmd = diff_program (diff, gdiff, etc.)diff-cmd = /home/xiwang/usr/local/bin/diffwrap.sh
Step 3: Create/edit diffwrap. Sh
Objective: To implement the diffwrap. Sh script so that the vimdiff command can be correctly executed when the 'svn diff' command is executed.
#!/bin/bash# diffwrap.sh# ---BEGIN--- change#shift 5#vimdiff "$@"DIFF="vimdiff"LEFT=${6}RIGHT=${7}$DIFF $LEFT $RIGHT# ----END---- change
The script can be upgraded to control which diff command to use through the Environment Variable diff. For example, if you want to use vimdiff, you can directly run the command: Export diff = vimdiff:
#!/bin/bash# @input environment DIFF='diff'|'vimdiff'# ---BEGIN--- change# DIFF="diff"# LEFT=${6}# RIGHT=${7}## $DIFF "$LEFT" "$RIGHT"if [ x"$DIFF" == x"" ]; then DIFF="diff"; export DIFFfiLEFT=${6}RIGHT=${7}case "$DIFF" in "vimdiff") ;; "diff") OPTS="-Nu" ;;esac$DIFF "$LEFT" "$RIGHT" $OPTS# ----END---- change