# Edit

Opens the current script for editing in the associated editor.

    Edit

The Edit command opens the current script for editing using the associated "edit" verb in the registry (or Notepad if no verb). However, if an editor window appears to have the script already open (based on its window title), that window is activated instead of opening a new instance of the editor.

This command has no effect when operating from within a compiled script.

On a related note, AutoHotkey syntax highlighting can be enabled for various editors - see below. In addition, context sensitive help for AutoHotkey commands can be enabled in any editor via this example. Finally, your productivity may be improved by using an auto-completion utility like ISense, which works in almost any editor. It watches what you type and displays menus and parameter lists, which does some of the typing for you and reminds you of the order of parameters.

### Related

Reload

### Example

    Edit ; opens the script for editing.

    ; If your editor's command-line usage is something like the following,
    ; this script can be used to set it as the default editor for ahk files:
    ;
    ;   Editor.exe "Full path of script.ahk"
    ;
    ; When you run the script, it will prompt you to select the executable
    ; file of your editor.
    ;
    FileSelectFile Editor, 2,, Select your editor, Programs (*.exe)
    if ErrorLevel
        ExitApp
    RegWrite REG_SZ, HKCR, AutoHotkeyScript\Shell\Edit\Command,, "%Editor%" "`%1"

### Editors with AutoHotkey Support

SciTE4AutoHotkey is a custom version of the text editor known as SciTE, tailored for editing AutoHotkey scripts. Its features include:

- Syntax highlighting
- Smart auto-indent
- Auto-complete
- Calltips (also known as IntelliSense)
- Code folding
- Support for interactive debugging
- Other tools for AutoHotkey scripting

SciTE4AutoHotkey can be found here: http://www.autohotkey.com/forum/topic58820.html

Other editors for which AutoHotkey syntax highlighting can be enabled:

- AkelPad - http://www.autohotkey.com/forum/topic23586.html
- Crimson Editor - http://www.autohotkey.com/forum/topic5506.html
- Eclipse, FAR manager, and any other editors which use Colorer take5 - http://www.autohotkey.com/forum/topic10378.html
- Emacs - http://www.autohotkey.com/wiki/index.php?title=Emacs
- Notepad++ - http://www.autohotkey.com/forum/topic58792.html
- Notepad2 - http://www.autohotkey.com/forum/viewtopic.php?t=37652
- PSPad - http://www.autohotkey.com/forum/topic9294.html
- SciTE and possibly other Scintilla based editors - http://www.autohotkey.com/forum/topic9656.html
- Sublime Text Editor - http://www.autohotkey.com/forum/viewtopic.php?p=368326#368326
- Total Commander with Synplus plugin - http://www.autohotkey.com/forum/topic7278.html

Additionally, the zip download of AutoHotkey Basic (http://www.autohotkey.com/download/) includes files for enabling syntax highlighting in the following editors. However, some of these files are badly out of date and may or may not work:

- ConTEXT
- EditPlus
- EmEditor
- jEdit
- MED
- TextPad
- UltraEdit
- Vim

If your favourite editor isn't listed here, try your luck by searching the forums.

To get an editor added to this page, contact Lexikos via the forums.