When you create file in CLion, the following header is placed in the top of file:
//
// Created by <username> on 14.01.18.
//
Someone can remove this header by go to Settings
→ Editor
→ File and Code Templates
→ Includes
→ C File Header
. There will be text:
#if ($HEADER_COMMENTS)
//
// Created by $USER_NAME on ${DATE}.
#if ($ORGANIZATION_NAME && $ORGANIZATION_NAME != "")
// Copyright (c) $YEAR ${ORGANIZATION_NAME}#if (!$ORGANIZATION_NAME.endsWith(".")).#end All rights reserved.
#end
//
#end
I can delete this text and header will be removed. But looks like if I set $HEADER_COMMENTS
variable to false
then header will be removed too. So my question is:
What is $HEADER_COMMENTS
variable and how can I change it?
If header and implementation files are already open you can switch between windows with double-shift and enter keys.
Go to Header/Source To invoke Go to Header/Source, press F10 or call Navigate | Header/Source from the main menu.
Save a file as a template Open a file in the editor. From the main menu, select File | Save File as Template. In the Save File as Template dialog, specify the new template name and edit the body, if necessary. Apply the changes and close the dialog.
I found this post at when searching to do the same thing. I didn't want to delete the whole thing as I'm using CLion for college and I might have a use for a template but I don't like the current one. I "fixed" it by making the test a not if for now. I said I'd put it here in case anyone else came searching for the same idea.
#if (!$HEADER_COMMENTS)
//
// Created by $USER_NAME on ${DATE}.
#if ($ORGANIZATION_NAME && $ORGANIZATION_NAME != "")
// Copyright (c) $YEAR ${ORGANIZATION_NAME}#if (!$ORGANIZATION_NAME.endsWith(".")).#end All rights reserved.
#end
//
#end
See https://www.jetbrains.com/help/clion/creating-and-editing-file-templates.html
Apparently the variable ${HEADER_COMMENTS}
is always true and used for testing purposes, so you can't influence it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With