Geany External Tools plugin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Adrian Malacoda d79c8c0838 define GEANY_PRIVATE to try to get access to geany internals (no idea if this will work but it gets rid of implicit declaration warnings at least) 4 months ago
COPYING Initial commit. 5 years ago
Makefile generate plugin directory if it does not exist 4 months ago
README.md no sudo 5 years ago
dialog.c Initial commit. 5 years ago
external-tools.c define GEANY_PRIVATE to try to get access to geany internals (no idea if this will work but it gets rid of implicit declaration warnings at least) 4 months ago
guix.scm Add guix.scm build file. 4 months ago
output.c Initial commit. 5 years ago
panel.c Initial commit. 5 years ago
table.c Initial commit. 5 years ago
tool.c Initial commit. 5 years ago
tool.h Initial commit. 5 years ago

README.md

Geany External Tools plugin

This is a plugin that allows you to define commands or scripts, which can be added to the menu and/or bound to keyboard shortcuts. It is similar to the External Tools plugin for gedit.

Installation

Install the build dependencies for geany and geany-plugins:

sudo apt-get build-dep geany geany-plugins

Then build and install the plugin. Do not use sudo for this.

make && make install

If Geany is already running, restart it.

Tool Options

Flags

The following flags modify the behavior or discoverability of the tool:

  • Save: Causes the active document to be saved when the tool is run.
  • Menu: Causes the tool to become available under the Tools menu.
  • Shortcut: Causes the tool to become available under the Edit -> Preferences -> Keybindings dialog, where a key binding can be assigned to it.

Output

This option controls where the tool sends its output:

  • None: The tool’s output is not shown.
  • Message Text: The tool’s output is displayed in the bottom panel, in the Tools section.
  • Replace Selected: The tool’s output replaces the currently selected text.
  • Replace Line: The tool’s output replaces the line under the editor cursor.
  • Append Current Document: The tool’s output is appended to the active document.
  • New Document: A new document containing the tool’s output is created.

Environment Variables

Tools have the following environment variables available to them:

  • GEANY_PROJECT_DIRECTORY: Root directory of currently open project, as defined in project configuration.
  • GEANY_SELECTION: The currently selected text.
  • GEANY_FILE_TYPE_NAME: Name of the active document’s type, e.g. “Markdown” or “Python”
  • GEANY_FILE_PATH: Path to current file.
  • GEANY_SELECTED_LINE: The line that the editor cursor is on.
  • GEANY_LINE_NUMBER: The line number of the line under the editor cursor.
  • GEANY_FILE_MIME_TYPE: MIME type of active document, e.g. “text/x-markdown” or “text/x-python”

Known Issues

  • “New Document” and current selection do not play well. This seems to be because the new document is created and is given focus before the selection is grabbed, resulting in an empty selection.

Acknowledgments

The original author of this plugin is Steven Blatnick steve8track@yahoo.com.