You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/05-file-management.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -298,3 +298,40 @@ When you reopen the editor, if there are any unsaved changes from the previous s
298
298
299
299
***Discard**: Removes the unsaved changes. *This will permanently delete the data.*
300
300
301
+
---
302
+
303
+
## Language and Encoding
304
+
305
+
Each file has two settings that control how **Phoenix Code** interprets its contents: the **language** it should be treated as, and the **character encoding** used to read and write it. Both are controlled from buttons in the editor's status bar.
306
+
307
+
### File Encoding
308
+
**File encoding** is the method used to represent text in a file by converting characters into bytes. We need it to ensure that text is displayed correctly across different platforms and to handle special characters or symbols. Phoenix Code Editor supports multiple file encoding formats.
309
+
310
+
*`UTF-8`* is the default encoding format in Phoenix.
311
+
312
+
#### Set Encoding of a file
313
+
1. Click on the `utf8` button on the status bar. (UTF-8 represents the default encoding format).
314
+
2. A list of available encoding formats will appear. Select your desired format, or start typing to filter and find matching options in the drop-down menu.
315
+
316
+

317
+
318
+
### File Type Associations
319
+
**File Type Associations***(Associating a file type with a language)* allows Phoenix Code Editor to provide language-specific features, such as syntax highlighting, code completion, and error checking, based on the file extension. This ensures that your files are treated according to their intended programming or markup language.
320
+
321
+
*When you create a new file, if the file extension is recognized, it is associated with the default language. If the extension is unknown, a generic text file is opened.*
322
+
323
+
#### Associate a new file type with a language
324
+
To associate a new file type with a specific language in Phoenix Code Editor, use the Language dropdown button in the status bar. For example, if you want files with `.myjs` extension to be treated as JavaScript files, follow these steps:
325
+
1. Create a new file with the desired extension. For our example, we create (newfile.myjs). By default, it will be associated with a Text file.
326
+
2. Click on `Text` button on the status bar.
327
+
3. A list of all the supported languages will appear. Select the language you want to associate with the file type. For our example, we select `JavaScript`.
328
+
329
+

330
+
331
+
4. At the top of the popup box, you'll find an option labeled `Set as default for .myjs files`. Click on it.
332
+
333
+
Now, files with `.myjs` extension will be treated as JavaScript files.
0 commit comments