RainFall's blog

By RainFall, history, 4 years ago, In English

I use Geany for coding. Everything is fine & OK. But I want to load my template file from the terminal. Because copy pasteing everytime form anthoer file or opening template from dropdown menu is too much work in contest time. I added my custom template in this directory ( ~/.config/geany/templates/files/ ) but after doing so, when I type -> (geany 1.cpp &) on terminal, template file is not loading.

I tried to find the configuration in internet. But I got nothing about it & template documentation is just about adding another file in the dropdown menu so, it's not helpful. But I saw Errichto doing it all the time while streaming. His template is loading when he open a file from the terminal.

So, anyone who use Geany. Can you tell me about this configuration? That would be much help.

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

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I've created a script for the template copying. If file exists, doesn't overwrite but open it. Else it creates a copy of your template then opens it.

See if it helps. Link

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Well, you can just make a template.cpp file and go cp template.cpp problemname.cpp every time you solve something. At least that's what I do.

»
4 years ago, # |
Rev. 2   Vote: I like it -8 Vote: I do not like it

You can make some script like

cp your_template_file_path_goes_here $1.cpp
geany $1.cpp &

and you can for example just in terminal do

./scrip_name A

it will create a file called A.cpp contains whatever it is in your template and then open it using geany

  • »
    »
    4 years ago, # ^ |
      Vote: I like it -7 Vote: I do not like it

    Actually, you need to make it executable before using ./scrip_name

    So, all you need to do is just chmod +x script_name at first to give the file an executable attribute.

    I believe you can also just do bash script_name and it will work completely fine.