|
| 1 | +# Text Editor |
| 2 | + |
| 3 | +The CLI built-in `text-editor` command can be used to edit type `binary` |
| 4 | +settings in configure context. |
| 5 | + |
| 6 | +The default editor is a Micro Emacs clone. Users not familiar with |
| 7 | +terminal based editors may benefit from this introduction. |
| 8 | + |
| 9 | + |
| 10 | +## Escape Meta/Alt Control Shift |
| 11 | + |
| 12 | +When starting up, the editor status field at the bottom shows the |
| 13 | +following shorthand: |
| 14 | + |
| 15 | +``` |
| 16 | +C-h q quick help | C-h t tutorial | C-h b key bindings | C = Ctrl | M = Alt |
| 17 | +``` |
| 18 | + |
| 19 | +Key combinations with a `-` (dash) mean holding down the modifier key. |
| 20 | +Combinations without a `-` (dash) mean without any modifier key. |
| 21 | + |
| 22 | +### Quick help `C-h q` |
| 23 | + |
| 24 | + - hold down the `Ctrl` key on |
| 25 | + - tap the `h` key |
| 26 | + - release `Ctrl` |
| 27 | + - tap the `q` key |
| 28 | + |
| 29 | +The bottom part of the terminal now shows a "buffer" called `*quick*`: |
| 30 | + |
| 31 | +``` |
| 32 | +FILE BUFFER WINDOW MARK/KILL MISC |
| 33 | +C-x C-c exit C-x b switch C-x 0 only other C-space mark C-_ undo |
| 34 | +C-x C-f find C-x k close C-x 1 only this C-w kill-rg C-s search |
| 35 | +C-x C-s save C-x C-b list C-x 2 split two C-k kill-ln C-r r-search |
| 36 | +C-x s save-all C-x h mark C-x ^ enlarge C-y yank M-% replace |
| 37 | +C-x i insert C-x g goto-ln C-x o other win C-x C-x swap M-q reformat |
| 38 | +``` |
| 39 | + |
| 40 | +### Save & Exit `C-x C-c` |
| 41 | + |
| 42 | + - Hold down the Ctrl key |
| 43 | + - tap `X` |
| 44 | + - tap `c` |
| 45 | + - release `Ctrl` |
| 46 | + |
| 47 | +> The status field at the bottom asks if you are really sure, and/or if |
| 48 | +> you want to add a final Enter/newline to the file. For binary content |
| 49 | +> that final newline may be important. |
| 50 | +
|
| 51 | + |
| 52 | +## Changing the Editor |
| 53 | + |
| 54 | +The system has three different built-in editors: |
| 55 | + |
| 56 | + - `emacs` (Micro Emacs) |
| 57 | + - `nano` (GNU Nano) |
| 58 | + - `vi` (Visual Editor) |
| 59 | + |
| 60 | +Changing editor is done in configure context, in the system container: |
| 61 | + |
| 62 | +``` |
| 63 | +admin@host:/> configure |
| 64 | +admin@host:/config/> edit system |
| 65 | +admin@host:/config/system/> set text-editor <TAB> |
| 66 | +emacs nano vi |
| 67 | +admin@host:/config/system/> set text-editor nano |
| 68 | +admin@host:/config/system/> leave |
| 69 | +admin@example:/> |
| 70 | +``` |
0 commit comments