A good programmer must be familiar with the editor of his or her own, the UNIX programmer was very familiar with VI, later Linux facilitated the development of Emacs, both of these editors do not need the support of the mouse, and the appearance of the mouse to a large extent affect the speed of editing, Many programmers who write programs in Windows are slower, because more dependent on the mouse, switching between the mouse and the keyboard wasted a lot of time.
Here is a pattern I use JBuilder, I hope you can give me some other better mode and convenient shortcut keys.
First I chose to set keymapping as Emacs in preferences, because Emacs has more convenient features. We generally use CUA, the most common is the CTRL + C function, but we have reason to abandon it.
First of all, the most commonly used shortcuts for editing Java are the same in several keymapping.
Ctrl+h:member-insight, that's when we lose half the code, knock on this, the editor generates a hint, or you can get a "." , and then select Enter. At this point, if Emacs is selected, we can choose to go up and down with more convenience instead of looking for the up and down keys. In Emacs, the downward is CTRL + N, and the Ctrl+p,n on behalf of the Next,p Previos. In the presence of Member-insight, the two shortcuts are also easy to use, greatly facilitate the input.
Ctrl+j:expand-template, we write the program often write System.out.println (""), in JBuilder we only need to input ctrl+j out, then enter, there are many other, including main to write CTRL +j Main, these two shortcuts are available in both modes, and can be selected with the shortcut keys mentioned above. In Preferences->template we can also order our own template, such as writing a common copyright notice, and then assign a value.
Ctrl+shift+j:enter-sync-edit-mode, select a piece of code, and then press this key, entered the Sync-edit-mode, then a variable of this code changes, all the corresponding part of the code will change, very useful, This will not be because of the mess, missed the change of a variable name.
Ctrl+enter:find-definition,ctrl+shift+enter:find-references, for the first, if the cursor is on a variable, this will run to the variable life place, if the method and the source code will run to the method definition, If the class and the source code run to the class definition. The second is similar to where he is looking for references. These two benefits are obvious, especially when faced with an unfamiliar system, only to view the code.
Ctrl+shift+space. The cursor is moved to the parentheses of the method and then entered, and the prompt for the argument is displayed.
One feature that is often useful is to comment out a piece of code that is only in Cua, is ctrl+/, because Emacs has other uses, so the default is not set, so I usually change the settings to ctrl+shife+/.
These are the most commonly used, followed by Emacs-specific content.
Move the cursor. Several have been mentioned above, and the following are useful.
Ctrl+b back cursor
Ctrl+f forward Cursor
Ctrl + V next screen
Alt+v on a screen
Ctrl+e the end of a line
The beginning of Ctrl + a line
Alt+m a line before the first non-whitespace character.
Ctrl+x g moves to the specified line.
It is believed that with these keys, the hand does not need to move to the end,home and the mouse.
There is a copy paste, after all, ctrl+c,ctrl+v,ctrl+x used too much, do not always feel trouble, so I defined these, just add shift. Emacs itself has a number of similar functions.
Ctrl+k: Cut a row, ctrl+y: Paste back, and if you use a number of ctrl+k, point Ctrl+y can then choose Alt+y, so you can paste the contents of the previous cut back.
The combination of these two modes of copy paste, you can achieve more flexible editing.
Then the query, first press ctrl+s, and then enter the query content, you will find that this is an incremental query, you can immediately see the results. And then press Ctrl+s, you can find the next, Ctrl+r can find the previous one, if not input content, input two times ctrl+s, will find the contents of the last word.
Others need more, like Ctrl+z No, to use ctrl+shift+-. Save to Ctrl+x Ctrl+s, note that is pressed separately, press ctrl+x Jbulider the lower left corner will be displayed, and then press the latter one. Ctrl+x 1,ctrl+x 2,ctrl+x 3, see what it is. And one of them is ctrl+x ctrl+u. This allows you to convert all selected code to uppercase.
Commonly used on these, there are a lot of memory, see JBuilder settings will know. I hope you do not worry about the trouble to practice, you will find that the efficiency is high, perhaps later use Emacs will be faster.