-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewtrodit.man
316 lines (226 loc) · 14.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
$NEWTRODIT_MANUAL
[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 keybinds 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] [file]
--fontcolor, -fc Changes the font color.
--converttab, -t Converts tabs to spaces.
--convertnull, -n Converts nulls characters to spaces.
--devmode, -d Enables developer mode.
--menucolor, -mc Changes Newtrodit's menus color.
--help, -h Opens this Newtrodit help manual.
--lfunix, -ln Changes the line ending to UNIX (LF).
--lfwin, -lw Changes the line ending to Windows (CRLF).
--line, -l Displays line number.
--sigsegv, -s Displays a message when a SIGSEGV (Segmentation fault) is caught.
--version, -v Shows Newtrodit's version.
Unlike previous versions, switches can go at any position, before or after file/files.
[1m[38;2;207;50;68mUsage inside application[0m
[37;113;235;37;1mNavigation[0m
You can use any other raw text editor navigation features.
To move between lines and columns, you may use arrow keys.
You can see the current cursor position at the bottom left part,
where [1mLn[0m means line and [1mCol[0m means column
[1mEnd[0m and [1mHome[0m, [1mPageUp, [1mPageDown
[37;113;235;37;1mKeybinds[0m
[37;113;235;37;1mKeybinds are written as follows:[0m
'[38;2;207;50;68;4m^[0m' = Control
'[38;2;207;50;68;4mA-[0m' = Alt
'[38;2;207;50;68;4mS-[0m' = Shift
[37;113;235;37;1mNavigation inside the manual[0m
[38;2;207;50;68;4m^X[0m = Go back to Newtrodit
[38;2;207;50;68;4mA-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 keybinds[0m
[38;2;207;50;68;4m^C[0m = Copy line to clipboard
[38;2;207;50;68;4m^D[0m = Show line content (requires developer mode)
[38;2;207;50;68;4m^F[0m = Find string
[38;2;207;50;68;4m^G[0m = Go to a specific line
[38;2;207;50;68;4m^H[0m = Replace string
[38;2;207;50;68;4m^L[0m = Toggle line count
[38;2;207;50;68;4m^N[0m = New file
[38;2;207;50;68;4m^O[0m = Open file
[38;2;207;50;68;4m^R[0m = Reload file (same as '[38;2;207;50;68;4m^N[0m' and '[38;2;207;50;68;4m^O[0m')
[38;2;207;50;68;4m^S[0m = Save file
[38;2;207;50;68;4m^W[0m = Close current file
[38;2;207;50;68;4m^V[0m = Paste line from clipboard
[38;2;207;50;68;4m^X[0m = Exit Newtrodit
[38;2;207;50;68;4mS-^F[0m = Find string (case insensitive)
[38;2;207;50;68;4mS-^H[0m = Same as [38;2;207;50;68;4mF1[0m (shows help manual)
[38;2;207;50;68;4mS-^L[0m = Locate files. See the advanced section for more information.
[38;2;207;50;68;4mS-^R[0m = Reload settings
[38;2;207;50;68;4mS-^S[0m = Save file as
[38;2;207;50;68;4mS-^D[0m = Toggle dev mode
[38;2;207;50;68;4mS-^N[0m = Toggle null character to spaces conversion
[38;2;207;50;68;4mS-^T[0m = Toggle tab to spaces conversion
[37;113;235;37;1mAlt keybinds[0m
[38;2;207;50;68;4mA-Home[0m = Go to the beginning of the first non-blank space
[38;2;207;50;68;4mA-^N[0m = Create a new empty file and save it (same as '[38;2;207;50;68;4m^N[0m' and '[38;2;207;50;68;4m^S[0m')
[38;2;207;50;68;4mA-^R[0m = Encode/decode line using ROT13 algorithm
[37;113;235;37;1mFunction keys keybinds[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;4m^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;4mF10[0m = Opens containing directory in Windows Explorer
[38;2;207;50;68;4m^F1[0m = About Newtrodit
[38;2;207;50;68;4m^F4[0m = Close current file (same as [38;2;207;50;68;4m^W[0m)
[38;2;207;50;68;4mS-F10[0m = Opens a terminal instance in current directory
[38;2;207;50;68;4mA-F4[0m = Same as [38;2;207;50;68;4m^X[0m (exits Newtrodit)
[37;113;235;37;1mAdvanced keybinds[0m
[37;113;235;37;1mLocate files ([0m[38;2;207;50;68;4mS-^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
DD/MM/YYYY 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;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 = String. This setting type stores a string of text.
[1mInteger[0m = Integer. This setting type stores an integer, which may have a defined range.
[1mBoolean[0m = Boolean. 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 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 linecount[0m = Toggle line count. Boolean type.
-[1m mouse[0m = Toggle mouse support. Boolean type.
-[1m oldkeybinds[0m = Toggle old keybind usage. Boolean type.
-[1m sigsegv[0m = Toggle SIGSEGV handler. Boolean type.
-[1m syntax[0m = Toggle syntax highlighting. Boolean type.
[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 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: Wrongly configuring settings cause unexpected behavior and major issues.[0m
[38;2;255;255;160;1mExample of a settings file:[0m
[1m ; Example settings file for Newtrodit[0m
[1m codepage=437[0m
[1m xsize=120[0m
[1m ysize=30[0m
[1m linecount=0[0m
[1m tabwide=8[0m
[1m manfile=newtrodit.man[0m
[1m linecountwide=3[0m
[1m mouse=1[0m
[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'.
[1mOld keybinds[0m
Some keybinds can be changed using the[1m oldkeybinds[0m setting.
Here's a list of the replaced keybinds:
[38;2;207;50;68;4m^X[0m --> [38;2;207;50;68;4m^Q[0m (Quit Newtrodit)
[38;2;207;50;68;4m^K[0m --> [38;2;207;50;68;4m^X[0m (Cut line)
[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;4m^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;4mS-^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 it's only compatible with
Windows because it uses the Windows API to display the GUI.
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
[1mnewtrodit_func.c[0m : Main functions
[1mnewtrodit_gui.c[0m : GUI loading
[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 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.
Newtrodit $V
Build date [$B]
Feel free to contribute here: [4m$G[0m