ExternalTools
Run any external tool with an keyboard shortcut and/or via the command palette.
Details
Installs
- Total 886
- Win 513
- Mac 223
- Linux 150
Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
External Tools - Sublime Text
Run any external tool with an keyboard shortcut and/or via the command palette.
Quickstart
- Install via PackageControl:
External Tools
- Open Preferences –> Key bindings
- Add
{ "keys": ["alt+1"], "command": "external_tools_run", "args": {"cmd": ["explorer.exe", "/select,", "$file"]}}
- Save & close
- Press
ALT+1
Installation
Package Control
If you have PackageControl installed, you can use it to install the package.
Just type CTRL+SHIFT+P
(or if you're on a mac: CMD+SHIFT+P
) to bring up the command pallete and pick Package Control: Install Package from the dropdown, search and select External Tools
there and you're all set.
Manual installation
- Enter directory through Preferences –> Browse Packages… in the Sublime Text menu.
Run the following command from your command line
git clone https://github.com/FelixBoers/sublime-external-tools.git ./ExternalTools
Usage
Custom key bindings
You can add custom keybinding by go to Settings -> Key Bindings and bind your keystrokes to the external_tools_run
command.
Open Windows Explorer with the current file selected: “json { "keys”: [“alt+1”], “command”: “external_tools_run”, “args”: {“cmd”: [“explorer.exe”, “/select,”, “$file”]}}
Open Git bash in the current project root or if no project is opened in the root of the first opened folder “json { "keys”: [“alt+2”], “command”: “external_tools_run”, “args”: {“cmd”: [“C:/Program Files/Git/bin/bash.exe”], “working_dir”: “${project_path:$folder}” }}
Custom entries in the command palette
In the same way you can define your own entries in the command palette (CTRL + SHIFT + P). Go to Preferences –> Package Settings –> External Tools –> Command Palette and add:
{
"caption": "Cmd here",
"command": "external_tools_run",
"args": {
"cmd": [ "cmd.exe", "/K"],
"working_dir": "${project_path:$folder}"
}
}
Shared configurations
If you want to open the app via key binding or via the command palette you can define the app in the plugin settings Preferences –> Package Settings –> External Tools –> Settings.
This is how a configuration could look like:
{
"apps": [
{
"id": "explorer",
"name": "Explorer",
"cmd": [
"explorer.exe",
"/select,",
"$file"
]
},
{
"id": "cmd",
"cmd": ["cmd.exe", "/K"],
"working_dir": "$folder"
}
]
}
The key binding configuration should then look like: “json { "keys”: [“alt+3”], “command”: “external_tools_run”, “args”: {“id”: “explorer” }}
And the command palette configuration like this:
```json
{ "caption": "Cmd here", "command": "external_tools_run", "args": { "id": "cmd" } }
All apps defined in the plugin settings are listed if you run External Tool via the command palette.
Variables
Along to all your system environment variables the following variables are getting expanded too:
Variable | Description |
---|---|
$file | The full path to the current file, e.g., C:\Files\Chapter1.txt |
$file_path | The directory of the current file, e.g., C:\Files |
$file_extension | The name portion of the current file, e.g., txt |
$file_base_name | The name only portion of the current file, e.g., Document |
$packages | The full path to the Packages folder |
$folder | The path to the first folder opened in the current project |
$project | The full path to the current project file |
$project_path | The directory of the current project file |
$project_name | The name portion of the current project file |
$project_extension | The extension portion of the current project file |
$project_base_name | The name-only portion of the current project file |
$line_begin | The current line of the current file or the first line of the selection |
$line_end | The current line of the current file or the last line of the selection |
$line | Same as $line_begin |
Placeholder variables are supported too:
${project_name:Default} # Use 'Default' as project name if no project is open
${project_path:$folder} # If no project opened use first folder
The name of the placeholder is case sensitive!
Sample configurations
ConEmu with Git bash in current folder
{
"apps": [
{
"id": "conemu_git",
"name": "ConEmu (Git bash)",
"cmd": [
"C:\\\\Program Files\\\\ConEmu\\\\ConEmu64.exe",
"/Single",
"/Dir",
"${folder}",
"/Run",
"{Git bash}"
]
}
]
}
Windows Explorer with current file selected “json { "apps”: [ { “id”: “explorer”, “name”: “Explorer”, “cmd”: [ “explorer.exe”, “/select,”, “$file” ] } ] }