Skip to content

Repository files navigation

Code Runner

Version Acode License

A lightning-fast, highly configurable code runner plugin for the Acode editor.

Automatically adds a "Play" button to your editor header and supports running any programming language directly inside an integrated, half-screen bottom terminal.

📦 Installation & Setup

  1. Install Plugin: Install Code Runner from the Acode plugin store (or manually sideload the plugin.zip).
  2. Install Compilers: Since Acode runs on Android, the terminal is powered by a lightweight Alpine Linux subsystem. To actually execute Python, JavaScript, or C++, you must install their compilers into the terminal first!
    • Open Acode's Terminal
    • Run apk add python3 (for Python support)
    • Run apk add nodejs (for JavaScript support)
    • Run apk add g++ (for C++ support)
    • Run apk add bash (for Bash scripting support)

🚀 How to Use

  1. Run a File: Tap the Play (▶️) button in the top right header, or press F5 / Ctrl+Alt+N.
  2. Run a Snippet: Highlight specific lines of code and press Play to execute only the highlighted selection.
  3. Hide Terminal: Drag the terminal handle down, click the 'X', or press Ctrl+J.

⚙️ Configuration

To edit your execution rules, open the Acode Command Palette (Ctrl+Shift+P) and select Code Runner: Edit Config.

The plugin supports dynamic variables inside your commands:

  • {file} : Absolute path to your file (e.g., /sdcard/Project/main.py)
  • {dir} : Absolute path to the file's directory (e.g., /sdcard/Project)
  • {fileName} : Name of your file (e.g., main.py)
  • {fileNameWithoutExt} : Name without extension (e.g., main)
  • {workspaceRoot} : Absolute path to the active project folder you opened in Acode.

Example code-runner.json

{
  "clearPreviousOutput": true,
  "saveFileBeforeRun": true,
  "saveAllFilesBeforeRun": false,
  "preserveFocus": true,
  "ignoreSelection": false,
  "showExecutionMessage": true,
  "respectShebang": true,
  "fileDirectoryAsCwd": false,
  "executorMapByExtension": {
    ".py": "python {file}",
    ".js": "node {file}",
    ".sh": "bash {file}",
    ".cpp": "g++ {file} -o {dir}/{fileNameWithoutExt} && {dir}/{fileNameWithoutExt}",
    ".c": "gcc {file} -o {dir}/{fileNameWithoutExt} && {dir}/{fileNameWithoutExt}"
  },
  "executorMapByGlob": {
    "pom.xml": "cd {dir} && mvn clean package",
    "Makefile": "cd {dir} && make"
  }
}

Settings Breakdown

  • clearPreviousOutput: Clears the terminal screen before executing new code.
  • saveFileBeforeRun: Automatically saves the active file before running.
  • saveAllFilesBeforeRun: Automatically saves all open files before running.
  • preserveFocus: Keeps your keyboard cursor inside the editor instead of jumping to the terminal.
  • ignoreSelection: Disables snippet extraction (always runs the whole file even if text is highlighted).
  • showExecutionMessage: Toggles the [Running] and [Done] exited with code... logs in the terminal.
  • respectShebang: Automatically reads the first line (e.g., #!/bin/bash) of extensionless files to determine how to run them.
  • fileDirectoryAsCwd: Automatically cds into the file's folder before executing it.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages