Friday, 30 December 2016

Emacs: how to change from insert mode to overwrite mode

 How do I make Emacs “typeover” or “overwrite” instead of inserting?  i.e. change from insert mode to overwrite mode, like Esc + r in vim

Answer:
M-x overwrite-mode (a minor mode). This toggles overwrite-mode on and off, so exiting from overwrite-mode is as easy as another M-x overwrite-mode.

On some systems, Insert toggles overwrite-mode on and off.

Thursday, 29 December 2016

Absolute Beginner's Guide to Emacs 4

How to copy and paste a whole file in emacs?


Suppose you are in the middle of a file.

(1) navigate to the first character of the file :  Use  Meta + <  (i.e., Meta key + shift +  ,  )
(2) Enter "Ctrl + Space " to activate the select mode
(3) navigate to the last character of the file :  Use  Meta + >  (i.e., Meta key + shift +  .  )
 (4) Enter "Meta +  w" to copy
 (5) Enter "Ctrl + y" to paste.

Note what is Meta key ?
 On Mac is Mac key, On other keyboard is the Alt key, some old keyboard may use ESC key

Tuesday, 27 December 2016

More efficient emacs combination keys.

To move the cursor around more quickly, you should avoid using keys like "pageup" "pagedown", "home" "end", because it will cause your hand to leave the standard typing position. Instead you should use the equivalent keys for them:
Like the following left keys all have an equivalent combo on the right, which are faster:
C-up ---> m - {
C-down --> M -}
C-left --> M - b
C-right --> M - f
home --> C - a
end --> C - e
pageup --> M - v
pagedown --> C - v

Friday, 23 December 2016

Absolute Beginner's Guide to Emacs 3

Opening, saving, and closing buffers

To open a file and load it into a buffer, use C-x C-f, which will open a prompt in the mini-buffer that says “Find file: ~/path/to/current/directory/”. Just as with switching buffers, you can press the tab key to list the files in the directory you have specified if you need to.

Find file: ~/learn/shell/

You can then type in the name (and/or change the path) of the file you want:

Find file: ~/learn/shell/zip.sh

Press enter, and a new buffer will be created with the file you specified:

File Edit Options Buffers Tools Sh-Script Help
#!/bin/bash

# Zip all the arguments with for loop
for i in $@; do
  zip archive "$i"
done


-UU-:----F1  zip.sh         All L1     (Shell-script[bash]) -------------------------------------------
Indentation setup for shell type bash

If you make changes to the buffer and you want to save it back to the file on disk, use C-x C-s:
Wrote /home/jtony/learn/shell/zip.sh

Thursday, 22 December 2016

Absolute Beginner's Guide to Emacs 2

The three most important keyboard shortcuts to know are C-h C-h (help), C-g (quit), and M-x (run command). The help command will put you in a position to figure out how to do something if you’re stuck, and the quit command will cancel an operation (for example, if you are entering a command at the mini-buffer, C-g will quit the mini-buffer and move the point back to the buffer you were in previously – see the next section for more details on buffers and the mini-buffer). The run command will let you run any command in Emacs; you probably won’t need to use it much right away, but it’s good to know if you run into a scenario where you do need to run a command.

You can’t see the other buffers until you tell Emacs to view them through a window. To do this, use the C-x b key combination. This will move the point to the mini-buffer and display a message that looks like “Switch to buffer (default *scratch*)”:

(Remember that if you want to cancel the current operation, i.e. you decide you don’t want to switch buffers after all, you can use C-g to quit the mini-buffer).

There are a few relevant key commands for manipulating windows:
  • C-x 0 : close the active window
  • C-x 1 : close all windows except the active window
  • C-x 2 : split the active window vertically into two horizontal windows
  • C-x 3 : split the active window horizontally into two vertical windows
  • C-x o : change active window to next window
Note that closing a window does NOT mean that the buffer it is displaying is closed.

Wednesday, 21 December 2016

Absolute Beginner's Guide to Emacs 1

Although in standard terminology the running instance of Emacs would be called a window, in Emacs terminology it is called a frame. Within Emacs itself, there is a window in which we see the welcome “GNU Emacs” buffer (more on windows and buffers in a bit).
The blinking black cursor (over the W in “Welcome”) is called the point. Not only is it like a cursor in your standard text editor (where the text is inserted when you type), but it is the location where you will sometimes need to run functions as well (e.g., “change the word that the point is currently in to be uppercase”). We’ll come back to this later.
The grey bar at the bottom of the screen is the status bar and displays various information about the point and the active buffer (there is one status bar per window). The white space below that is called the mini-buffer and will occasionally display status messages (e.g., after saving a file), and is also the place where you enter Emacs commands.

Referred link:
http://www.jesshamrick.com/2012/09/10/absolute-beginners-guide-to-emacs/

Monday, 19 December 2016

Emacs 9: Official tutorial 8

Completion is a way to avoid unnecessary typing.  For instance, if you
want to switch to the *Messages* buffer, you can type C-x b *M<Tab>
and Emacs will fill in the rest of the buffer name as far as it can
determine from what you have already typed.  Completion also works for
command names and file names.  Completion is described in the Emacs
manual in the node called "Completion".

The end of the tutorial.

Sunday, 18 December 2016

Emacs 8 Offical Tutorial Part 7

Here are some other useful C-h options:

   C-h f        Describe a function.  You type in the name of the
                function.

Line 1038

Thursday, 15 December 2016

Sunday, 11 December 2016

How to show git statistics for a local change?

jtony@genoa:~/src/llvm$ git diff --stat
 lib/Target/PowerPC/PPCExpandISEL.cpp | 202 ++++++++++++++++++++++++++++++++++++++++++------------------------------------------------
 1 file changed, 95 insertions(+), 107 deletions(-)
jtony@genoa:~/src/llvm$ git diff --numstat

Sunday, 27 November 2016

Emacs 7: Offical Tutorial Part 6

Did you see what happened?  Emacs, in an incremental search, tries to
go to the occurrence of the string that you've typed out so far.  To
go to the next occurrence of 'cursor' just type C-s again.  If no such
occurrence exists, Emacs beeps and tells you the search is currently
"failing".  C-g would also terminate the search.

>> Type C-x 1 (in the top window) to get rid of the bottom window.

(If you had typed C-x 1 in the bottom window, that would get rid
of the top one.  Think of this command as "Keep just one
window--the window I am already in."
)

Line 941

Emacs 6: Offical Tutorial Part 5


There are many C-x commands.  Here is a list of the ones you have learned:

        C-x C-f         Find file
        C-x C-s         Save file
        C-x s           Save some buffers
        C-x C-b         List buffers
        C-x b           Switch buffer
        C-x C-c         Quit Emacs
        C-x 1           Delete all but one window
        C-x u           Undo

>> Move the cursor to the blank line two lines below this one.
   Then type M-x repl s<Return>changed<Return>altered<Return>.

   Notice how this line has changed: you've replaced the word
   "changed" with "altered" wherever it occurred, after the
   initial position of the cursor.

Friday, 25 November 2016

How to generate the ssh key on unix and add it to git hub?


(a)ssh-keygen -t rsa -C "jtony@ca.ibm.com"
(b)When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
(c)At the prompt, type a secure passphrase, press Enter to not use passphrase
(d) Enter the secure passphrase again, or press Enter again to confirm null passphrase.
(e) copy the  ~/.ssh/id_rsa.pub content
(f) Go to git hub and click on New     SSH Key, enter the Tile for the key and paste the copied content to the Key field and click
    on Add SSH Key.
https://www.racf.bnl.gov/docs/authentication/ssh/sshkeygenunix

Thursday, 24 November 2016

Emacs 5: Offical Tutorial Part 4

>> Type C-x b *Messages* <Return> to look at the buffer of messages.
   Then type C-x b TUTORIAL <Return> to come back to this tutorial.


C-x s     Save some buffers

C-x s asks you about each buffer which contains changes that you have
not saved.  It asks you, for each such buffer, whether to save the
buffer.

>> Insert a line of text, then type C-x s.
   It should ask you whether to save the buffer named TUTORIAL.
   Answer yes to the question by typing "y".

Line 635

How to move the cursor to its last position in vim?

The quickest way is to hit either:

''

(two apostrophes) or:

``

(two backticks). Note that the difference is that the backtick goes to the same location on the line, whereas the apostrophe goes to the start of the line. On a UK keyboard, the apostrophe is more accessible, so I tend to use that one. There are loads of useful marks like this, see :help mark-motions.

For some other motions (not 2j I think), there's also the jump-list that lets you navigate back and forth among a number of motions. Ctrl-O and Ctrl-I do this navigation, but see :help jump-motions for more information.




Original link on stackoverflow:
http://stackoverflow.com/questions/5052079/move-cursor-to-its-last-position

Tuesday, 22 November 2016

How to use ctags (basics) ?



jtony@genoa:~/src/llvm$ ctags -R .
if you want to just to a definition of a funciton, move the cursor to the function and press ctrl + ]
If there is only one match, it will take you there. If there are multiple matches, it will list them all,
letting you choose the one you want, just like :tselect. The best of both worlds. :)

if you want to go back where you jumped from, press ctrl + t

Friday, 18 November 2016

using git apply to apply a patch

Before apply the patch, we have to creat it first.
git format-patch master --stdout > fix_empty_poster.patch
This will create a new file fix_empty_poster.patch with all changes from the current (fix_empty_poster) against master.

Now apply it. First, take a look at what changes are in the patch. You can do this easily with git apply
git apply --stat fix_empty_poster.patch
Next, you’re interested in how troublesome the patch is going to be. Git allows you to test
the patch before you actually apply it.
git apply --check fix_empty_poster.patch

You can do "git apply [patch-name].patch" (Haven't try that.)

But I’ll use git am instead of git apply. The reason for this is that git am allows you to sign off an applied patch.
This may be useful for later reference.

Thursday, 17 November 2016

emacs 4: Offical Tutorial Part 3

>> Type C-x 1 to get rid of the buffer list.

When you have several buffers, only one of them is "current" at any
time.  That buffer is the one you edit.  If you want to edit another
buffer, you need to "switch" to it.  If you want to switch to a buffer
that corresponds to a file, you can do it by visiting the file again
with C-x C-f.  But there is an easier way: use the C-x b command.
In that command, you have to type the buffer's name.

>> Create a file named "foo" by typing C-x C-f foo <Return>.
   Then type C-x b TUTORIAL <Return> to come back to this tutorial.




Line 582

Calculate and print the summation of a column using awk

 Calculate the summation of all the number in column 1 in file test.txt and print out the result.

cat test.txt |  awk '{s+=$1} END {printf "%.0f\n", s}'


http://stackoverflow.com/questions/450799/shell-command-to-sum-integers-one-per-line

Tuesday, 15 November 2016

emacs 4: Offical Tutorial Part 2

From line 454:

Use Meta + g, Meta + g to bring up the Goto line: mode at the bottom, then enter the line number that you want to jump to and enter, the editor will take you to that line.

Use C-/ to undo things because this is the most convenient way of typing,   much easier than C-/_ and C-x u ( three keys).

One special thing about the command for finding a file is that you
have to say what file name you want.  We say the command "reads an
argument" (in this case, the argument is the name of the file).  After
you type the command

        C-x C-f   Find a file

Emacs asks you to type the file name.  The file name you type appears
on the bottom line of the screen.  The bottom line is called the
minibuffer when it is used for this sort of input.  You can use
ordinary Emacs editing commands to edit the file name.

While you are entering the file name (or any minibuffer input),
you can cancel the command with C-g.

To Line 553

Monday, 14 November 2016

git log --author option

30. How to just show log of one author?
git log --author=jtony

git squash



31. How to do a git squash?
e.g. If I want to squash the two commits on HEAD.
(a) git rebase -i HEAD~2
git will bring all a editor with the following message:
pick 8157e2b Test 1.
pick 05532ed Test 2.

(b) change the second 'pick' to 'squash', which means squash
commit 2 (Test2) into commit 1 (Test1)

(c) Save and quite.  git will combine the two commits together and
bring up a new editor. Like:
# This is a combination of 2 commits.
# The first commit's message is:

Test 1.

# This is the 2nd commit message:

Test 2.
 Edit the message again and save and quite. Like
Test1 && Test2

Successfully rebased and updated refs/heads/master.

If you do a 'git log' after the combination, you will find
the new combined log as follows:

commit 77fd2899a713aefcb0d3369fe17d12d9552e5cec
Author: Tony Jiang <jtony@ca.ibm.com>
Date:   Mon Nov 14 20:03:34 2016 -0600

    Test 1 && Test 2.



Sunday, 13 November 2016

VIM Advanced 3

翻页移动
ctrl+f 向下翻整页
ctrl+b 向上翻整页
ctrl+d 向下翻半页
ctrl+u 向上翻半页

Wednesday, 9 November 2016

VIM advanced 2

4. How to set up the vimrc and syntax hightlight (using clang rules)?
cd ~/.vim/
mkdir syntax && cd syntax
cp ~/src/llvm/utils/vim/syntax/*  .
cp ~/src/llvm/utils/vim/vimrc  ~/.vimrc

Tuesday, 8 November 2016

VIM advanced 1

1. search current word
shift + 8  (ie., *)

2. open two file, and split them in two windows
split files horizontally:
vim lib/Headers/altivec.h jyj.format -o
split files vectically:
vim lib/Headers/altivec.h jyj.format -O

3. substitute contents that contains "[","]" need escape char, like
replace "e[" with   "(int)e["
:%s/e\[/(int)e\[/gc

Thursday, 3 November 2016

more git command (git svn, git cherry-pick)

27. git cherry-pick
Apply the changes introduced by some existing commits
I have a commit on dev, which has conflicts with current master,
I checkout a new branch new_dev, and cherry-pick the top commit on dev
and apply it to new_dev, if there is no conflicts, you don't have to
merge the conflicts for other commits, just cherry-pick  the useful commit and
discard all the other commits.

git cherry-pick a96001889dfe2259aca963ae3380900eaad406fa
http://blog.csdn.net/wh_19910525/article/details/7554430


28. Use git svn to commit a git changeset to svn repository
git svn dcommit --interative

Tuesday, 1 November 2016

windows 目录切换快捷键


当我们打一个文件夹或更深层次的目录需要返回上一级文件夹时可,按backspace键可以       退到上一级目录文件,这个键我们平时用于删除光标前一个字符比较多!!
      
 table键可以在当前文件夹内的项目中正序选择
   如果是shift 和table一起按,则可以倒序选择
   
很实用的,希望给大家带来方便!!!

http://www.7edown.com/edu/article/soft_4392_1.html

Monday, 31 October 2016

git rebase 2

26 reorder the commits that haven't pushed to the public
git rebase -i HEAD~2
Don't do this once the changesets are pushed to the public.

Saturday, 29 October 2016

emacs 4: Offical Tutorial Part 1

Moving from screen to screen is useful, but how do you
move to a specific place within the text on the screen?

There are several ways you can do this.  You can use the arrow keys,
but it's more efficient to keep your hands in the standard position
and use the commands C-p, C-b, C-f, and C-n.  These characters
are equivalent to the four arrow keys, like this:

                          Previous line, C-p
                                  :
                                  :
   Backward, C-b .... Current cursor position .... Forward, C-f
                                  :
                                  :
                            Next line, C-n



Here is a summary of simple cursor-moving operations, including the
word and sentence moving commands:

        C-f     Move forward a character
        C-b     Move backward a character

        M-f     Move forward a word
        M-b     Move backward a word

        C-n     Move to next line
        C-p     Move to previous line

        C-a     Move to beginning of line
        C-e     Move to end of line

        M-a     Move back to beginning of sentence
        M-e     Move forward to end of sentence


If Emacs stops responding to your commands, you can stop it safely by
typing C-g.  You can use C-g to stop a command which is taking too
long to execute.

>> Type C-h k C-f.   -- open a new window (like vim split)
   See how this window shrinks, while a new one appears
   to display documentation on the C-f command.





as well.  Here is a summary of the delete operations:

        <DEL>        Delete the character just before the cursor
        C-d          Delete the next character after the cursor

        M-<DEL>      Kill the word immediately before the cursor
        M-d          Kill the next word after the cursor

        C-k          Kill from the cursor position to end of line
        M-k          Kill to the end of the current sentence


 Undoing Changes

C-/
Undo one entry of the undo records—usually, one command worth (undo).
C-x u
C-_
The same.


>> Move the cursor to the beginning of a line which is not empty.
   Then type C-k to kill the text on that line.
>> Type C-k a second time.  You'll see that it kills the Newline
   which follows that line.



This blog covers contents until line 453  of official tutorial






 

emacs 3: 避免门户之见

所谓门户之见就是贴标签.”我们的”对应”他们的”.”熟悉的”对应”陌生的”,”正统的”对应”异端”的.
“我们的”,”熟悉的”,”正统的”,就是”好的”;”他们的”,”陌生的”,”异端的”就是”坏的”.
比如用了Emacs就排斥Vim的快捷键,或者反之.
避免门户之见的关键就是意识到标签只存在于你的主观想像中.真实世界不会因为你的想像而扭曲.
以Emacs和Vim的快捷键为例,两种快捷键完全可以无缝接合.
当然思想的问题不是我空谈能解决的,关键是要实干.一个很好的治愈方法就是把http://planet.emacsen.org/上约4000篇文章通读一遍.大约需要8个小时左右.泛读就可以了.目的就是了解世界有多大.
jyj407: 作者这里说的很好,凡是好的东西,我们都可以拿来为我所用,无论是vim 还是 emacs,也不管是Windows还是Unix、Linux, 抑或C++ vs Java 它们都是各有千秋,优缺互补。避免门户观点,始终保持开放的心态很重要。

原文链接:
https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/guide-zh.org

Friday, 28 October 2016

emacs 2 移动和导航






表 3. 有用的 Emacs 键盘输入(用于移动和导航)
键盘输入函数描述
C-p,
UpArrow
previous-line将插入点向上移动到上一行。
C-n, DownArrownext-line将插入点向下移动到下一行。
C-f, RightArrowforward-char将插入点移动到下一个字符。
C-b, LeftArrowback-char将插入点移动到上一个字符。
M-fforward-word将插入点移动到下一个单词。
M-bbackward-word将插入点移动到上一个单词。
C-v, PgDnscroll-up将文本向上滚动一屏。
M-v, PgUpscroll-down将文本向下滚动一屏。
Homebeginning-of-buffer将插入点移到缓冲区的开始处。(在某些版本中,这个键被缺省定义为移动到当前行的开始处。)
Endend-of-buffer将插入点移到缓冲区的末尾。(在某些版本中,这个键被缺省定义为移动到当前行的末尾。)
C-abeginning-of-line将插入点移到本行的开始处。
C-eend-of-line将插入点移到本行的结尾。
M-abeginning-of-sentence将插入点移到句子的开始处。
M-eend-of-sentence将插入点移到句子的结尾处。
M-{beginning-of-paragraph将插入点移到段落的开始处。
M-}end-of-paragraph将插入点移到段落的结尾处。

Thursday, 27 October 2016

emacs 1 进入与退出

进入退出emacs

1. 进入 emacs:
 Unix 系统下:  emacs file_name
例如:       emacs hello.cpp

2. 退出emcas:
 
    比较文明的方法,C-x C-c ,如果当前文件已经修改会问你是否保存。
    野蛮点的方法,调用函数kill-emacs,即M-x kill-emacs,直接退出,不管是否修改。
 不过直接退出后,Emacs会在相同目录下保留一个以#号开头结尾的相同文件名文件,下次启动可以使用M-x recover-file来恢复。如果是多次保存后,还会有个以~结尾的文件,保存了上次信息。

Wednesday, 26 October 2016

git rebase 1

Never make any changes on master!

git checkout master
git pull

git checkout dev
git rebase master

if conflicts:

manually resolve the conflicts in vi
git rebase --continue

Tuesday, 25 October 2016

More git commands (3)

21. How to create a git diff patch?
git diff -U999999 other-branch  > file
git diff change_id  > file

22. git merge  when conflicts
I modified both the same file on branch dev and branch master
when I try to merge what I have on dev to master, I have a conflict
You can manually merge them and mark them as merged. However, if you
don't need the master changeset, you can discard that one, so it will
automatically merge successfully.
First use git reset to go back to the state that doesn't have you changes
git checkout master
git reset --hard 472fc9d1f1236af7c8183b89670e6c4035503ab8
And then:
git merge dev

23. git stash


24. git pull
before push do:
 git pull --rebase
 to rebase you currrent branch, if no conflicts you can push directly.

25. What could cause you fail to build? Some error from the new changes?
If you are on dev branch and try to pull from master, git won't update your dev branch
using remote origin master, you have to switch master branch and do a git pull --rebase there.
Make sure you do a git pull for both clang and llvm master.

Sunday, 23 October 2016

more git commands (2)


10. Adding All Changes
You also can use wildcards if you want to add many files of the same type. Suppose that I've added a bunch of .txt files into
your directory.I put some in a directory named "octofamily" and some others ended up in the root of our "octobox" directory.
Luckily, we can add all the new files using a wildcard with git add. Don't forget the quotes!
git add '*.txt'

11. To push our local repo to the GitHub server we'll need to add a remote repository.
git remote add origin https://github.com/try-git/try_git.git

12. Pushing Remotely
git push -u origin master

13. Pulling Remotely

14. git reset
You can unstage files by using the git reset command.
git reset octofamily/octodog.txt

15. git rm
 git rm command which will not only remove the actual files from disk,
 but will also stage the removal of the files for us
 git rm '*.txt'

16. git merge
merge your changes from the clean_up branch into the master branch:
git merge clean_up

17. git help
run git help to bring the manual
git help
git help config

18. git add --all
add all the deleted, newly added or modified files to the staged area.

19 git add <list of files>
like git add readme.txt a.c b.h

20 git add directory
   git add /home/jtony/src/
will add all the changes under src directory.

Friday, 21 October 2016

more git command (1)

9. git push
pushing changes
Your changes are now in the HEAD of your local working copy. To send those changes to your remote repository, execute
git push origin master
Change master to whatever branch you want to push your changes to.

If you have not cloned an existing repository and want to connect your repository to a remote server, you need to add it with
git remote add origin <server>
Now you are able to push your changes to the selected remote server

10. git branch
   git branch dev
  checkout branch

branching
Branches are used to develop features isolated from each other. The master branch is the
"default" branch when you create a repository.
Use other branches for development and merge them back to the master branch upon completion.

create a new branch named "feature_x" and switch to it using
git checkout -b feature_x
switch back to master
git checkout master
and delete the branch again
git branch -d feature_x
a branch is not available to others unless you push the branch to your remote repository
git push origin <branch> 

Thursday, 20 October 2016

Sunday, 9 October 2016

Tmux/Screen commands

Tmux

1. create a new session named work
tmux new-session -s work

2. kill window 4 in another window
tmux kill-window -t 4

3. show all sessions
tmux ls
(note that is no - "dash" before ls!!)

Screen
1. quit/kill screen session:  -- CAREFULL!!
screen -X -S 6829 quit

2. quick create a screen session:

3 How to swap windows?
The swap-window command is closest to what you want.

"Prefix :" (that is "Ctrl-B :" by default) brings you to the tmux-command prompt. There you enter:

swap-window -s 3 -t 1

Friday, 23 September 2016

无鼠标浏览网页神器:google chrome 插件vimium

今天在浏览有关快捷键使用的网页时,无意中发现一个神奇的chrome 插件,叫做vimium。可以让你完全不用鼠标操作,仅用键盘顺畅快捷的浏览网页。而且该插件的快捷键跟vim 十分相似,用习惯了vim 的同学们,用起该软件来简直有如神助。下面是该插件的网站地址。记得要先安装google  chrome 才可以安装vimium 插件哦。

https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en

Sunday, 18 September 2016

Source Insight 常用设置和快捷键大全



1.括号配对高亮:
在前括号左侧,后括号左侧双击鼠标左键,可以选定匹配括号和其中内容(<>,(),L{R},[]之间)

2.{ } 不缩进:
Options -> Document Options -> Auto Indenting -> Auto Indent Type
Simple
还有:让{ } 不缩进: options->document options->auto indent 去掉indent Open BraceIndent Close Brace (不好使,括号无法配对对齐!)

3.添加文件类型
用户可以定义自己的类型,Options->Document Options->add type,定义文件类型名以及文件名后缀。
勾选include when adding to projects在添加目录下文件到工程是该类文件就会添加进SI的工程。
如果需要将所有文件添加进SI的工程,可以定义一种文件类型*.*

4.恢复ctrl+a的全选功能
Options -> Key Assignments:
通过关键词save 找到save all,更改为ctrl+shift+a,通过关键词select找到select all,更改为ctrl +a

5.设置背景色:
Options->preference->color->windows background
设置背景色(护眼色:85,90,205

6.字符大小不一:
方法1:选上"view --> draft view" 就可以让每个字符的宽度一致了。快捷键是 "Alt + F12" 
方法2解决中文注释字体间距太大:
(1).Options->Style Properties
(2).
在左边Style Name下找到Comment Multi LineComment.在其右边对应的Font属性框下的Font Name中选“Pick...” 设置为宋体、常规、小四。确定,退回Style Properties界面,Size设为10。最后设置Clolors框下Foreground,点“Pick...”选择一种自己喜欢的颜色就OK
注:以上方法1为通用设置,方法2中可以设置注释字体以及字体大小!

7.删除注释时半个汉字问题(删除一个汉字,汉字没有了,但会多出一个问号?)
方法:
 SuperBackspace.em 复制到 Source Insight安装目录;
Project→Open Project,打开Base项目;
将复制过去的SuperBackspace.em添加入Base项目;
重启SourceInsight
Options→Key Assignments,将Marco: SuperBackspace绑定到BackSpace键;
Enjoy!!

SuperBackspace.em 的源码在博文最后面,复制保存为SuperBackspace.em即可,或者可以在这里直接下载:http://pan.baidu.com/share/link?shareid=101784&uk=3204866771

8.实用快捷键:
Shift+F8 :
高亮选中的字
"ctrl + g"
"F5" :跳到指定行
“Ctrl+=”
Ctrl+鼠标点击标识 :直接跳转至标识定义处调用处
Ctrl+F
:本文件内查找
F7
:打开Browse Project Symbols窗口,快速浏览工程内标识定义
F3
 :本文件查找结果的上一个
F4
 :本文件查找结果的下一个
Ctrl+M
 :创建或查找书签,方便下次找回此位置

9.解决TAB键缩进问题
Options-> Document Options
里面的右下角Editing Options栏里,把Expand tabs勾起来,然后确定。OK,现在TAB键的缩进和四个空格的缩进在SIS里面看起来就对齐
LinuxTAB8个空格长度,这样设置可以让TAB4个空格保持一致!)

------------------------------------------------
Source Insight常用的快捷键:
Ctrl+= :Jump to definition
Alt+/ :Look up reference
F3 : search backward
F4 : search forward
F5: go to Line
F7 :Look up symbols
F8 :Look up local symbols
F9 :Ident left
F10 :Ident right
Alt+, :Jump backword
Alt+. : Jump forward
Shift+F3 : search the word under cusor backward
Shift+F4 : search the word under cusor forward
F12 : incremental search
Shift+Ctrl+f: search in project
shift+F8 : hilight word


窗口操作:
project window Ctrl+O
打开
symbol window Alt+F8
打开和关闭
Contex Window
自定义键打开和关闭
Relation Window
自定义键打开 先锁定再刷新联系