-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
newtrodit.man
412 lines (298 loc) · 20.2 KB
/
newtrodit.man
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
$NEWTRODIT_MANUAL # Newtrodit manual must begin with this line (manual magic number)
[1mWhat is Newtrodit?[0m
Newtrodit is a console-based text editor. As Windows doesn't include a console text editor,
Newtrodit is probably your best choice. The editor is designed to be minimalistic and easy to use.
Even if it's keyboard-based, the keybindings are easy to remember due to the fact that they're
similar to other applications.
The main goal is having a noticeable efficiency increase when working.
[38;2;207;50;68mCommand line usage[0m
newtrodit [switches] [file1] [file2] [file3]...
--convertnull, -n Converts null characters to spaces.
--converttab, -t Converts tabs to spaces.
--devmode, -d Enables developer mode.
--fontcolor, -f Changes the font color.
--help, -h Opens this Newtrodit help manual.
--lfunix, -n Changes the line ending to UNIX (LF).
--lfwin, -w Changes the line ending to Windows (CRLF).
--line, -l Displays line number.
--menucolor, -c [color] Changes Newtrodit's menus color.
--mouse, -m Enables mouse support.
--syntax, -s [file] Enables syntax highlighting.
--version, -v Shows Newtrodit's version.
Unlike previous versions, switches can go at any position, before or after file/files.
If a file is named exactly like a switch, add the prefix './' before the name to avoid Newtrodit interpreting
it as a switch. Files are loaded in order, but the last file is the one that will be shown for edition.
[1m[38;2;207;50;68mUsage inside application[0m
[37;113;235;37;1mNavigation[0m
Newtrodit offers navigation features which ease the file editing process.
To move between lines and columns, you may use arrow keys. To go to the beginning of a line,
use [1mEnd[0m and [1mHome[0m; to jump pages, [1mPageUp[0m and [1mPageDown[0m.
The current cursor position is displayed at bottom left part of the screen,
where [1mLn[0m means line and [1mCol[0m means column. The percentages indicate the
position of the cursor inside the file.
[37;113;235;37;1mNavigation inside the manual[0m
[38;2;207;50;68;4mCtrl-X[0m = Go back to Newtrodit
[38;2;207;50;68;4mAlt-F4[0m = Exit Newtrodit
[38;2;207;50;68;4mPageUp[0m = Go to the previous page
[38;2;207;50;68;4mPageDown[0m = Go to the next page
[38;2;207;50;68;4mUp[0m = Go to the previous line
[38;2;207;50;68;4mDown[0m = Go to the next line
[37;113;235;37;1mControl keybindings[0m
[38;2;207;50;68;4mCtrl-C[0m = Copy line to clipboard
[38;2;207;50;68;4mCtrl-D[0m = Show line content (requires developer mode)
[38;2;207;50;68;4mCtrl-E[0m = Toggle syntax highlighting
[38;2;207;50;68;4mCtrl-F[0m = Find string
[38;2;207;50;68;4mCtrl-G[0m = Go to a line
[38;2;207;50;68;4mCtrl-H[0m = Replace string
[38;2;207;50;68;4mCtrl-I[0m = Show information about the currently edited file
[38;2;207;50;68;4mCtrl-L[0m = Toggle line count
[38;2;207;50;68;4mCtrl-M[0m = Toggle mouse support
[38;2;207;50;68;4mCtrl-N[0m = Open a new tab
[38;2;207;50;68;4mCtrl-O[0m = Open a file
[38;2;207;50;68;4mCtrl-P[0m = Open command palette
[38;2;207;50;68;4mCtrl-Q[0m = Exit Newtrodit
[38;2;207;50;68;4mCtrl-R[0m = Reload the currently edited file from disk
[38;2;207;50;68;4mCtrl-S[0m = Save file
[38;2;207;50;68;4mCtrl-V[0m = Paste line
[38;2;207;50;68;4mCtrl-W[0m = Close current file
[38;2;207;50;68;4mCtrl-X[0m = Cut line
[38;2;207;50;68;4mCtrl-Shift-A[0m = Toggle automatic syntax highlighting rules loading
[38;2;207;50;68;4mCtrl-Shift-C[0m = Compare files
[38;2;207;50;68;4mCtrl-Shift-D[0m = Toggle dev mode
[38;2;207;50;68;4mCtrl-Shift-E[0m = Load a syntax highlighting scheme
[38;2;207;50;68;4mCtrl-Shift-F[0m = Find string (case insensitive)
[38;2;207;50;68;4mCtrl-Shift-G[0m = Go to a column
[38;2;207;50;68;4mCtrl-Shift-H[0m = Same as [38;2;207;50;68;4mF1[0m (opens help)
[38;2;207;50;68;4mCtrl-Shift-K[0m = Toggles old keybindings (see later)
[38;2;207;50;68;4mCtrl-Shift-L[0m = Locate files. See the advanced section for more information.
[38;2;207;50;68;4mCtrl-Shift-N[0m = Toggle null character to spaces conversion
[38;2;207;50;68;4mCtrl-Shift-Q[0m = Count lines of code and size of all currently open files
[38;2;207;50;68;4mCtrl-Shift-R[0m = Reload the settings
[38;2;207;50;68;4mCtrl-Shift-S[0m = Save file as
[38;2;207;50;68;4mCtrl-Shift-T[0m = Toggle tab to spaces conversion
[37;113;235;37;1mAlt keybindings[0m
[38;2;207;50;68;4mAlt-End[0m = Go to the last first non-blank space
[38;2;207;50;68;4mAlt-Home[0m = Go to the beginning of the first non-blank space
[38;2;207;50;68;4mCtrl-Alt-L[0m = Convert current line to lowercase
[38;2;207;50;68;4mCtrl-Alt-N[0m = Create a new empty file and save it (same as '[38;2;207;50;68;4mCtrl-N[0m' and '[38;2;207;50;68;4mCtrl-S[0m')
[38;2;207;50;68;4mCtrl-Alt-R[0m = Encode/decode line using ROT13 algorithm
[38;2;207;50;68;4mCtrl-Alt-U[0m = Convert current line to uppercase
[37;113;235;37;1mFunction keys keybindings[0m
[38;2;207;50;68;4mF1[0m = Shows help (manual)
[38;2;207;50;68;4mF2[0m = Renames current file (can also be used to move)
[38;2;207;50;68;4mF3[0m = Next find occurrence (can only be used after '[38;2;207;50;68;4mCtrl-F[0m')
[38;2;207;50;68;4mF5[0m = Runs a macro, if a macro hasn't been defined yet, it will run the current file
[38;2;207;50;68;4mF6[0m = Adds current date and time
[38;2;207;50;68;4mF9[0m = Compiles current file with the specified compiler (default compiler is 'gcc')
[38;2;207;50;68;4mF10[0m = Opens containing directory in Windows Explorer
[38;2;207;50;68;4mCtrl-F1[0m = About Newtrodit
[38;2;207;50;68;4mCtrl-F4[0m = Close current file (same as [38;2;207;50;68;4mCtrl-W[0m)
[38;2;207;50;68;4mShift-F5[0m = Defines a macro for the current instance (use 'macro' in settings to set a permanent macro)
[38;2;207;50;68;4mShift-F10[0m = Opens a terminal instance in current directory
[38;2;207;50;68;4mAlt-F4[0m = Same as [38;2;207;50;68;4mCtrl-X[0m (exits Newtrodit)
[37;113;235;37;1mAdvanced keybindings[0m
[37;113;235;37;1mLocate files [0m([38;2;207;50;68;4mCtrl-Shift-L[0m[37;113;235;37;1m)[0m
The function will search for a file only in the current directory.
Additionally, you can use wildcards to perform an advanced search.
Newtrodit will automatically detect if you are using wildcards and it will change the search path accordingly.
The asterisk ([38;2;207;50;68;4m*[0m) can be used to replace any word of any length.
The question mark ([38;2;207;50;68;4m?[0m) can be used to replace character of always length 1.
The function will search for the first matches, displaying the date and time in the
YYYY/MM/DD hh:mm:ss format. File size is shown in bytes.
[37;113;235;37;1mExample[0m
'hello' would match for example a file called 'myhello.txt' and 'hello.txt'
'hello*' won't match 'myhello.txt', but '*hello*' will.
'hello.???' will only match files with the name 'hello' and a 3 character extension.
This wildcards have the same behavior as cmd.exe [1mDIR[0m command ones.
Known issue: Correct file size displaying is limited to 4 GB due to 32-bit integer limitations.
[37;113;235;37;1mCommand palette ([0m[38;2;207;50;68;4mCtrl-P[0m[37;113;235;37;1m)[0m
The command palette allows you to use commands in a Vim-like style instead of keybindings.
For instance, some functions have multiple ways of being called, either via keybindings or
via commands.
[37;113;235;37;1mPosition changing commands[0m
-[1m :n[0m = Go to line number [1mn[0m ([38;2;207;50;68;4mCtrl-G[0m[37;113;235;37;1m[0m)
-[1m ,n[0m = Go to column number [1mn[0m ([38;2;207;50;68;4mCtrl-Shift-G[0m[37;113;235;37;1m[0m)
-[1m 0[0m = Go to the first character of the line ([0m[38;2;207;50;68;4mHome[0m[37;113;235;37;1m[0m)
-[1m Ctrl-[0m = Go to the first non-whitespace character of the line ([38;2;207;50;68;4mAlt-Home[0m[37;113;235;37;1m[0m)
-[1m $$[0m = Go to the last character of the line ([38;2;207;50;68;4mEnd[0m[37;113;235;37;1m[0m)
[37;113;235;37;1mOther commands[0m
-[1m ?file[0m = Opens filename '[1mfile[0m' ([38;2;207;50;68;4mCtrl-O[0m[37;113;235;37;1m[0m)
-[1m !file[0m = Saves filename '[1mfile[0m' ([38;2;207;50;68;4mCtrl-S[0m[37;113;235;37;1m[0m)
[37;113;235;37;1mDialogs[0m
Newtrodit's dialogs (prompts), like Save and Open dialog, are customized which allow them to
have the features that Newtrodit has. Insertion, deletion, [38;2;207;50;68;4mHome[0m and [38;2;207;50;68;4mEnd[0m are supported.
To exit a dialog, simply press [38;2;207;50;68;4mEnter[0m when the prompt is empty or [38;2;207;50;68;4mESC[0m at any time.
[37;113;235;37;1mSettings[0m
Newtrodit can be customizable as you like it by changing some settings.
Settings file must be located in the same directory as Newtrodit with the name '[1mnewtrodit.config[0m'.
It's a simple text file with one line per setting, with an INI-like syntax.
Comments are allowed in the settings file with the '[38;2;207;50;68m;[0m' (semicolon) character.
[37;113;235;37;1mList of settings types[0m
[1mString[0m = Stores a string of text.
[1mInteger[0m = Stores an integer, which may have a defined range.
[1mBoolean[0m = This setting type stores a boolean value (either 1 or 0).
In case that a boolean or an integer setting is not a valid value, 0 will be used by default.
[37;113;235;37;1mList of all settings[0m
[37;113;235;37;1mBoolean settings[0m
-[1m autosyntax[0m = Toggle automatic loading of syntax highlighting for supported file types. Boolean type.
-[1m converttab[0m = Toggle tab conversion from tabs to spaces. Boolean type.
-[1m convertnull[0m = Toggle null character conversion to spaces. Boolean type.
-[1m curinsert[0m = Toggle cursor size change in insert mode. Boolean type.
-[1m devmode[0m = Toggle developer mode. Boolean type.
-[1m findinsensitive[0m = Toggle default case insensitive setting. Boolean type.
-[1m linecount[0m = Toggle line count. Boolean type.
-[1m linehighlight[0m = Toggle current line highlighting. Requires [1mlinecount[0m to be enabled. Boolean type.
-[1m mouse[0m = Toggle mouse support. Boolean type.
-[1m oldkeybindings[0m = Toggle old keybindings usage. Boolean type.
-[1m sigsegv[0m = Toggle SIGSEGV handler. Boolean type.
-[1m syntax[0m = Toggle syntax highlighting. Boolean type.
-[1m wholeword[0m = Toggle whole word matching.
[37;113;235;37;1mInteger settings[0m
-[1m codepage[0m = Console codepage. Integer type
-[1m cursize[0m = Console cursor size. Integer type.
-[1m fontcolor[0m = Font color. Integer type. The range of the integer is betwen 0 and 255.
-[1m linecountwide[0m = Line count width. Integer type.
-[1m menucolor[0m = Menu color. Integer type. The range of the integer is betwen 0 and 255.
-[1m tabwide[0m = Tab width. Integer type.
-[1m xsize[0m = X size of the window (columns). Integer type.
-[1m ysize[0m = Y size of the window (lines). Integer type.
[37;113;235;37;1mString settings[0m
-[1m macro[0m = Macro to set. See the [1mMacro[0m section for further information.
-[1m manfile[0m = Name of the manual file. String type.
-[1m newline[0m = New line, which will be added to the end of each line. String type.
[38;2;210;156;12;1mWARNING: Incorrectly configuring settings can cause unexpected behavior and major issues.[0m
[38;2;255;255;160;1mExample of a settings file:[0m
[1m ; Sample settings file for Newtrodit[0m
[1m ; Character conversion settings [0m
[1m converttab=true[0m
[1m ; Internal settings [0m
[1m codepage=437[0m
[1m manfile=newtrodit.man[0m
[1m ; Editing-related settings [0m
[1m linecount=true[0m
[1m autosyntax=true[0m
[1m oldkeybindings=false[0m
[1m linehighlight=false[0m
[1m linecountwide=3[0m
[1m mouse=true[0m
[1m syntax=true[0m
[1m tabwide=4[0m
[37;113;235;37;1mMultiple tabs[0m
The big new feature introduced in Newtrodit 0.6 are tabs. With this feature, you can open up to
$T files in the same Newtrodit window, by pressing [38;2;207;50;68;4mCtrl-N[0m. Tabs can be inserted or closed in any
position, and it will shift the other tabs accordingly.
You can switch between tabs by pressing [38;2;207;50;68;4mCtrl-TAB[0m (forward) and [38;2;207;50;68;4mCtrl-Shift-TAB[0m (backward), or
by using the [1m@n[0m command in the command palette ([38;2;207;50;68;4mCtrl-P[0m), where [1mn[0m is the file index.
All settings are shared between tabs (e.g: disabling line count will disable it for all open files)
To close a tab, use [38;2;207;50;68;4mCtrl-W[0m or either [38;2;207;50;68;4mCtrl-F4[0m
[37;113;235;37;1mCode autocompletion[0m
Newtrodit includes a simple but functional code autocompletion module to increase your productivity.
Autocompletion is limited to the word immediately to the left of the cursor. The algorithm treats only
the word preceding the cursor for autocompletion. The rest of the line is not taken into account.
The matching algorithm takes three different factors including length difference, word matching
at the beginning and character matching at the middle. The result that gets the highest "score"
is the autocompletion proposition, even though the matching should be high, otherwise nothing will happen.
Autocompletion can be triggered by pressing the [38;2;207;50;68;4mTab[0m key.
Keep in mind that only the keywords on the syntax highlighting scheme are filled. No variables,
functions, or anything that require context analysis is checked.
[37;113;235;37;1mLog file[0m
Newtrodit keeps track of actions that could help in debugging a problem (loaded settings, exceptions...) into
a file called '[1mnewtrodit.log[0m'.
Note that only debugging information is written and no personal information or file content is ever saved.
[37;113;235;37;1mSyntax highlighting[0m
Newtrodit has some syntax highlighting rules to color the code you're writing and to make it
easier to read.
Syntax highlighting format is similar to the settings format (INI-like), but with some special keywords.
Each line must start with a keyword followed by an equal sign and the color of the keyword.
Here's a list of all special keywords:
[1m $$NEWTRODIT_SYNTAX[0m = This must be the first line of the file to indicate the syntax
highlighting format used is the one used by Newtrodit.
[1m $$LANGUAGE[0m = This keyword indicates the language of the code.
[1m $$COMMENT[0m = This keyword the comment string.
[1m $$COMMENT_COLOR[0m = Comments color.
[1m $$QUOTE_COLOR[0m = String color.
[1m $$DEFAULT_COLOR[0m = Code that isn't highlighting will be colored in this color.
[1m $$NUMBER_COLOR[0m = Every number written will be colored in this color.
[1m $$SEPARATORS[0m = Code separator characters. (e.g. ',.()+-/*=~[];{}<> ')
[1m $$CAPITAL[0m = Enable capital words syntax highlighting. Use '0' to disable and '1' to enable.
[1m $$CAPITAL_COLOR[0m = Color for the highlighted capital words. Requires [1m$$CAPITAL[0m to be set to '1'.
[1m $$CAPITAL_MIN[0m = Minimum length for capital words to be highlighted. Requires [1m$$CAPITAL[0m to be set to '1'.
[37;113;235;37;1mOld keybindings[0m
Some keybindings can be changed using the [1moldkeybindings[0m setting.
Here's a list of the replaced keybindings:
[38;2;207;50;68;4mCtrl-X[0m --> [38;2;207;50;68;4mCtrl-Q[0m (Quit Newtrodit)
[38;2;207;50;68;4mCtrl-K[0m --> [38;2;207;50;68;4mCtrl-X[0m (Cut line)
If [1moldkeybindings[0m is enabled, both [38;2;207;50;68;4mCtrl-X[0m and [38;2;207;50;68;4mCtrl-Q[0m map to the same action (Quit Newtrodit)
[37;113;235;37;1mDeveloper mode[0m
Developer mode is a setting made for users who want to use test/debug features on Newtrodit.
Features of developer mode:
- Displaying line content ([38;2;207;50;68;4mCtrl-D[0m)
- Displaying old and new console size ([38;2;207;50;68;4mF12[0m)
To toggle developer mode, press '[38;2;207;50;68;4mCtrl-Shift-D[0m'
[37;113;235;37;1mConfiguration priority[0m
The setting that applies last has the highest priority.
For example, writing 2 lines with the same setting will result in the second line
being written with the second setting, ignoring the first one.
Priority order (lowest to highest):
- Newtrodit default settings
- Settings file
- Command line arguments
- Inside application setting changing
- Syntax highlighting (for colors scheme)
Even if a color scheme has been defined in command line arguments, syntax highlighting will override
the colored keywords.
[37;113;235;37;1mCrashes[0m
As all programs, Newtrodit isn't perfect. If you find a bug, please report it on:
[1m$G/issues[0m
Most common crash causes are:
- Not enough memory available
- Invalid settings file
- Invalid or too large syntax highlighting scheme
- Memory allocation error
- Buffer overflow
There are also more rare crashes, such as:
- Memory/stack corruption
- External program interferences (e.g. external programs that write memory to Newtrodit)
If you find a crash, please report it with all the information on the crash screen.
[37;113;235;37;1mInternal working[0m
At the moment, Newtrodit has a buffer of $X x $Y. The maximum number of lines is
$Y, with a buffer increment of $I, while line length depends on the memory available on the system.
This is due to the fact that the buffer is a 2D array of characters. This is one of the main
issues that Newtrodit has to deal with and we're working on it.
It has been coded in C to have maximum performance. At the moment, the Linux fork is being developped
by Zackery Smith, called Newtrodit-LCL (Linux Compatibility Layer).
Some more specific internal working behaviors:
- New lines while reading a file are added when a '[38;2;207;50;68;4m\n[0m' character is found,
and not when a custom new line string is found.
The source code of Newtrodit is composed by:
[1mdialog.h[0m : Dialogs
[1mglobals.h[0m : Global variables
[1mmanual.c[0m : Manual
[1mnewtrodit.c[0m : Main source file
[1mnewtrodit_core.h[0m : All core functions
[1m ~ win32/newtrodit_core_win.h[0m
[1m ~ linux/newtrodit_core_linux.h[0m
[1mnewtrodit_func.c[0m : Main functions
[1m ~ win32/newtrodit_func_win.c[0m
[1m ~ linux/newtrodit_func_linux.c[0m
[1mnewtrodit_gui.c[0m : GUI loading
[1mnewtrodit_shared.c[0m : Shared functions between Windows and Linux
[1mnewtrodit_syntax.h[0m : Syntax highlighting
[37;113;235;37;1mLicense[0m
Newtrodit is licensed under the GNU General Public License version 3.0.
See [4mhttps://www.gnu.org/licenses[0m for more details.
[37;113;235;37;1mAbout Newtrodit[0m
Newtrodit is a free open-source program created by anic17 with some contributions by other members.
Started working on it at the ending of 2020, it's now another way to code in Windows.
Here's a list of people who contributed and helped in the creation of this project:
- Karanveer Chouhan (TheKvc) : Helped in lots of things.
- Teddy Astie (TSnake41) : Issue solving.
- Teoman Deniz (TeomanDeniz) : Feedback and testing.
- Tim Greller (timlg07) : Issue solving.
- Mathieu (Illegal-Services) : Lots of feedback and testing.
- Zackery Smith (ZackeryRSmith): Helped a lot while developing Newtrodit, creator of the Linux port
I would like to give special thanks to ZackeryRSmith, who helped a lot to Newtrodit development, and
specially by making Newtrodit-LCL, the Linux port of Newtrodit.
Newtrodit $V
Build date [$B]
Feel free to contribute here: [4;1m$G[0m