Newer
Older
Sodium: A modern editor for the Redox OS
========================================
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
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 right
- <numeral>j : Go down
- <numeral>k : Go up
- <numeral>l : Go left
- <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
- 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
( -> )
/ -> \
# 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>
- w <filename> : Write the buffer to <filename>
- 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
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
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 right
- <numeral>j : Go down
- <numeral>k : Go up
- <numeral>l : Go left
- <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>