forked from redox-os/sodium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
help.txt
186 lines (150 loc) · 4.38 KB
/
help.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
Sodium: A modern editor for the Redox OS
========================================
by Ticki et al.
Sodium is a editor inspired by a various
console based, keyboard-centric editor.
The keybindings are loosly based on Vim.
This is a small guide for using Sodium.
Sodium consists of three different types
of command sets.
1) Global commands. These are possible to
use anywhere, in any mode.
2) Mode-specific commands. These are
specific to a given mode.
3) Namespaces. Commands that can be
invoked as input (after) certain
commands.
The modes are of two types:
- Command mode: In command mode a command
can be preceeded by a numeral. This
numeral is called a parameter, and can
mean various things for the command.
- Primitive mode: In this type of mode
the keys are given directly to the
handler without any form of parsing.
Global commands
---------------
- [alt][space]: Go to the next cursor.
- [alt]<motion>: Move a given motion.
- [shift][space]: Go back to normal mode.
Modes
-----
# Normal
This is the default mode. Normal mode
provides various commands. Normal mode
is intended for doing commands which
are often invoked and commands used to
change modes.
The following commands are valid in
normal mode:
NOTE: <numeral> means repeat command
<numeral> times, unless otherwise
stated.
Basic motion:
- <numeral>h : Go left
- <numeral>j : Go down
- <numeral>k : Go up
- <numeral>l : Go right
- <numeral>J : Go 15 down
- <numeral>K : Go 15 up
- <numeral>H : Go to the start of
the line
- <numeral>L : Go to the end of the
line
Navigation:
- <numeral>g : Go to <numeral> line
- g<motion> : Do <motion>
- G : Go to the end of the document
- <numeral>t<char> : Go to the next occurence
of <char>
- <numeral>f<char> : Go to the previous occurence
of <char>
Scrolling:
- z<motion> : Scroll <motion>
- <numeral>z : Scroll to line <numeral>
- Z : Scroll to cursor
Cursor management:
- b : Branch the cursor
- B : Delete the current cursor
- [space] : Go to the next cursor
Editing:
- i : Go to insert mode
- a : Go to insert (append) mode
- r<char> : Replace the current char
with <char>
- R : Go to replace mode
- x : Delete char
- X : Backspace char
- d<motion> : Delete a given selection
(given by <motion>)
- o : Insert a new line
- ~ : Switch the character under the cursor
with its counterpart (if it has one).
For example a -> A
( -> )
/ -> \
- ; : Go to prompt mode
- . : Repeat the previous command
# Insert
Insert text before the cursor.
# Replace
Replace the text under the cursor.
# Prompt
Prompt mode is a mode where you can
invoke commands like in Vi(m). In this
mode you can for example set/unset options.
Following commands are valid:
- set <option> : Set <option>
- unset <option> : Unset <option>
- toggle <option> : Toggle <option>
- get <option> : Get the state of <option>
- o <filename> : Open <filename> in a new buffer
- help : Open this guide.
- w <filename> : Write the buffer to <filename>
- ls : List the available buffers
- b<numeral> : Switch to buffer <numeral>
- bd : Delete the current buffer
- q : Quit Sodium.
Following option exists:
- highlight or hl : Highlight the text
(useful for coding)
default: on
- autoindent or ai : Automatically indent
newlines.
default: on
- line_marker or lm : Slightly dim the
background of the
current line
default: on
To leave prompt press enter and the command
will be invoked. To leave the prompt without
invoking the command use the usual
shift-space command.
Namespaces
----------
A namespace is a set of commands which is
not dependent to any mode.
# <motion>
<numeral> means repeat unless otherwise
stated.
- <numeral>h : Go left
- <numeral>j : Go down
- <numeral>k : Go up
- <numeral>l : Go right
- <numeral>J : Go 15 down
- <numeral>K : Go 15 up
- <numeral>H : Go to the start of
the line
- <numeral>L : Go to the end of the
line
- <numeral>g : Go to <numeral> line
- G : Go to the end of the document
- <numeral>t<char> : Go to the next occurence
of <char>
- <numeral>f<char> : Go to the previous occurence
of <char>
Tips'n'tricks
-------------
- gg : Go to the start of the document
- dL : Delete the rest of the line
TODO: Extend