-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Joachim Wiberg <[email protected]>
- Loading branch information
Showing
3 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Text Editor | ||
|
||
The CLI built-in `text-editor` command can be used to edit type `binary` | ||
settings in configure context. | ||
|
||
The default editor is a Micro Emacs clone. Users not familiar with | ||
terminal based editors may benefit from this introduction. | ||
|
||
|
||
## Escape Meta/Alt Control Shift | ||
|
||
When starting up, the editor status field at the bottom shows the | ||
following shorthand: | ||
|
||
``` | ||
C-h q quick help | C-h t tutorial | C-h b key bindings | C = Ctrl | M = Alt | ||
``` | ||
|
||
Key combinations with a `-` (dash) mean holding down the modifier key. | ||
Combinations without a `-` (dash) mean without any modifier key. | ||
|
||
### Quick help `C-h q` | ||
|
||
- hold down the `Ctrl` key on | ||
- tap the `h` key | ||
- release `Ctrl` | ||
- tap the `q` key | ||
|
||
The bottom part of the terminal now shows a "buffer" called `*quick*`: | ||
|
||
``` | ||
FILE BUFFER WINDOW MARK/KILL MISC | ||
C-x C-c exit C-x b switch C-x 0 only other C-space mark C-_ undo | ||
C-x C-f find C-x k close C-x 1 only this C-w kill-rg C-s search | ||
C-x C-s save C-x C-b list C-x 2 split two C-k kill-ln C-r r-search | ||
C-x s save-all C-x h mark C-x ^ enlarge C-y yank M-% replace | ||
C-x i insert C-x g goto-ln C-x o other win C-x C-x swap M-q reformat | ||
``` | ||
|
||
### Save & Exit `C-x C-c` | ||
|
||
- Hold down the Ctrl key | ||
- tap `X` | ||
- tap `c` | ||
- release `Ctrl` | ||
|
||
> The status field at the bottom asks if you are really sure, and/or if | ||
> you want to add a final Enter/newline to the file. For binary content | ||
> that final newline may be important. | ||
|
||
## Changing the Editor | ||
|
||
The system has three different built-in editors: | ||
|
||
- `emacs` (Micro Emacs) | ||
- `nano` (GNU Nano) | ||
- `vi` (Visual Editor) | ||
|
||
Changing editor is done in configure context, in the system container: | ||
|
||
``` | ||
admin@host:/> configure | ||
admin@host:/config/> edit system | ||
admin@host:/config/system/> set text-editor <TAB> | ||
emacs nano vi | ||
admin@host:/config/system/> set text-editor nano | ||
admin@host:/config/system/> leave | ||
admin@example:/> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters