3

I want to execute some command with currently edited file as argument from within Geany, triggered by keyboard shortcut. For example:

I am editing /home/user/file.txt and after hitting "Ctrl+B" I want geany to execute

$ command /home/user/file.txt

Now I use embedded terminal, but it is not too comfortable solution.

Or maybe some other editor provides such functionality?

omicronns
  • 243
  • 1
  • 2
  • 6

1 Answers1

2

Yes, it's possible to perform this. You should open menu, choose "Build -> Set Build Commands" and change the contents of "Execute" field to

command "%f"

if you want to execute it in Geany terminal. Or if you'll be satisfied with executing the command in "Compiler" tab (it lacks interactivity, coloring support and so on), change the contents of "Compile", "Build", "Make" or "Make Object" field.

Then open menu, choose "Edit -> Preferences -> Keybindings -> Build" and change the shortcut for "Run" (or "Compile", "Build", "Make all", "Make object" respectively) to "Ctrl+B" or whatever you want.

There are few options, as you see, but if you need to execute just one command, it will be enough.

For details, look here.

alanubi
  • 36
  • 2