|
| 1 | +--- |
| 2 | +title: File Management |
| 3 | +--- |
| 4 | + |
| 5 | +import React from 'react'; |
| 6 | +import VideoPlayer from '@site/src/components/Video/player'; |
| 7 | + |
| 8 | +This section covers how **Phoenix Code Editor** lets you manage, organize, and navigate files and folders within your projects. |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## File Tree |
| 13 | + |
| 14 | +The **File Tree** appears in the sidebar and shows the complete folder structure of the open project. |
| 15 | +It lists all files and folders in a hierarchical view. |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +> All file and folder operations, such as creating, renaming, and deleting, is generally performed through the File Tree. |
| 20 | +
|
| 21 | +### File Tree Context Menu |
| 22 | + |
| 23 | +When you right-click within the File Tree, a context menu appears which allows you to perform various operations. |
| 24 | + |
| 25 | +- Right‑click a **file** → the action applies to that file. |
| 26 | +- Right‑click a **folder** → the action applies inside that folder (e.g., add file, create subfolder, delete contents). |
| 27 | +- Right‑click on **empty space** → the action applies to the project’s root directory. |
| 28 | + |
| 29 | + |
| 30 | +> In this example, `index.html` is selected. Any action from the context menu will apply to that file. |
| 31 | +
|
| 32 | +The File Tree updates automatically, but if files or folders appear missing, use `Refresh File Tree` option in the context menu to manually reload it. This option forces a full refresh of the tree view. |
| 33 | + |
| 34 | +You can also assign or update keyboard shortcuts for any File Tree action through the context menu. |
| 35 | +See the [Keyboard Shortcuts Guide](./Features/keyboard-shortcuts) for complete details. |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +### Sorting Files and Folders |
| 40 | + |
| 41 | +By default, the File Tree sorts folders first (in ascending order), followed by files. |
| 42 | + |
| 43 | +To sort folders and files together: |
| 44 | +1. Click the **arrows icon** at the top-right of the sidebar. |
| 45 | +2. In the dropdown, uncheck **Sort Folders First**. |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +Alternatively, you can control this behavior by updating the `sortDirectoriesFirst` property in the preferences file. |
| 50 | +See [Editing Preferences](./editing-text#editing-preferences) for details. |
| 51 | + |
| 52 | +Now, files and folders are sorted together in one ascending list. |
| 53 | + |
| 54 | +> Notice how the `images` folder now appears in alphabetical order with other items. |
0 commit comments