You can open and edit any text file from the File Manager, such as files with html or php extensions, the .htaccess file, and more. It provides a convenient way to work on your files without having to download them to your local device and re-upload them every time.
Making changes to your files may cause errors on your website - create a copy of the file before editing, and proceed with caution!
How to Open the File Editor
To open the File Editor from the File Manager, double-click on the file name. Alternatively, you can right-click on the file and select Edit:
How to Use the File Editor
The File Editor has the following sections and buttons:
Close button - Exits the File Editor
Name of the currently open file
Save button - Saves the changes
Breadcrumb - Shows the path from your website root directory (public_html) to the currently open file
Line numbers - Indicates the line number. It will also show syntax error indicators and the code folding toggle when applicable
Editor Area - Shows the file contents. To start editing the file, click on any line to show the cursor
The editor supports syntax highlighting out-of-the-box for the most common programming languages, marking errors with a ❌ next to the line. Hover on it to find more information about the error:
Once you have finished editing your file, make sure to click on the Save button to apply the changes. If you don't wish to keep them, click on the Close button - a popup will indicate that changes will be lost. Click OK to leave without applying the changes.
Keyboard Shortcuts
The File Editor supports the following keyboard shortcuts:
Navigation
Command | Windows/Linux | MacOS |
Find | Ctrl+F | ⌘+F |
Find all | Ctrl+Alt+K | ⌘+Option+K |
Find next | Ctrl+K or Alt+K | ⌘+K or Option+K |
Find previous | Ctrl+Shift+K or Alt+Shift+K | ⌘+Shift+K or Option+Shift+K |
Replace | Ctrl+H | ⌘+H |
Go to the next error | ALT+E | Option+E |
Go to the previous error | ALT+Shift+E | Option+Shift+E |
Basic Editing
Command | Windows/Linux | MacOS |
Select all | Ctrl+A | ⌘+A |
Copy | Ctrl+C | ⌘+C |
Cut | Ctrl+X | ⌘+X |
Paste | Ctrl+V | ⌘+V |
Undo | Ctrl+Z | ⌘+Z |
Redo | Ctrl+Y or Ctrl+Shift+Z | ⌘+Y or ⌘+Shift+Z |
Toggle overwrite mode | Insert | Insert |
Indent | Tab | Tab |
Outdent | Shift+Tab | Shift+Tab |
Block indent | Ctrl+] | ⌘+] |
Block outdent | Ctrl+[ | ⌘+[ |
Convert selection to uppercase | Ctrl+U | ⌘+U |
Delete the whole line | Ctrl+D | ⌘+D |
Duplicate selection or current line | CTRL+Shift+D | ⌘+Shift+D |
Sort selected lines alphabetically | Ctrl+Alt+S | ⌘+Option+S |
Toggle comment* | Ctrl+/ | ⌘+/ |
Toggle block comment* | Ctrl+Shift+/ | ⌘+Shift+/ |
* Available only if the file is written in a supported language.
Editing Blocks of Code
Use the following shortcuts by selecting one or more lines of code - they will be placed above or below the current selection according to the command:
Command | Windows/Linux | MacOS |
Move lines up | Alt+Up arrow | Option+Up arrow |
Copy lines up | Alt+Shift+Up arrow | OptionShift+Up arrow |
Move lines down | Alt+Down arrow | Option+Down arrow |
Copy lines down | Alt+Shift+Down arrow | OptionShift+Down arrow |
Code Folding
If the file is written in a supported language, folding and unfolding will detect code regions and allow expanding/contracting using the toggle fold.
The toggle fold can also be used by clicking on the arrow in the line number section.
Command | Windows/Linux | MacOS |
Toggle fold | F2 | F2 |
Fold | Alt+L | Option+L or ⌘+F1 |
Unfold | Alt+Shift+L or Ctrl+Shift+F1 | Option+Shift+L or ⌘+Shift+F1 |
That's it! Now you know how to edit your files using the File Editor 🚀