help.txt 4.38 KB
Newer Older
Ticki's avatar
Ticki committed
1 2
Sodium: A modern editor for the Redox OS
========================================
Ticki's avatar
Ticki committed
3
by Ticki et al.
Ticki's avatar
Ticki committed
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:

Ticki's avatar
Ticki committed
52 53 54
NOTE: <numeral> means repeat command
      <numeral> times, unless otherwise
      stated.
Ticki's avatar
Ticki committed
55

Ticki's avatar
Ticki committed
56
Basic motion:
57
- <numeral>h : Go left
Ticki's avatar
Ticki committed
58 59
- <numeral>j : Go down
- <numeral>k : Go up
60
- <numeral>l : Go right
Ticki's avatar
Ticki committed
61 62 63 64 65 66
- <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
Ticki's avatar
Ticki committed
67

Ticki's avatar
Ticki committed
68 69 70 71
Navigation:
- <numeral>g : Go to <numeral> line
- g<motion> : Do <motion>
- G : Go to the end of the document
72 73 74 75
- <numeral>t<char> : Go to the next occurence
                     of <char>
- <numeral>f<char> : Go to the previous occurence
                     of <char>
Ticki's avatar
Ticki committed
76

77 78 79 80 81
Scrolling:
- z<motion> : Scroll <motion>
- <numeral>z : Scroll to line <numeral>
- Z : Scroll to cursor

Ticki's avatar
Ticki committed
82 83 84
Cursor management:
- b : Branch the cursor
- B : Delete the current cursor
Ticki's avatar
Ticki committed
85
- [space] : Go to the next cursor
Ticki's avatar
Ticki committed
86 87 88

Editing:
- i : Go to insert mode
Ticki's avatar
Ticki committed
89
- a : Go to insert (append) mode
Ticki's avatar
Ticki committed
90 91 92 93 94 95 96 97
- 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
Ticki's avatar
Ticki committed
98 99 100 101 102
- ~ : Switch the character under the cursor
      with its counterpart (if it has one).
      For example a -> A
                  ( -> )
                  / -> \
Ticki's avatar
Ticki committed
103
- ; : Go to prompt mode
104
- . : Repeat the previous command
Ticki's avatar
Ticki committed
105

106

Ticki's avatar
Ticki committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
# 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>
Ticki's avatar
Ticki committed
126
- get <option> : Get the state of <option>
127
- o <filename> : Open <filename> in a new buffer
Ticki's avatar
Ticki committed
128
- help : Open this guide.
Ticki's avatar
Ticki committed
129
- w <filename> : Write the buffer to <filename>
130 131 132
- ls : List the available buffers
- b<numeral> : Switch to buffer <numeral>
- bd : Delete the current buffer
Ticki's avatar
Ticki committed
133
- q : Quit Sodium.
Ticki's avatar
Ticki committed
134 135 136 137 138 139 140 141 142

Following option exists:

- highlight or hl : Highlight the text
                    (useful for coding)
  default: on
- autoindent or ai : Automatically indent
                     newlines.
  default: on
143 144 145 146
- line_marker or lm : Slightly dim the
                      background of the
                      current line
  default: on
Ticki's avatar
Ticki committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163

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.

164
- <numeral>h : Go left
Ticki's avatar
Ticki committed
165 166
- <numeral>j : Go down
- <numeral>k : Go up
167
- <numeral>l : Go right
Ticki's avatar
Ticki committed
168 169 170 171 172 173 174 175
- <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
176 177 178 179
- <numeral>t<char> : Go to the next occurence
                     of <char>
- <numeral>f<char> : Go to the previous occurence
                     of <char>
Ticki's avatar
Ticki committed
180 181 182 183 184 185 186

Tips'n'tricks
-------------

- gg : Go to the start of the document
- dL : Delete the rest of the line
TODO: Extend