-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit.1
252 lines (190 loc) · 3.69 KB
/
edit.1
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
.TH edit 1 "25 February 2024"
.SH NAME
\fBedit\fP - Terminal-based text editor
.SH SYNOPSIS
edit [--exec <command>] [--conf-file <file>] [--log-file <file>]
[--log-level <number>] [--help] [filename1..filenameN]
.SH DESCRIPTION
\fBedit\fP is a simple text editor for the terminal.
It can handle multiple files (buffers) at the same time, and comes
with a bunch of useful commands.
.SH OPTIONS
.TP
.B --exec <command>
Executes <command> for every file given as a parameter.
.TP
.B --conf-file <file>
Specify a config file
.TP
.B --log-file <file>
Specify a log file
.TP
.B --log-level <number>
Set the log level. ERROR (1), WARN (2), INFO (3), INPUT (4)
.TP
.B --
Breaks the argument parsing. Treats the rest of the arguments as filenames.
.SH EXAMPLES
Open files for editing: \fBedit my-file.txt another-file.c\fP
Strip trailing spaces from files: \fBedit --exec "strip buffer" *.txt
.SH KEYBINDINGS
.TP
.B Ctrl + E
Execute a command
.TP
.B Ctrl + F
Format line
.TP
.B Ctrl + K
Cut line
.TP
.B Ctrl + N
Add buffer
.TP
.B Ctrl + O
Open file
.TP
.B Ctrl + Q
Kill buffer
.TP
.B Ctrl + S
Save buffer
.TP
.B Ctrl + Left Arrow
Move to the buffer on the left
.TP
.B Ctrl + Right Arrow
Move to the buffer on the right
.TP
.B F5
Reload file
.TP
.B Alt + H
Display a help buffer
.TP
.B Alt + C
Toggle comment in the current line
.TP
.B Alt + S
Search in the buffer
.TP
.B Alt + R
Replace command
.TP
.B Alt + K
Cut the line from the cursor to the end.
.TP
.B Alt + Up Arrow
Moves the current line up.
.TP
.B Alt + Down Arrow
Moves the current line down.
.TP
.B Alt + [1-9]
Go to buffer number [1-9]
.TP
.B Alt + Left Arrow
Jumps to the previous word
.TP
.B Alt + Righ Arrow
Jumps to the next word
.TP
.B Alt + Backspace
Deletes a word backwards
.TP
.B Alt + Supr Key
Deletes a word forward
.TP
.B Ctrl + [hjkl] | Arrows
Move cursor
.TP
.B Ctrl + Z
Undo
.TP
.B Ctrl + R
Redo
.SH COMMANDS
.TP
.B !quit
Exit the editor
.TP
.B pwd
prints the current working directory
.TP
.B wq
Write the buffer and close it
.TP
.B fwq
Same as wq, but it formats the buffer first
.TP
.B strip [line|buffer]
Strips triling whitespaces.
.TP
.B goto [line|buffer] <line-number>
Jumps to a certain line/buffer
.TP
.B format [line|buffer]
Formats the line/buffer. Same as Ctrl + F.
.TP
.B search <string>
Jumps to the next occurence of the given string of text
.TP
.B search-backwards
same as search, but backwards.
.TP
.B replace <text> <replacement>
Replaces all instances of <text> with <replacement>
.TP
.B set <key> [<value>]
Sets a configuration parameter for all new buffers
.TP
.B setlocal <key> [<value>]
Sets a configuration parameter for the current buffer
.TP
.B log
Open a new buffer with the log of the session.
.TP
.B help
Display the help buffer
.SH SET
.TP
.B linenumber
Display line numbers
.TP
.B nolinenumber
Don't display line numbers
.TP
.B tabwidth <int>
Set tab width
.TP
.B highlighting
Enable syntax highlighting
.TP
.B nohighlighting
Disable syntax highlighting
.SH CONFIGURATION
To configure the behaviour of the editor, you can define a config file.
The file uses the json format. Here's a table with the options.
.TS
allbox tab(|);
cb cb cb
c c c.
Name | Json Type | Default Value
tab_size | Number | 8
substitute_tab_with_space | Bool | false
syntax_highlighting | Bool | false
auto_save_interval | Number | 60
line_number | Bool | false
eol | String | "\\n"
history.enabled | Bool | true
history.max_size | Number | 1000 (0 means unlimited)
.TE
If not specified, with the --config-file argument, the program looks for it in the following places.
\fI
$XDG_CONFIG_HOME/edit/config.json
$HOME/.config/edit/config.json
\fP
.SH AUTHOR
Saúl Valdelvira
.SH SEE ALSO
Browse the source code at \fIhttp://git.saulv.es/edit\fP