Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to create a "C++ Class" document template, I know you can make static ones by putting them into ~/Templates, but I would like to be able for the content to change according to the file name on creation, for example, using a template like such (pseudocode):

#ifndef $(filename)_HPP_INCLUDED
#define $(filename)_HPP_INCLUDED

class $(filename) {

#endif $(filename)_HPP_INCLUDED

Is this possible? If so, how can I do it? Thanks in advance, ell.

share|improve this question

There is possible way to do that. Look at "Nautilus Actions". You can write your bash script which reads class name from stdin creates .h and .cpp files. Add it to nautilus actions. Allow this script to be executed from directories you want.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.