Perference General Double Click Navigation - 默認雙擊后會彈出新窗口(Use Seperate Window),這個和vc不一樣,主要這個窗口位置和大小通常讓人有不連貫感。改為Same as Click就和vc一樣
Text Editing Editing While editing Automatically trim trailing whitespace (去除尾部空白) Including whitespace-only lines (全空行也去除空白,注意還保留回車) 這個其實是我們正常編碼會做的,但這樣和老代碼交接處以后的patch可能會產生沖突。如果自己平常習慣好,推薦不勾。 Default text encoding 選 Simplified Chinese(Mac OS) Default line ending 選 Windows(CRLF) Convert existing files on save 不勾
#diff2unix #Ruoqian, Chen #2013.2.7 #---------- #trans diff patch with windows LE (CRLF) to Unix LE(LF) #----------- #usage #diff2unix trans curent dir #diff2unix path trans dir or file #when trans dir, will trans all files and child dir in it. #---------- if [ $# == 0 ] then path=`pwd` else path=$1 fi if [ -f $path ] then file=${path##*/} ext=${file##*.} if [[ "$file" != mac* ]] && [ $ext = "diff" ] then new_file="mac_"$file echo $path "->" $new_file awk '/^/+/+/+|^---|^@@|^diff|^Binary|^File/ { sub(//r$/,"") }; {print}' $new_file fi else for file in `ls $path` do diff2unix $path"/"$file done fi
::diff2win ::Ruoqian,Chen ::---------- ::Trans file with unix LE(LF) or mix LE(LF/CRLF) to window LE(CRLF) ::---------- ::2013.2.16 ::usage ::diff2win trans curent dir ::diff2win path trans dir or file ::---------- @echo off setlocal enabledelayedexpansion set WorkPath=%cd% if [%1] neq [] set WorkPath=%1&& (dir /ad %1 >nul 2>nul ) && goto TRANS_DIR || goto TRANS_FILE :TRANS_DIR for /f "delims=" %%i in ('dir !WorkPath! /a-d /b ^| findstr .diff$ ^| findstr -v ^win_') do ( echo !WorkPath!/%%i -^> win_%%i gawk -v BINMODE="rw" "/^/+/+/+|^---|^@@|^diff|^Binary|^File/ { sub(/$/,/"/r/") }; {print}" win_%%i ) goto :eof :TRANS_FILE for /f "delims=" %%i in ('dir %WorkPath% /b') do ( echo %WorkPath% -^> win_%%i gawk -v BINMODE="rw" "/^/+/+/+|^---|^@@|^diff|^Binary|^File/ { sub(/$/,/"/r/") }; {print}" win_%%i ) ::gawk -v BINMODE="rw" "/^/+/+/+|^---|^@@|^diff|^Binary|^File/ { sub(/$/,/"/r/") }; {print}" out ::---------- ::2013.2.8 ::usage ::diff2win file_out ::e.g. ::diff2win win.diff ::---------- ::@echo off ::gawk 1 ::http://www.gnu.org/software/gawk/manual/html_node/PC-Using.html ::Under MS-Windows, OS/2 and MS-DOS, gawk (and many other text programs) silently translate end-of-line "/r/n" to "/n" on input and "/n" to "/r/n" on output.
windonws下直接打各種格式diff winpatch.bat
::winpatch ::Ruoqian, Chen ::2013.2.16 :: ::call gnu patch to patch a diff file with windows LE (CRLF) or Unix LE(LF) or mix LE ::---------- ::usage ::the same to patch use patch --help to read it ::e.g. winpatch -p1 ::or winpatch -p1 -R ::---------- @echo off gawk -v BINMODE="rw" "/^/+/+/+|^---|^@@|^diff|^Binary|^File/ { sub(/$/,/"/r/") }; {print}" > dosCRLF.diff patch %1 %2 %3 %4 %5 %6 %7 %8 %9
2013.3.4.更新
1. 關于Versions commit的時候尤其要注意不要遺漏了文件的增刪。點擊Changed,會看到目錄下的修改,其中新增文件顯示為圓問號,刪除文件顯示為虛方問號,右鍵點擊Add或Delete,使之圖標變化為正確的增刪圖標即可。 2. 關于Sublimt Text2 a) 解決中文亂碼的插件 資源和說明見:https://github.com/seanliang/ConvertToUTF8/blob/master/README.zh_CN.md b) 修改快捷鍵為windows樣式 Preferences->Key Bindings - User 將windows版本的拷過來 或直接可以從這里自取 https://gist.github.com/piaopolar/5081327 c) 修改將文件拖放到窗口內不打開新窗口 Preferences->Setting - Default "open_files_in_new_window" : false