Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to auto indent in CodeComposer

Other Parts Discussed in Thread: CODECOMPOSER

Hi All!

I'm try to switching from IAR to CodeComposer and I'm evaluating the CodeComposer.

In IAR, if I select a part of code, and I press "CTRL+T" the code select automatically will be indent.

In codecomposer I don't find the same function... Can you told me how to autoindent a select portion of code or all the .c file?

Many thanks

  • Hi,

    In CCS 5 (that's based on Eclipse and has default Eclipse features) select the text and press Ctrl + Shift + F. If you want to change the shortcut keys you cand do it in: Window -> Preferences -> General -> Keys and search for 'Format'.

    Regards

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------

    If my reply answers your question please click on the green button "Verify Answer".

  • Ok! this is the 50% of my answer!

    Many thanks! This answer is a very good information! I need to know only one last information: how for do this only to a selected line?

    In yoiu way ALL the file .c is modified but some line must be  keep as is... So I need a command to apply this preference to only a portion af code.

    Now I check the :  Window -> Preferences -> General -> Keys and search for 'Format'.for any other information!

    Many thanks! 

  • Hi,

    It will indent the lines you selecte, you can do it for only one line, a piece of code (e.g a for and its content) or the whole code of the file.

    Regards

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------

    If my reply answers your question please click on the green button "Verify Answer".

  • Ok, Many thanks!

    I try and it works! Before I try in a wrong way and it indented all code for a my error.

    Many many thanks!

  • @ Johns,

    Thanks this information is useful, but would like to know how to change the default indentation settings in CCS?

    Thanks in advance.

    Mohseen

  • Hi,

    In CCS menu go to Window->Preferences and type indent in the box in the upper left corner.
    You'll see two items:
    C/C++ -> Code Style and
    C/C++ -> Editor -> Typing
    In the second one you have a few options, but it also has a link to the first one.
    In the first yo ucan select the profile that you're going to use and you can edit it and create a new profile.
    This way you can create your own indent profile and adjust it as you want.

    BR

  • Thanks I got it.