Source: WeChat Official Account 【Fish Eagle Talks About Microcontrollers】
Author: Fish Eagle Osprey
ID: emOsprey
Hello everyone, I am Fish Eagle. Today I will share two editing techniques that I accidentally discovered, which can speed up your editing process.
Regarding editing techniques, I previously introduced “Editing Techniques and Methods in KEIL” in my notes, and here I will continue to share.
It should be noted that although the editing features of KEIL have always been criticized, many people have turned to platforms like VSCode, always complaining about the shortcomings of KEIL/MDK, I believe that the best tool is the one that suits you. I am most familiar with this platform, and it provides the highest development efficiency, so I will continue to use it (both for editing and debugging).
After all, the quality of code is not related to the platforms but to the people.
Back to the main topic, these two editing techniques may be known to some, but most people probably do not know them.
1.Align multiple cursors for modification (shift + alt + mouse selection or up/down keys)
We can see that there are a series of cursors after the include statement, allowing us to delete the corresponding lines.
This technique is very useful when editing multiple lines of code, for example, when you need to change the name of a structure, this makes it very convenient.
This technique cannot be used in lower versions of MDK, such as 5.14. However, it can be used in 5.27, but I am not sure which version supports it.
2.Random multiple cursor selection (ctrl + mouse selection)
As we can see, the gray vertical lines above are editable positions, unlike the previous method, which has limitations.
However, the advantage of the previous method is that under the same format, the selection speed is faster. Currently, this technique requires selecting each position, which is a bit cumbersome but more flexible.
Finally, I recorded a video for everyone to learn. You can see that with these two techniques, the editing speed has greatly improved (and these techniques are not exclusive to MDK; other software may also support them, such as Notepad).