Блог пользователя RainFall

Автор RainFall, история, 4 года назад, По-английски

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.

  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

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 года назад, # |
Rev. 2   Проголосовать: нравится -8 Проголосовать: не нравится

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 года назад, # ^ |
      Проголосовать: нравится -7 Проголосовать: не нравится

    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.