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