ArticleDirectory
- Use the shortcut key Alt + Shift + F10/Ctrl +.
- Select using ALT rectangle
- Press ctrl to select all the words, which is equivalent to double-click all
- Use the home and end keys
- Use SHIFT + DEL to delete the entire row
- Use code segment
- Use a keyboard with a red hat
- Set Input Method
- Code Generation
Share my coding habits. You can leave a message to add a better method.
Use the shortcut key Alt + Shift + F10/Ctrl +.
This is a shortcut that I like to use. You can add references directly.
For example, we need to use the thread sleep method, but the default value isCodeThere is no reference to the Thread class. If we move the mouse to the top to add using system. Threading; it would be too slow...
We can directly press the thread and press the combination key. Then press enter to automatically add the reference.
Thank you, Vincent Yang. I realized that Alt + Shift + F10 had a more convenient shortcut key (CTRL +.), which made it easier.
Select using ALT rectangle
When We splice HTML strings in the CS code, we use more, or splice JSON strings.
When we hold down ALT and drag the mouse, a rectangular selection area will be selected.
For example:
JS = @" VaR store = new Ext. Data. jsonstore ({
Fields: ['name', 'siwang', 'chusheng', 'biandong '],
Data :[
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C1.tostring () + @" , Chusheng: " + B1.tostring () + @" , Biandong: " + D1.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C2.tostring () + @" , Chusheng: " + B2.tostring () + @" , Biandong: " + D2.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C3.tostring () + @" , Chusheng: " + B3.tostring () + @" , Biandong: " + D3.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C4.tostring () + @" , Chusheng: " + B4.tostring () + @" , Biandong: " + D4.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C5.tostring () + @" , Chusheng: " + B5.tostring () + @" , Biandong: " + D5.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C6.tostring () + @" , Chusheng: " + B6.tostring () + @" , Biandong: " + D6.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C7.tostring () + @" , Chusheng: " + B7.tostring () + @" , Biandong: " + D7.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C8.tostring () + @" , Chusheng: " + B8.tostring () + @" , Biandong: " + D8.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C9.tostring () + @" , Chusheng: " + B9.tostring () + @" , Biandong: " + D9.tostring () + @" },
{Name :' " + (Year2 ++ ) + @" ', Siwang: " + C10.tostring () + @" , Chusheng: " + B10.tostring () + @" , Biandong: " + D10.tostring () + @" }
]
}); " ;
After modifying the preceding code, we can select a rectangle and copy it to the back.
Press ctrl to select all the words, which is equivalent to double-click all
This is relatively simple. When we replace variables consecutively, we use more. Copy a variable and press Ctrl, click the variable to be replaced, and then press C. This is very convenient.
Use the home and end keys
For example, if our cursor stays in the middle of a line of code and we want to copy this line of code, most people may have to use the mouse. In this case, we can press the Home Key and hold down shift in the left hand, then press the end key,
Because the home and end keys are tied together on the keyboard, It is very convenient.
Home => press shift => end and then Ctrl + C.
In other cases, it is convenient to use home and end to directly switch to the end of the first line.
Use SHIFT + DEL to delete the entire row
This is also my favorite shortcut key, which deletes the line of code where the cursor is located.
When I was using this Code, for example, I copied a line of code and started to change it from the end of =. I directly wrote the new Code. Then I press enter and press SHIFT + DEL to delete all the subsequent junk code, in this way, we do not need to move the mouse to select and then delete, saving a lot of time.
Use code segment
When writing for or foreach, we can write only one for or foreach, and then press two consecutive tabs to automatically generate for and foreach loops.
There are many other code segments. For and foreach are usually used.
Use a keyboard with a red hat
The most annoying thing for our coding staff is that when we put both hands on the keyboard for encoding, some operations need to be raised and operated with the mouse, which is a waste of time.
So we can use a keyboard with a little red hat, such as a ThinkPad notebook. When you use it for a while, you will find that little red hat can be equivalent to 80% of the mouse.
For example, if we want to move the cursor while coding, we can use little red hat to be competent. As long as it is not a high-precision mouse operation, I don't need to insert the mouse and use little red hat to play Dota.
Now, my colleagues have five or six new laptops, all of which are ThinkPad... I am a little suspected of advertising, but it is really convenient.
Set Input Method
1) set punctuation to English
I use QQ's Pinyin input method now. Now I should use this method more than sogou.
I usually set the punctuation marks of the Input Method to English. Because English Punctuation Marks are used for encoding, we can add some comments when we cut them into Chinese characters and then enter the code again. available directly
2) Check the existing results in the input window.
Another input method is to check the existing results in the input window when switching the input method. Many times we forget to cut the code into English, therefore, a new method is used for Chinese Input. If an existing result output is checked, the new method is directly switched back to the English input method, which is directly output to the code, you don't have to create a new one.
Code Generation
The future programming trend. From the petshop era, we began to use code to generate underlying classes. Now it is more convenient to use LINQ directly.
1) generate a database based on the database document
I don't know how the project is implemented. We design the database documentation and then generate the database directly according to the database documentation.
I will have the opportunity to write another article in the future. I will briefly introduce my implementation methods:
First, our database documents are in this format Word documents:
The table name is the title, and The following table contains the Chinese name and English name of the field.
Then, we can convert the Word document to HTML format and use the htmldocument class to parse the html
The generated database fields are described in Chinese.
Chinese description is very important, because we can generate the underlying layer with field annotation and generate the apsnet page.
I first generate the underlying layer and page, and then add instructions for every field when I create a database again. This is a very troublesome way to generate a database...
For the time being, I would like to think about the smart prompts of Ctrl + J so that everyone on Earth will know nothing.
You are welcome to add