Monkey_D_Luffy_1999's blog

By Monkey_D_Luffy_1999, 3 years ago, In English,

Hi everyone! Could you help me to find where can I make a default source and open it in Codeblocks? Thanks.

 
 
 
 
  • Vote: I like it  
  • +7
  • Vote: I do not like it  

»
3 years ago, # |
  Vote: I like it +12 Vote: I do not like it

Go to Settings -> Editor -> Default Code and enter the source you want.

»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

It doesn't work for main.cpp file, when you're creating new project. Only for new file in the existing project.

»
3 years ago, # |
  Vote: I like it +2 Vote: I do not like it

If you want to change default code of main.cpp when you create new project in CodeBlocks then here is my way (I tested on Windows):
- Go to Program Files/CodeBlocks/share/CodeBlocks/templates/wizard/console/cpp.
- You'll see file main.cpp, what you need is just edit content of this file to your default code.
Hope this will help you!

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks, you are the best.

  • »
    »
    22 months ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    i did it but when i am creating a new file with CTRL+SHIFT+N , it happens to be blank file

    • »
      »
      »
      22 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      You can use code abbreviation. Go to codeblocks->setting -> Abbreviation. Then create a new keyword and paste your default code and save it. Then every time you open a new file .....save it. Then write the keyword you created.then press ctrl+j. Your default code will appear... ;D

      • »
        »
        »
        »
        22 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Yeah , that is a way :) Thank you.

      • »
        »
        »
        »
        17 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Thanks that was really helpful. I am now using it. I guess most people don't know about it.

        • »
          »
          »
          »
          »
          16 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          do you know how to do this in sublime text editor???

      • »
        »
        »
        »
        16 months ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I could not find Abbreviation in setting. Where is it?

        • »
          »
          »
          »
          »
          16 months ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          Just follow, Settings => Editor => Abbreviation

  • »
    »
    4 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It says that I don't have permission from owner to change it.