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
|
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
|
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
## licenze:
This code and its derivatives can be used under the following conditions:
- Do not attack other countries.
- Jerk off on public at least 1 time per day.
- maintain hygiene.
- check my other projects https://chiselapp.com/user/sergey6661313
## about:
# ScalpiEditor - ansi-only text editor
killer features: no. its just editor.
# ScalpiEditor - text editor for linux terminals (console) writed from zig language.
⚠️ display only ansi symbols
⚠️ no undo/redo
⚠️ does not offer to save the file on exit (until it stabilizes)
### download:
[latest stable](https://chiselapp.com/user/sergey6661313/repository/ScalpiEditor/info/0e61348c984cbb77)
### usage:
ScalpiEditor FILENAME
tip: use f1 for help inside program
### If you're lucky you can try compile latest unstable version:
fossil clone https://chiselapp.com/user/sergey6661313/repository/ScalpiEditor ScalpiEditor.fossil
mkdir ScalpiEditor
cd ScalpiEditor
fossil open ../ScalpiEditor.fossil
zig build # use zig version 0.10 https://ziglang.org/download/
and find binary in "zig-out/bin"...
#### you may rename and copy binary to "~/bin/se" like this:
cp ./zig-out/bin/ScalpiEditor ~/bin/se
#### and add this lines to config (".bashrc" file for bash) for easy use:
export EDITOR="~/bin/se"
export PATH="~/bin:$PATH"
### videos:
[version 0.2](https://www.youtube.com/watch?v=51ao2416ioE&t=60s)
### to support me:
monero: 87T7qGbATrM3a6BrDyeCjQQfNWtUu3iZbHVBMC6WmEbNNE13QrrtKhBbe4vF58NR8PTFdYk2SozcHexX4Q69jbdQAsrsP7B
### old releases on github: [sergey6661313/ScalpiEditor/releases](https://github.com/sergey6661313/ScalpiEditor/releases)
### FAQ:
* why did I refuse to parse the colon in the file name?
In the linux operating system, files with a colon in the name are often created.
* nothing work.
Use only stable version, or green commits.
* mouse not work
Grab mouse - bad idea. I use scroling for view terminal history.
writed from zig language for linux terminals.
Initially I wrote the editor exclusively in zig, but then I wanted to rewrite it to just C in future.
error system:
zig: The error system in zig is good, but it does not help with segfaults.
I still have to look for the error with binary search, stupidly placing debugging in the program.
C: no error system - less asm output code.
unwraping:
zig: I need stupid explicit casting or unwraping for "[*c]" and "?"
c: i can write "*ptr" or ptr[0] and its just work.
No matter to real pointer value - null or not.
and i can write "if (ptr) {...}" for just check it.
Moreover, in some libraries "-1" is sometimes returned as an error value instead of a pointer,
which completely breaks the innovation of mandatory null checks.
tagged unions:
zig: Types like Tagged union are generally confusing. zig hust hided tag.
c: It is much easier to use structures with a EXPLICIT tag and data.
## Editor Functionality:
Handles input/output operations, including reading from and writing to the terminal.
Supports text manipulation features such as inserting, deleting, and navigating through text.
Includes clipboard operations, marking lines, and easy motion for quick navigation.
Provides functionality to fold and unfold sections of the text based on indentation.
Supports saving and loading files, including external copying using a temporary file.
Implements a macro recording and playback system for repetitive tasks.
Provides support for commentary highlighting and setting various font styles for text. (in src)
## Noteworthy Features
Easy Motion: A mode for quick navigation within the text using key shortcuts.
Macro Recording: Allows recording sequences of key presses to be replayed later.
Text Folding: Automatically folds sections of text based on indentation levels.
Clipboard Integration: Supports external clipboard operations via a temporary file.
## videos (not tutorials. deprecated. many keys remaped. But idea of navigating is showed...):
https://www.youtube.com/watch?v=8sJJOQeyOTE
https://www.youtube.com/watch?v=8qQlMbE8Zmw
https://www.youtube.com/watch?v=51ao2416ioE&t=60s
## main dev page:
https://chiselapp.com/user/sergey6661313/repository/ScalpiEditor/
## Download src:
select version:
https://chiselapp.com/user/sergey6661313/repository/ScalpiEditor/
just open file main.c/main.zig in repo and press download.
## FAQ:
* pasta from system clipboard makes the text move apart
try change new_line mode: [alt] + [b]
try paste multiline text only in folded mode: [ctrl] + [e]
* copy to file not work
copy to file copyid only cutted lines...
first clear "cut" buffer with [Alt] + [z]
then copy blocks with ctrl + c to "cut" buffer
and then use [Alt]+[c]
* Why did I refuse to parse the colon in the file name?
In the linux operating system, files with a colon in the name are often created.
* Nothing work or crash on start
try download earleer version by timeline in repo. i mark not work version as red.
Use terminal only with monospaced fonts. crazy fonts giving crazy resaults.
* Does not offer to save the file on exit.
Idiot protection does not work, if the fool is used to pressing "y" on every programm.
* Why i not support UTF? why display only ansi symbols?
just help me write this :))
I search in network how to determine - terminal work with unicode or not.
And i not find how to check this.
Some times terminal work with unicode partially - how to check this?
* no history
partialy undo work - only for current line.
the editor doesn't have to keep the whole history, it's a job for csv.
like fossil, git or any you want (jj is simpliest for this).
do not make many changes to the code at once. It's unhealthy.
* how to open and close multiple files?
just use multiple tabs in your terminal. (if terminal can this)
or use multiple terminals (if you use graphical mode)
or use any terminal multiplexer.
and use [Alt]+[c] and [Alt]+[v] for copy paste
* Mouse not work
I use scroling for view terminal history.
I don not ability to catch only buttons without catch scrolling.
## to support me
with boosty:
https://boosty.to/cutloosedev
with monero:
87T7 qGbA TrM3 a6Br
DyeC jQQf NWtU u3iZ
bHVB MC6W mEbN NE13
Qrrt KhBb e4vF 58NR
8PTF dYk2 Sozc HexX
4Q69 jbdQ Asrs P7B
## additional tips for linux:
i use "sakura" terminal. There no work "ctrl+shift+left" key-sequence but other thing work norm.
previously i try terminals: zutty, kitty, alacritty, Terminology - all good (not perfect) work.
## you may rename and copy binary to "~/bin/se" like this:
cp ./main ~/bin/se
## and add this lines to config (".bashrc" file for bash) for easy use:
export EDITOR="~/bin/se"
export PATH="~/bin:$PATH"
## additional tips for windows:
in windows i recommend use alacritty.
it does not overload the system.
but sometimes you have to use shift+ins instead of the usual ctrl+shift+v.
it can just freeze if change keyboar layout many times. Or just disable keys like "{".
## you can try add folder with bin file to system path like this:
## temporaly:
$env:path += ";$($pwd.Path)"
## temporally for your custom folder
$env:path += ";C:\TopSecret\Bin"
## or
$addPath = 'C:\TopSecret\Bin'
## or for not temporally:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$($pwd.Path)", "User")
## list of bindings:
warning! the operation of certain key combinations depends on the terminal and not on me.
if key combination not work try another terminal.
(for reference: in some programs all key combinations work,
not because their code is correct, but because they use dirty hacks.
For example, they intercept the keyboard through root access.
Such programs need to be installed into the system, instead of just copying.
I don't like installers - that won't happen in my text editor.)
basic keys:
help [F1]
save [Ctrl] + [s]
exit [Ctrl] + [q]
navigation:
use arrows for navigation
enter block [Tab]
leave block [Esc]
go to start of line [Home] or [Ctrl] + [Shift] + [Left]
go to end of line [End] or [Ctrl] + [Shift] + [Right]
go to line from number [Ctrl] + [g]
go to left word [Ctrl] + [Left]
go to right word [Ctrl] + [Right]
go to prev block [Ctrl] + [up]
go to next block [Ctrl] + [Down]
symbol interacting:
insert as prev [any symbol]
delete prev [BackSpace]
delete next [Del]
lines/blocks interacting:
split line [Enter]
join lines [Ctrl] + [j] // also sometimes [Ctrl] + [enter] work. and you can try [num_enter]
move up [Alt] + [Up] // not work on some terminals...
move down [Alt] + [Down]
clear line [Shift] + [Del]
duplicate [Ctrl] + [d]
word interactig:
delete current word: [ctrl] + [w]
copy current word to find buffer: [Alt] + [1]
mark:
mark [Alt] + [m]
jump to mark [Alt] + [g]
move out current block [Alt] + [8]
move block outside mark [Alt] + [0] (only in folded mode)
move block inside mark [Alt] + [9] (only in folded mode)
move block before mark [Alt] + [0]
macroses:
start record macro [F1]
stop record macro [F2]
play latest recorded macro [F3]
also there are many buffers:
1) buffer for blocks/lines:
cut [Ctrl] + [x]
copy [Ctrl] + [c]
paste [Ctrl] + [v]
discard cutted/coppied [Alt] + [z]
2) external buffer (file "clipboard.txt")
copy [Alt] + [c]
paste [Alt] + [v]
3) using buffer for finding text:
copy current word [Alt] + [1]
find prev: [Alt] + [2]
find next: [Alt] + [3]
paste [Alt] + [4]
replace finded: [Alt] + [6] // for replace need cursor placed on start of finding text
change mode:
fold/unfold [Ctrl] + [e]
edit finding buffer [Ctrl] + [f]
edit replace buffer: [Alt] + [5]
auto space [alt] + [b]
easy motion:
horizontal: [Alt] + [q]
vertical: [Alt] + [e]
|