Editors for Keysharp Scripts
Any text editor can edit a Keysharp .ks or .ahk script. Keysharp includes Keyview, its cross-platform script viewer/editor utility.
Because Keysharp targets the AutoHotkey v2 language, AutoHotkey-aware editors can also make Keysharp scripts easier to read and edit. They may provide:
- Syntax highlighting, like what is used in this documentation. With syntax highlighting, words, symbols and segments of code are colour-coded to indicate their meaning. For instance, literal text, comments and variable names are displayed in different colours.
- Auto-complete, which typically offers a list of suggestions when you start typing the name of a known function or variable.
- Calltips may show you what the parameters are for a function while you are writing code to call the function.
- Interactive debugging, such as to step through the script line by line and inspect variables at each step, or to view and modify variables or objects, beyond what ListVars allows.
Options:
- Keyview is distributed with Keysharp and is the most directly Keysharp-oriented option.
- VS Code with AutoHotkey v2 Language Support provides language tooling and can be configured to launch
Keysharp.exe.
- SciTE4AutoHotkey and other AutoHotkey tools can provide compatible editing features, but their run/debug commands may require manual Keysharp configuration.
Third-party notice: The projects below are not part of Keysharp. References are provided for compatibility and convenience.
SciTE4AutoHotkey
SciTE4AutoHotkey is a custom version of the text editor known as SciTE. Its features include:
- Syntax highlighting
- Auto-complete
- Calltips
- Smart auto-indent
- Code folding
- Interactive debugging
- Running the script by pressing a hotkey
- Other tools for AutoHotkey scripting
SciTE4AutoHotkey can be found here: https://www.autohotkey.com/scite4ahk/
Visual Studio Code (VS Code)
Visual Studio Code can be configured with a high level of AutoHotkey v2 language support that is also useful for Keysharp.
AutoHotkey2 Language Support provides many features, including:
- Syntax highlighting
- Auto-complete
- Calltips
- Smart auto-indent
- Code folding
- Running the script by pressing a hotkey
- Real-time diagnostics (detecting common errors)
- Formatting/tidying code
Additional notes:
- Set the extension's interpreter/executable path to your installed
Keysharp.exe when you want its run command to execute Keysharp.
- This extension only supports AutoHotkey v2, but can also detect v1 scripts and automatically switch over to a v1 extension if one is installed.
- This extension can also be used with other editors, such as vim, neovim and Sublime Text 4. For details, see Use in other editors. However, VS Code likely provides the best experience, with easiest setup.
vscode-autohotkey-debug provides support for interactive debugging of v1 and v2 scripts.
Notepad++
Notepad++ can be configured to support the following features:
- Syntax highlighting
- Auto-complete
- Code folding
- Running the script by pressing a hotkey
See Setup Notepad++ for AutoHotkey for instructions.
Notepad4
Notepad4 supports the following for AutoHotkey v2 by default:
- Syntax highlighting
- Auto-complete
- Auto-indent
- Code folding
- Running the script by pressing a hotkey
It is available here: https://github.com/zufuliu/notepad4
Others editors
For help finding or configuring other editors, try the Editors sub-forum.
To get an editor added to this page, post in the Suggestions sub-forum or open an Issue or Pull Request at GitHub.