Does anyone know how can I make a certain part of code always appear in Clion.And also how can I save a file as a template so that it appears without rewriting it?I searched the net but didn't see anything.
I got the solution to create templates Thanks to the comments.Now the only problem remaing is the following how can I make a part of code always appear when oppening a new file.More precisly I wan't this part always appear:
inclue <bits/stdc++.h>
using namespace std; int main(){ ios::sync_with_stido(false): cin.tie(nullptr);
return 0;
}
Well, there exists something called Live Templates (another name for Snippets)
Thanks a lot what if I want a part of code always appear without mention(include or return part?)
Go to settings or preferences (in Mac), then under the Editor section , you have Live Templates, select C/C++ and then click on '+'. Add your snippet with your abbreviation and a brief description (if u want). And you are done . Just use your abbreviation and CLion gives you the whole snippet.
Thanks.Do you have any idea on how to make a certain part of code always appear(in mean #include part ans similar things?
Yes
So what is the idea?
Like what do you want to achieve finally? You have your snippet and you want to use that as live template right ?
Yes but in that way you have to write the abbrivation to make it appeare I want it to be there creating any new file.Without writing the abbrivation.
Auto comment: topic has been updated by Taha1506 (previous revision, new revision, compare).