2010-10-07

vim with visual studio 2008

在visual studio 2008中使用vim
1.安装vim
2.tool->external tools->add
(1)title里填 &gvim
(2)Command里填 C:\Program Files\Vim\vim73\gvim.exe
(3)Arguments里填 $(itempath)
(4)Initial Dirtory里填 $(itemdir)
另外附上vim 和平visual studio shortcut对比
Gvim Visual-Studio Purpose
* Ctrl + F3 Search for current word under cursor
# Ctrl + Shift + F3 Search for previous word under cursor
Ctrl + o Ctrl + '-' Go to previous location
Ctrl + i Ctrl + Shift + - Go to next location
/ Ctrl + i Incremental search
gg Ctrl + Home Go to the beginning of the file
G Ctrl + End Go to the end of the file
n F3 Find again
Ctrl + P Ctrl + right arrow Autocomplete
qx Ctrl + Shift + R Record a temporary macro
@x Ctrl + Shift + P Play a temporary macro
% Ctrl + ] Go to matching braces
mx Ctrl K + Ctrl K Make a bookmark
'x Ctrl K + Ctrl N Move to (next) bookmark
~ Ctrl K + Ctrl U Change the text to UPPERCASE
zf% Ctrl M + Ctrl M Fold a section

http://hi.baidu.com/freying/blog/item/478b0ea6269ca892d0435803.html

If you end a sentence with an abbreviation, do you place an additional period after it?

When an abbreviation with a period ends a sentence, that period will suffice to end the sentence. For example:

Jane Doe lives in Washington, D.C.

When a question ends with an abbreviation, end the abbreviation with a period and then add the question mark.

Didn't he use to live in Washington, D.C.?

The Period

Let ack search more filetypes

ack does not support aspx by default, to let ack search aspx files, simple add .ackrc file under C:\Documents and Settings\[yourname],with content

--type-set=aspx=.aspx



2010-10-06

Getting Good with Git - eBooks - Tuts+ Marketplace‎

So, you want to learn about Git, the fast version control system? Then you’ve come to the right place!

In this eBook (free for the month of October! Usually $10), I’ll be guiding you through the sometimes-confusing waters of using Git to manage your development projects. The eBook clocks in at a solid 104 pages.

What’s Inside?


Chapter 1: Introduction to Git

  1. What is Git? 7

  2. Why Should I Use a Version Control System? 9

  3. Where did Git Come From? 10

  4. Why Not Use Another Source Code Manager? 10

  5. Summary, 11


Chapter 2: Commands

  1. A Warning, 14

  2. Another Warning, 14

  3. Opening the Command Line, 15

  4. What You’re Looking At, 16

  5. Commands, 17

  6. Advanced Command Line Skills, 24

  7. Summary, 25


Chapter 3: Configuration

  1. Installing Git, 28

  2. Configuring Git, 33

  3. Using Git, 34

  4. Referencing Commits: Git Treeishes, 51

  5. Summary, 52


Chapter 4: Beyond the Basics

  1. Git Add Revisited, 55

  2. Git Commit Revisited, 65

  3. Git Reset, 66

  4. Git Checkout Revisited, 67

  5. Git Diff, 68

  6. Git Stash, 70

  7. Working with Remote Repositories, 71

  8. Git Rebase, 78

  9. Summary, 81


Chapter 5: GitHub

  1. What is GitHub? 84

  2. Signing Up, 84

  3. Tour of the Tools, 87

  4. Creating a GitHub Repository, 92

  5. Forking a Repository, 96

  6. Summary, 101


Appendix A: More Git Resources, 102

Appendix B: Git GUIS , 104

About the Author


I’m a Canadian web developer, the Associate Editor at Nettuts+, and a review on the Tuts+ Marketplace. I prefer JavaScript and Ruby. Soon, I’ll be doing some writing on my personal site; of course, you can follow me on Twitter.

http://marketplace.tutsplus.com/item/getting-good-with-git/128738

search ignore case

Use “\c” anywhere in a search to ignore case (overriding your ignorecase or smartcase settings).
e.g. “/\cfoo” or “/foo\c” will match foo, Foo, fOO, FOO, etc.

Use “\C” anywhere in a search to force case matching.
e.g. “/\Cfoo” or “/foo\C” will only match foo.

2010-08-26

Removing Deleted Files from your Git Working Directory

我们知道git rm file 命令是删除一个文件,文件就进入了暂存区,之后就可以用git commit 来提交删除。但有时候我们从资源管理器中删除了某个文件,再用git st查看状态,git显示文件被删除,但是不在暂存区,这时,用git add .是无法将文件加入暂存区的,因为 git add .只会把当前目录里那些已更改,或者没有被忽略的新文件加入暂存区,对已删除的文件不起作用。那怎么办呢?答案是用 git add -u。它的作用是把工作区内已跟踪文件里更改或的,或者删除了的文件加入暂存区,但对新文件不起作用,它针对的是已跟踪文件。
git add -A = git add -u + git add .
注意A是大写的


Difference of “git add -A” and “git add .”

Removing Deleted Files from your Git Working Directory

2010-08-24

git 笔记

git 的强大就不用说了,目前在windows下使用git,先装 msysgit,再装tortoisegit
msysgit带git命令行 git bash
git init 初始化版本库
git add filename 添加新文件到版本库或者添加修改的文件到提交列表(暂存区)
git add . 同上,所有文件
git commit 提交,回车后会弹出默认文本编辑器以输入 commit message
git commit -a = git add + git commit
git commit -m "fix issue 15252" 直接提供commit message
git diff 比较当前工作目录和暂存区
git diff --cached 比较暂存区和上次提交
git diff HEAD 比较当前工作目录和上次提交

将 Current working directory 记为 (1)
将 Index file 记为 (2)
将 Git repository 记为 (3)
他们之间的提交层次关系是 (1) -> (2) -> (3)
git add完成的是(1) -> (2)
git commit完成的是(2) -> (3)
git commit -a两者的直接结合
从时间上看,可以认为(1)是最新的代码,(2)比较旧,(3)更旧
按时间排序就是 (1) <- (2) <- (3)
git diff得到的是从(2)到(1)的变化
git diff –cached得到的是从(3)到(2)的变化
git diff HEAD得到的是从(3)到(1)的变化
                                                                                                        --Lee.MaRS

git checkout -- filename 丢弃某个文件的更改(如果文件在暂存区,则丢弃添加到暂存区之后的更改,如果不在暂存区,则丢弃上次提交之后的更改)
git reset --hard 丢弃所有更改
git reset -- filename 从待提交列表中移除
git revert HEAD revert上一次的提交,并提交本次操作。
git rm filename 从磁盘删除文件,并添加到暂存区
git rm -r folder 从磁盘删除文件夹(内所有文件),并添加到暂存区,,对于文件, 也可以加上 -r
git rm --cached filename 保留文件,取消对文件的跟踪
git commit --amend 修正上一次提交。比如提交之后发现某个单词写错了,就可以用此命令来  修改上次的 commit message。或者提交后才发现没有把某个修改后的文件add 到暂存区,隐藏没有提交,这是就可以先git add xxx.txt 把文件添加到暂存区,然后运行此命令,把此文件加到上次提交中