Is there any shortcut for CodeBlocks to format the code?

雨燕双飞 提交于 2019-12-18 14:05:18

问题


Is there any shortcut for CodeBlocks to format the code?

I haven't find any tip in google.

I found only "format use AStyle", but it come up with right mouse button only...


回答1:


probably not by default but you should be able to assign it there:

Settings -> Editor -> Keyboard shortcuts -> Plugins -> Source code formatter (AStyle)




回答2:


My favourite = Ctrl + A then Ctrl + Shift + F.

You (these are the default settings I believe) can select a block of code and press the Tab key. This will indent the entire block.

So for indenting a whole file: Ctrl + A, then Tab.

In addition, you can use Shift + Tab on a selected block to "unindent"

You can move through the open tabs with Ctrl + Shift + Tab.

As for the best shortcuts:

I like Ctrl + D to duplicate a line and

Ctrl + L to copy it.

Anyway, you can set whatever shortkeys you like in the Editor menu (there you will also be able to find all shortkey currently set).



来源:https://stackoverflow.com/questions/26278082/is-there-any-shortcut-for-codeblocks-to-format-the-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!