denary 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. denary-0.0.1/LICENSE +21 -0
  2. denary-0.0.1/PKG-INFO +445 -0
  3. denary-0.0.1/README.md +426 -0
  4. denary-0.0.1/denary/__init__.py +0 -0
  5. denary-0.0.1/denary/__main__.py +4 -0
  6. denary-0.0.1/denary/ai/__init__.py +0 -0
  7. denary-0.0.1/denary/ai/completions.py +230 -0
  8. denary-0.0.1/denary/buf.py +1446 -0
  9. denary-0.0.1/denary/buf_actions.py +572 -0
  10. denary-0.0.1/denary/chunked_lines.py +302 -0
  11. denary-0.0.1/denary/config.py +293 -0
  12. denary-0.0.1/denary/display_colors.py +173 -0
  13. denary-0.0.1/denary/displays.py +293 -0
  14. denary-0.0.1/denary/editor.py +8670 -0
  15. denary-0.0.1/denary/events.py +57 -0
  16. denary-0.0.1/denary/external_tui.py +305 -0
  17. denary-0.0.1/denary/file_explorer.py +817 -0
  18. denary-0.0.1/denary/file_viewer.py +583 -0
  19. denary-0.0.1/denary/fzf_search.py +159 -0
  20. denary-0.0.1/denary/git_utils.py +435 -0
  21. denary-0.0.1/denary/horizontal_scrolling.py +38 -0
  22. denary-0.0.1/denary/http_client.py +756 -0
  23. denary-0.0.1/denary/key_mappings.py +168 -0
  24. denary-0.0.1/denary/lsp/__init__.py +0 -0
  25. denary-0.0.1/denary/lsp/client.py +967 -0
  26. denary-0.0.1/denary/notifications.py +99 -0
  27. denary-0.0.1/denary/prompts.py +362 -0
  28. denary-0.0.1/denary/replacements.py +116 -0
  29. denary-0.0.1/denary/syntax/__init__.py +0 -0
  30. denary-0.0.1/denary/syntax/comments.py +14 -0
  31. denary-0.0.1/denary/syntax/custom_lexers.py +499 -0
  32. denary-0.0.1/denary/syntax/gen_comments.py +347 -0
  33. denary-0.0.1/denary/syntax/hilighing.py +989 -0
  34. denary-0.0.1/denary/themes/__init__.py +1 -0
  35. denary-0.0.1/denary/themes/default.py +2695 -0
  36. denary-0.0.1/denary/undo_utils.py +106 -0
  37. denary-0.0.1/pyproject.toml +34 -0
denary-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jordaly José Suriel Vargas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
denary-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,445 @@
1
+ Metadata-Version: 2.3
2
+ Name: denary
3
+ Version: 0.0.1
4
+ Summary: A curses-based text editor with syntax highlighting
5
+ License: MIT
6
+ Author: Jordaly Suriel
7
+ Requires-Python: >=3.11,<3.15
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: Pygments (>=2.20)
14
+ Requires-Dist: pathspec (>=1.0.4)
15
+ Requires-Dist: platformdirs (>=4.9.6)
16
+ Requires-Dist: windows-curses (>=2.4.2) ; sys_platform == "win32"
17
+ Description-Content-Type: text/markdown
18
+
19
+
20
+ ## Editor Documentation
21
+ ```
22
+ ,gggggggggggg,
23
+ dP"""88""""""Y8b,
24
+ Yb, 88 `8b,
25
+ `" 88 `8b
26
+ 88 Y8
27
+ 88 d8 ,ggg, ,ggg,,ggg, ,gggg,gg ,gggggg, gg gg
28
+ 88 ,8P i8" "8i ,8" "8P" "8, dP" "Y8I dP""""8I I8 8I
29
+ 88 ,8P' I8, ,8I I8 8I 8I i8' ,8I ,8' 8I I8, ,8I
30
+ 88______,dP' `YbadP' ,dP 8I Yb,,d8, ,d8b,,dP Y8,,d8b, ,d8I
31
+ 888888888P" 888P"Y8888P' 8I `Y8P"Y8888P"`Y88P `Y8P""Y88P"888
32
+ ,d8I'
33
+ ,dP'8I
34
+ ,8" 8I
35
+ I8 8I
36
+ `8, ,8I
37
+ `Y8P"
38
+ ```
39
+
40
+ A modal terminal editor built on curses with a command-driven,
41
+ event-based architecture and chunked text storage.
42
+
43
+ Includes syntax highlighting, multi-buffer management,
44
+ registers and markers, undo/redo history, Git integration,
45
+ async LSP support, subprocess execution, and HTTP requests.
46
+
47
+ ## Key Bindings
48
+
49
+ ### Core Editing
50
+
51
+ | Shortcut | Action |
52
+ | ---------- | ------------------------- |
53
+ | **Ctrl-S** | Save file |
54
+ | **Ctrl-Q** | Quit editor |
55
+ | **Ctrl-Y** | Copy |
56
+ | **Ctrl-X** | Cut |
57
+ | **Ctrl-U** | Paste |
58
+ | **Ctrl-E** | Undo |
59
+ | **Ctrl-O** | Open file |
60
+ | **Ctrl-D** | Delete buffer |
61
+ | **Ctrl-/** | Search files |
62
+ | **Ctrl-Z** | Send editor to background |
63
+
64
+ ---
65
+
66
+ ### Buffer / File Management
67
+
68
+ | Shortcut | Action |
69
+ | ---------- | --------------- |
70
+ | **Ctrl-L** | Buffer picker |
71
+ | **Ctrl-P** | Previous buffer |
72
+ | **Ctrl-N** | Next buffer |
73
+ | **Ctrl-W** | File explorer |
74
+
75
+ ---
76
+
77
+ ### Navigation & Searching
78
+
79
+ | Shortcut | Action |
80
+ | -------------- | ---------------- |
81
+ | **Ctrl-F** | Find |
82
+ | **Ctrl-G** | Go to line |
83
+ | **Ctrl-Space** | Show suggestions |
84
+
85
+ ---
86
+
87
+ ### Vim-Style Navigation
88
+
89
+ | Shortcut | Action |
90
+ | --------------------- | ------------------------- |
91
+ | **Alt-H / J / K / L** | Move cursor (vim style) |
92
+ | **Alt-;** | Toggle selection mode |
93
+ | **Alt-I / Alt-O** | Jump between punctuation |
94
+ | **Alt-9 / Alt-0** | Jump to start/end of line |
95
+ | **Alt-↑ / Alt-↓** | Scroll up/down |
96
+ | **Alt-U** | Paste system clipboard |
97
+ | **Alt-N** | Repeat last search |
98
+ | **Alt-P** | Reverse search repeat |
99
+ | **Alt-M** | Search word under cursor |
100
+ | **Alt-W** | File search |
101
+
102
+ ---
103
+
104
+ ### Normal Mode Marks & LSP
105
+
106
+ | Shortcut | Action |
107
+ | -------- | -------------------------------- |
108
+ | **m** | Set marker |
109
+ | **'** | Save and use clipboard registers |
110
+ | **`** | Go to last buffer |
111
+ | **K** | Show LSP definition |
112
+ | **q** | Show line diagnostics |
113
+ | **;** | Go to LSP definition |
114
+
115
+ ---
116
+
117
+ ## Commands
118
+
119
+ ### Buffer Actions
120
+
121
+ | Command | Description |
122
+ | --------------------------------- | ------------------- |
123
+ | `h` / `help` | Show help |
124
+ | `q` / `quit` | Exit editor |
125
+ | `w` / `write` | Save current buffer |
126
+ | `ls` / `list` | List open buffers |
127
+ | `open` | Open a file |
128
+ | `bufnew` | Create new buffer |
129
+ | `nbuf` / `nextbuf` / `next` / `n` | Next buffer |
130
+ | `pbuf` / `prevbuf` / `prev` / `p` | Previous buffer |
131
+ | `delbuf` / `d` | Delete buffer |
132
+ | `ff` | File search |
133
+ | `ffr` | New file search |
134
+ | `fb` | Buffer picker |
135
+ | `ex` | File explorer |
136
+
137
+ ---
138
+
139
+ ### UI & Behavior
140
+
141
+ | Command | Description |
142
+ | --------------- | -------------------- |
143
+ | `themes` | Change editor theme |
144
+ | `ln` | Toggle line numbers |
145
+ | `gch` | Toggle Git highlight |
146
+ | `scrolloff <n>` | Set scroll offset |
147
+
148
+ ---
149
+
150
+ ### Markers
151
+
152
+ | Command | Description |
153
+ | -------------- | ----------------------------- |
154
+ | `m` / `marker` | Add local/global marker |
155
+ | `pm` | Pick marker |
156
+ | `dm` | Delete markers in this buffer |
157
+ | `dgm` | Delete global markers |
158
+ | `dpm` | Delete specific marker |
159
+ | `dam` | Delete all markers |
160
+
161
+ ---
162
+
163
+ ### Text Utilities
164
+
165
+ | Command | Description |
166
+ | -------------------------------- | ------------------ |
167
+ | `clear_registers` | Reset registers |
168
+ | `reset_h_matches` | Reset highlighting |
169
+ | `replace` | Replace text |
170
+ | `comment` | Toggle comment |
171
+ | `upper` / `lower` / `capitalize` | Change case |
172
+ | `filetype <type>` | Set syntax mode |
173
+
174
+ ---
175
+
176
+ ## Utilities
177
+
178
+ | Command | Description |
179
+ |----------------------------------|-------------------------------------------------------------------|
180
+ | `align` | Align text by a delimiter (e.g. `=`, `:`, `,`, `|`) |
181
+ | `column_edit` | Insert, replace, or delete text within column ranges per line |
182
+ | `date` | Copy date |
183
+ | `datetime` | Copy current date & time |
184
+ | `file_path` | Copy current file path |
185
+ | `json_format` | Format JSON in selection or entire file |
186
+ | `number_lines` | Add line numbers to each line |
187
+ | `rejoin` | Split and rejoin selection or entire file using a delimiter |
188
+ | `remove_empty_lines` | Remove blank or whitespace-only lines |
189
+ | `reverse_lines` | Reverse the order of lines |
190
+ | `shuffle_lines` | Randomly shuffle lines |
191
+ | `slugify` | Convert text to URL-friendly slug format |
192
+ | `sort` / `sort_r` | Sort selection or entire file by lines (normal or reverse) |
193
+ | `trim` / `trim_l` / `trim_r` | Trim whitespace (both, left, or right) per line |
194
+ | `unique_lines` / `dedup` | Remove duplicate lines (keep first occurrence) |
195
+ | `uuid` | Copy random UUID |
196
+ | `wrap` | Wrap text to a specified width |
197
+
198
+ ---
199
+
200
+ ## Git Commands
201
+
202
+ | Command | Description |
203
+ | ---------------- | ------------------------------------- |
204
+ | `git_status` | Show Git status |
205
+ | `git_diff` | Show diff |
206
+ | `git_commit_all` | Commit all |
207
+ | `git_blame` | Show blame |
208
+ | `git_log` | Show history |
209
+ | `git_refresh` | Refresh state |
210
+ | `git_hunk` | Show previous version of changed code |
211
+
212
+ ---
213
+
214
+ ## LSP Commands
215
+
216
+ | Command | Description |
217
+ | --------------------------- | ---------------------------------- |
218
+ | `lsp_diagnostics` | Show buffer diagnostics |
219
+ | `lsp_hover` | Show hover info |
220
+ | `lsp_definition` | Go to definition |
221
+ | `lsp_refresh` | Restart LSP for buffer |
222
+ | `lsp_line_diagnostics` | Show diagnostics for current line |
223
+ | `lsp_clear_diagnostics` | Clear diagnostics |
224
+ | `clear_line_diag` / `clrld` | Clear diagnostics for current line |
225
+
226
+ ---
227
+
228
+ ## AI Commands
229
+
230
+ | Command | Description |
231
+ | ------------------- | ----------------------------------------- |
232
+ | `ai` | Send a custom instruction to the AI |
233
+ | `ai_gen` | Generate code at the cursor |
234
+ | `ai_review` | Review Git diff for issues |
235
+ | `ai_commit_message` | Generate a commit message from Git diff |
236
+ | `ai_get` | Retrieve AI result at the cursor |
237
+ | `ai_show` | Show AI completion picker |
238
+ | `ai_remove` | Cancel/remove AI completion at the cursor |
239
+ | `change_ai_model` | Change the active AI model |
240
+
241
+ ---
242
+
243
+ ## HTTP Request Execution
244
+
245
+ Select a block and run:
246
+
247
+ | Command | Description |
248
+ | --------------------------- | ---------------------------------- |
249
+ | `req` | Make http request |
250
+
251
+ ### Request Format
252
+
253
+ ```
254
+ <HTTP_METHOD> <URL>
255
+ <Header>: <Value>
256
+ <Header>: <Value>
257
+
258
+ <Optional Body>
259
+ ```
260
+
261
+ ### Examples
262
+
263
+ #### GET:
264
+
265
+ ```
266
+ GET https://jsonplaceholder.typicode.com/todos/1
267
+ Accept: application/json
268
+ ```
269
+
270
+ #### POST:
271
+
272
+ ```
273
+ POST https://jsonplaceholder.typicode.com/posts
274
+ Content-Type: application/json
275
+
276
+ {
277
+ "title": "Hello world",
278
+ "body": "Testing request from editor",
279
+ "userId": 1
280
+ }
281
+ ```
282
+
283
+
284
+ ## Regex Replacement
285
+
286
+ Perform regex-based find and replace in the current buffer.
287
+
288
+ | Command | Description |
289
+ | --------- | ------------------------------ |
290
+ | `replace` | Run a regex search and replace |
291
+
292
+ ---
293
+
294
+ ## Capture Groups
295
+
296
+ Parentheses create **capture groups** that can be reused in the replacement.
297
+
298
+ | Syntax | Meaning |
299
+ | ------ | ------------ |
300
+ | `\0` | Entire match |
301
+ | `\1` | First group |
302
+ | `\2` | Second group |
303
+ | `\3` | Third group |
304
+
305
+ Example
306
+
307
+ Find
308
+
309
+ ```
310
+ (\w+)\s+(\w+)
311
+ ```
312
+
313
+ Replace
314
+
315
+ ```
316
+ \2 \1
317
+ ```
318
+
319
+ Result
320
+
321
+ ```
322
+ hello world → world hello
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Named Capture Groups
328
+
329
+ Groups can also be named.
330
+
331
+ ```
332
+ (?P<name>pattern)
333
+ ```
334
+
335
+ Named groups are referenced in the replacement using:
336
+
337
+ ```
338
+ \g<name>
339
+ ```
340
+
341
+ Example
342
+
343
+ Find
344
+
345
+ ```
346
+ (?P<first>\w+)\s+(?P<last>\w+)
347
+ ```
348
+
349
+ Replace
350
+
351
+ ```
352
+ \g<last> \g<first>
353
+ ```
354
+
355
+ Result
356
+
357
+ ```
358
+ john doe → doe john
359
+ ```
360
+
361
+ ---
362
+
363
+ ## Case Transformations
364
+
365
+ The replacement string supports case modifiers.
366
+
367
+ | Syntax | Effect |
368
+ | ------ | ------------------------ |
369
+ | `\U` | Uppercase until `\E` |
370
+ | `\L` | Lowercase until `\E` |
371
+ | `\u` | Uppercase next character |
372
+ | `\l` | Lowercase next character |
373
+ | `\E` | End transformation |
374
+
375
+ Example
376
+
377
+ Find
378
+
379
+ ```
380
+ select
381
+ ```
382
+
383
+ Replace
384
+
385
+ ```
386
+ \U\0\E
387
+ ```
388
+
389
+ Result
390
+
391
+ ```
392
+ select → SELECT
393
+ ```
394
+
395
+ ---
396
+
397
+ ## Word Boundaries
398
+
399
+ `\b` matches the boundary between a word and a non-word character.
400
+
401
+ Example
402
+
403
+ Find
404
+
405
+ ```
406
+ \bselect\b
407
+ ```
408
+
409
+ Matches
410
+
411
+ ```
412
+ select
413
+ ```
414
+
415
+ Does not match
416
+
417
+ ```
418
+ selected
419
+ ```
420
+
421
+ ---
422
+
423
+ ## Example: SQL Keyword Formatting
424
+
425
+ Find
426
+
427
+ ```
428
+ \b(select|from|where|join|group\s+by|order\s+by)\b
429
+ ```
430
+
431
+ Replace
432
+
433
+ ```
434
+ \U\0\E
435
+ ```
436
+
437
+ Result
438
+
439
+ ```
440
+ select name from users where id = 1
441
+
442
+ SELECT name FROM users WHERE id = 1
443
+ ```
444
+
445
+