ملحق الأدوات الخارجية

ملحق الأدوات الخارجية يسمح لك بتشغيل أوامر خارجية من محرر النصوص. بإمكانك توريد بعض المحتويات إلى أمر واستغلال مخرجاته ( على سبيل المثال، sed)، أو تشغيل أمر معرف مسبقا (على سبيل المثال، make).

Use the External Tools Manager to create and edit commands. To run an external command, choose it from the Tools menu.

10.4.1. الأوامر المضمّنة

The following commands are provided with the External Tools plugin:

Build

Runs make in the current document's directory.

Directory Listing

Lists the contents of the current document's directory in a new document.

Environment Variables

Displays the environment variables list in the bottom pane.

Grep

Searches for a term in all files in the current document directory, using pattern matching. Results are shown in the bottom pane.

Remove Trailing Spaces

Removes all spaces from the end of lines in the document.

10.4.2. تعريف أمر

To add an external command, choose Tools ◂ External Tools.

In the External Tools Manager window, click New. You can speficy the following details for the new command:

الوصف

This description is shown in the statusbar when the menu command is chosen.

Accelerator

أدخل اختصار لوحة مفاتيح للأمر.

الأوامر

The actual commands to be run. Several gedit environment variables can be used to pass content to these commands: see باب 10.4.4 ― Variables.

Input

The content to give to the commands (as stdin): the entire text of the current document, the current selection, line, or word.

المُخرج

What to do with the output of the commands: display in the bottom pane, put in a new document, or place in the current document, at the end, at the cursor position, or replacing the selection or the entire document.

Applicability

Determines which sort of documents can be affected by the command, for example whether saved or not, and local or remote.

10.4.3. Editing and Removing Tools

To edit a tool, select it in the list and make changes to its properties.

To rename a tool, click it again in the list.

To restore a built-in tool that you have changed, press Revert.

To remove a tool, select it in the list and press Remove. You can not remove built-in tools, only those you have created yourself.

10.4.4. Variables

You can use the following variables in the Commands field of the command definition:

  • GEDIT_CURRENT_DOCUMENT_URI
  • GEDIT_CURRENT_DOCUMENT_NAME
  • GEDIT_CURRENT_DOCUMENT_SCHEME
  • GEDIT_CURRENT_DOCUMENT_PATH
  • GEDIT_CURRENT_DOCUMENT_DIR
  • GEDIT_DOCUMENTS_URI
  • GEDIT_DOCUMENTS_PATH