All Collections
Files Management
File Manager
How to Use the File Editor at Hostinger
How to Use the File Editor at Hostinger

Working with text-based files directly from the File Manager edit option

Updated over a week ago

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:

The File Manager edit option

How to Use the File Editor

The File Editor has the following sections and buttons:

The File Editor sections and buttons
  1. Close button - Exits the File Editor

  2. Name of the currently open file

  3. Save button - Saves the changes

  4. Breadcrumb - Shows the path from your website root directory (public_html) to the currently open file

  5. Line numbers - Indicates the line number. It will also show syntax error indicators and the code folding toggle when applicable

  6. 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:

The File Editor showing a syntax error and error description

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 🚀

Did this answer your question?