fresh-editor 0.1.43

A lightweight, fast terminal-based text editor with LSP support and TypeScript plugins
Documentation
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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Fresh Editor Configuration",
  "$ref": "#/$defs/Config",
  "$defs": {
    "Config": {
      "type": "object",
      "properties": {
        "active_keybinding_map": {
          "type": "string",
          "description": "Active keybinding map name (e.g., \"default\", \"emacs\", \"vscode\", or a custom name)"
        },
        "check_for_updates": {
          "type": "boolean",
          "description": "Check for new versions on quit (default: true)"
        },
        "editor": {
          "$ref": "#/$defs/EditorConfig",
          "description": "Editor behavior settings (indentation, line numbers, wrapping, etc.)"
        },
        "file_explorer": {
          "$ref": "#/$defs/FileExplorerConfig",
          "description": "File explorer panel settings"
        },
        "keybinding_maps": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/KeymapConfig"
          },
          "description": "Named keybinding maps (user can define custom maps here)\nEach map can optionally inherit from another map"
        },
        "keybindings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Keybinding"
          },
          "description": "Custom keybindings (overrides for the active map)"
        },
        "languages": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/LanguageConfig"
          },
          "description": "Per-language configuration overrides (tab size, formatters, etc.)"
        },
        "lsp": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/LspServerConfig"
          },
          "description": "LSP server configurations by language"
        },
        "menu": {
          "$ref": "#/$defs/MenuConfig",
          "description": "Menu bar configuration"
        },
        "terminal": {
          "$ref": "#/$defs/TerminalConfig",
          "description": "Terminal settings"
        },
        "theme": {
          "type": "string",
          "description": "Color theme name (e.g., \"high-contrast\", \"monokai\", \"solarized-dark\")"
        }
      },
      "description": "Main configuration structure"
    },
    "EditorConfig": {
      "type": "object",
      "properties": {
        "auto_indent": {
          "type": "boolean",
          "description": "Automatically indent new lines based on the previous line"
        },
        "auto_save_interval_secs": {
          "type": "integer",
          "description": "Auto-save interval in seconds for file recovery\nModified buffers are saved to recovery files at this interval.\nDefault: 2 seconds for fast recovery with minimal data loss.\nSet to 0 to disable periodic auto-save (manual recovery only)."
        },
        "enable_inlay_hints": {
          "type": "boolean",
          "description": "Whether to enable LSP inlay hints (type hints, parameter hints, etc.)"
        },
        "estimated_line_length": {
          "type": "integer",
          "description": "Estimated average line length in bytes (used for large file line estimation)\nThis is used by LineIterator to estimate line positions in large files\nwithout line metadata. Typical values: 80-120 bytes."
        },
        "highlight_context_bytes": {
          "type": "integer",
          "description": "Number of bytes to look back/forward from the viewport for syntax highlighting context.\nLarger values improve accuracy for multi-line constructs (strings, comments, nested blocks)\nbut may slow down highlighting for very large files.\nDefault: 10KB (10000 bytes)"
        },
        "highlight_timeout_ms": {
          "type": "integer",
          "description": "Maximum time in milliseconds for syntax highlighting per frame"
        },
        "large_file_threshold_bytes": {
          "type": "integer",
          "description": "File size threshold in bytes for \"large file\" behavior\nFiles larger than this will:\n- Skip LSP features\n- Use constant-size scrollbar thumb (1 char)\nFiles smaller will count actual lines for accurate scrollbar rendering"
        },
        "line_numbers": {
          "type": "boolean",
          "description": "Show line numbers in the gutter"
        },
        "line_wrap": {
          "type": "boolean",
          "description": "Wrap long lines to fit the window width"
        },
        "mouse_hover_delay_ms": {
          "type": "integer",
          "description": "Delay in milliseconds before a mouse hover triggers an LSP hover request.\nLower values show hover info faster but may cause more LSP server load.\nDefault: 500ms"
        },
        "mouse_hover_enabled": {
          "type": "boolean",
          "description": "Whether mouse hover triggers LSP hover requests.\nWhen enabled, hovering over code with the mouse will show documentation.\nDefault: true"
        },
        "recovery_enabled": {
          "type": "boolean",
          "description": "Whether to enable file recovery (Emacs-style auto-save)\nWhen enabled, buffers are periodically saved to recovery files\nso they can be recovered if the editor crashes."
        },
        "relative_line_numbers": {
          "type": "boolean",
          "description": "Show line numbers relative to cursor position"
        },
        "scroll_offset": {
          "type": "integer",
          "description": "Minimum lines to keep visible above/below cursor when scrolling"
        },
        "snapshot_interval": {
          "type": "integer",
          "description": "Undo history snapshot interval (number of edits between snapshots)"
        },
        "syntax_highlighting": {
          "type": "boolean",
          "description": "Enable syntax highlighting for code files"
        },
        "tab_size": {
          "type": "integer",
          "description": "Number of spaces per tab character"
        }
      },
      "description": "Editor behavior configuration"
    },
    "FileExplorerConfig": {
      "type": "object",
      "properties": {
        "custom_ignore_patterns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Custom patterns to ignore (in addition to .gitignore)"
        },
        "respect_gitignore": {
          "type": "boolean",
          "description": "Whether to respect .gitignore files"
        },
        "show_gitignored": {
          "type": "boolean",
          "description": "Whether to show gitignored files by default"
        },
        "show_hidden": {
          "type": "boolean",
          "description": "Whether to show hidden files (starting with .) by default"
        },
        "width": {
          "type": "number",
          "description": "Width of file explorer as percentage (0.0 to 1.0)"
        }
      },
      "description": "File explorer configuration"
    },
    "HighlighterPreference": {
      "type": "string",
      "enum": [
        "auto",
        "tree-sitter",
        "textmate"
      ],
      "default": "auto",
      "description": "Preference for which syntax highlighting backend to use"
    },
    "KeyPress": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Key name (e.g., \"a\", \"Enter\", \"F1\")"
        },
        "modifiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Modifiers (e.g., [\"ctrl\"], [\"ctrl\", \"shift\"])"
        }
      },
      "required": [
        "key"
      ],
      "description": "A single key in a sequence"
    },
    "Keybinding": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "description": "Action to perform (e.g., \"insert_char\", \"move_left\")"
        },
        "args": {
          "type": "object",
          "additionalProperties": {},
          "description": "Optional arguments for the action"
        },
        "key": {
          "type": "string",
          "description": "Key name (e.g., \"a\", \"Enter\", \"F1\") - for single-key bindings"
        },
        "keys": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/KeyPress"
          },
          "description": "Key sequence for chord bindings (e.g., [{\"key\": \"x\", \"modifiers\": [\"ctrl\"]}, {\"key\": \"s\", \"modifiers\": [\"ctrl\"]}])\nIf present, takes precedence over key + modifiers"
        },
        "modifiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Modifiers (e.g., [\"ctrl\"], [\"ctrl\", \"shift\"]) - for single-key bindings"
        },
        "when": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional condition (e.g., \"mode == insert\")"
        }
      },
      "required": [
        "action"
      ],
      "description": "Keybinding definition"
    },
    "KeymapConfig": {
      "type": "object",
      "properties": {
        "bindings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Keybinding"
          },
          "description": "Keybindings defined in this keymap"
        },
        "inherits": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional parent keymap to inherit from"
        }
      },
      "description": "Keymap configuration (for built-in and user-defined keymaps)"
    },
    "LanguageConfig": {
      "type": "object",
      "properties": {
        "auto_indent": {
          "type": "boolean",
          "description": "Whether to auto-indent"
        },
        "comment_prefix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Comment prefix"
        },
        "extensions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "File extensions for this language"
        },
        "grammar": {
          "type": "string",
          "description": "Tree-sitter grammar name"
        },
        "highlighter": {
          "$ref": "#/$defs/HighlighterPreference",
          "description": "Preferred highlighter backend (auto, tree-sitter, or textmate)"
        },
        "textmate_grammar": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Path to custom TextMate grammar file (optional)\nIf specified, this grammar will be used when highlighter is \"textmate\""
        }
      },
      "description": "Language-specific configuration"
    },
    "LspServerConfig": {
      "type": "object",
      "properties": {
        "args": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Arguments to pass to the server"
        },
        "auto_start": {
          "type": "boolean",
          "description": "Whether to auto-start this LSP server when opening matching files\nIf false (default), the server must be started manually via command palette"
        },
        "command": {
          "type": "string",
          "description": "Command to spawn the server"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the server is enabled"
        },
        "initialization_options": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "description": "Initialization options sent during LSP initialize request.\nSome language servers (like Deno) require specific options here.\nFor example, Deno requires `{\"enable\": true}` to enable completions."
        },
        "process_limits": {
          "$ref": "#/$defs/ProcessLimits",
          "description": "Process resource limits (memory and CPU)"
        }
      },
      "required": [
        "command"
      ],
      "description": "Configuration for a language server"
    },
    "Menu": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MenuItem"
          },
          "description": "Menu items (actions, separators, or submenus)"
        },
        "label": {
          "type": "string",
          "description": "Display label for the menu (e.g., \"File\", \"Edit\")"
        }
      },
      "required": [
        "items",
        "label"
      ],
      "description": "A top-level menu in the menu bar"
    },
    "MenuConfig": {
      "type": "object",
      "properties": {
        "menus": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Menu"
          },
          "description": "List of top-level menus in the menu bar"
        }
      },
      "description": "Menu bar configuration"
    },
    "MenuItem": {
      "type": "string",
      "enum": [
        "separator",
        "action",
        "label: string",
        "action: string",
        "args: hashmap<string, serde_json::value>",
        "when: option<string>",
        "checkbox: option<string>"
      ],
      "description": "A menu item (action, separator, or submenu)"
    },
    "ProcessLimits": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Enable resource limiting (can be disabled per-platform)"
        },
        "max_cpu_percent": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Maximum CPU usage as percentage of total CPU (None = no limit)\nFor multi-core systems, 100% = 1 core, 200% = 2 cores, etc."
        },
        "max_memory_mb": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Maximum memory usage in megabytes (None = no limit)"
        }
      },
      "description": "Configuration for process resource limits"
    },
    "TerminalConfig": {
      "type": "object",
      "properties": {
        "jump_to_end_on_output": {
          "type": "boolean",
          "description": "When viewing terminal scrollback and new output arrives,\nautomatically jump back to terminal mode (default: true)"
        }
      },
      "description": "Terminal configuration"
    }
  }
}