Q:

typesafe config: define global configurations to be used in "sub-configs "

I have a large config fileand I would like to avoid writing duplicates.
example:
shared_part: {
}

cof1 {
 . . . 
 subconf {
   shared: shared_part
 }
}

cof2 {
 . . . 
 subconf {
   shared: shared_part
 }
}

I tried to import the shared_parby simply writing it as it is and by ${shared_part}but none worked.
how would be the correct way to do it?

A:

Firstly, I would recommend against big config files if the config blocks are meant to be used in different contexts, as I suppose your conf1 and conf2 do. 
Define all your common properties in a sharedPart.conf (the naming is for the sake of your example), and the others in conf1.conf and conf2.conf.
Afterwards, in order to use the common properties within the last two files, add the following to the head of the files:
include "sharedPart.conf"

