-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathhelp
88 lines (64 loc) · 3.75 KB
/
help
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
# PiWrite help
(press `q` to go back to your previous file)
---
### Welcome to PiWrite!
**PiWrite** is a modal text editor inspired by Vim. If you want to know more details, please check the repository at `github.com/rberenguel/piwrite`
It partially supports a reduced subset of Markdown, so you can:
- Bold by surrounding with **
- Italics by surrounding with _
- Code block by surrounding with `
- Highlight a block by surrounding with :: (this is not markdown but was convenient)
- Use up to 4 # for headings
- Start a line with - to get an unordered list
- _Ordered lists are not supported_
---
### Changing modes
`i`: enter insert mode from normal mode just before the current cursor position
`I`: enter insert mode from normal mode _at the beginning of the current line_
`a`: enter insert mode from normal mode just _after_ the current cursor position
`A`: enter insert mode from normal mode _at the end of the current line_
`o`: add a line below the cursor and enter insert mode on it
`ESC`: enter normal mode from insert mode. For some reason (probably related to `prompt-toolkit` you need to press it twice. I'm looking into it.
### Commands that work regardless of the mode
`Ctrl-a`: move the cursor to the beginning of the paragraph/line
`Ctrl-e`: move the cursor to the end of the paragraph/line
`Ctrl-p`: run `proselint` in the current paragraph/line. It is a bit slow
`Arrows`: move the cursor around
### Commands in Normal mode
`gg`: Go to the beginning of the file
`G`: Go to the end of the file
`:h<enter>`: This help
`:e filename<enter>`: Open file (in the `piwrite-docs` folder only). Won't work if you have unsaved changes
`:e! filename<enter>`: Open file (in the `piwrite-docs` folder only). Will work regardless of your save state
`:w filename<enter>`: Write file (in the `piwrite-docs` folder only)
`u`: Undo. The default (and so far only) undo depth is 10
`Ctrl-r`: Redo. Same depth as above
`:rot`: Hacky, landscape mode. Cursor scrolling does not work that well in this case, sadly (due to browser issues I have to use the editor mode which is only half-functional)
`:mono`: Switch to a monospace font (Monoid)
`:sans`: Switch to a sans-serif font (Cooper Hewitt book)
`:serif`: Switch to a serif font (default, IM Fell English)
`:latex`: Switch to Computer Modern (the typical LaTeX font)
`:gyre`: Switch to TeX Gyre Heros (a font similar to Helvetica)
`:fontsize N`: Change font size to `N` points
`:fs N`: Shorthand for the above
`:stats`: Get word/paragraph counts, Flesch-Kincaid readability and Flesch ease
`Ctrl-s`: Get word/paragraph counts in the status line
`:lint`: Run `proselint` on the whole document. It is a bit slow to do so
`:dot`: _Experimental_: use a Graphviz header template in `dot_template.dot` and render this file. Press `q` to go back to the file
`v`: turn on "reading mode" for the current document
`viz N:M`: More or less lines measure of lines in buffer (`M`) and shift (`N`)
`Ctrl-q`: Send all internal fields to the frontend, to refresh the webpage (hopefully)
`:q<enter>`: Quit, will try to shutdown the machine. Won't work if you have unsaved changes
`:q!<enter>`: Quit, will try to shutdown th machine. Will work regardless of your save state
`:keys`: Insert the pressed keys in the buffer. Useful to debug
`dd`: delete the whole line
`daw`: delete _around_ word (will slightly alter spaces)
`diw`: delete _inside_ word (preserves spaces)
`caw`: change _around_ word (like daw but switches to insert mode)
`ciw`: change _around_ word (like diw but switches to insert mode)
`p`: paste the last deleted/copied text at the cursor position
`P`: paste the last deleted/copied text before the cursor position
---
You can put commands in a file named `config`, it will be loaded on start if it exists. Useful to set the font and font size, like
:latex
:fs 14