Skip to content

Neo-vortex/edit-sharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

EditSharp

A modern terminal-based text editor in C# inspired by Microsoft's edit โ€” a similar project built in Rust.

image image image image image image image

๐ŸŽฏ Quick Start

Download

Choose your edition from the Releases page:

  • Trimmed AOT: Ultra-lightweight, instant startup (~5-10MB)
  • Full Edition: Feature-complete with plugin support (~20-30MB)

Installation

Linux/macOS:

tar -xzf edit-sharp-*.tar.gz
chmod +x edit-sharp
./edit-sharp [filename]

Windows:

# Extract the .zip file, then:
edit-sharp.exe [filename]

๐Ÿ“ฆ Two Editions

๐Ÿชถ Trimmed AOT Edition

Perfect for: Daily text editing, fast startup, minimal resource usage

Features:

  • โœ… Native AOT compiled - instant startup
  • โœ… Smallest file size (~5-10MB)
  • โœ… No runtime dependencies
  • โœ… All core editing features
  • โœ… Line numbers, status bar, word wrap
  • โœ… File operations (new, open, save, save as)
  • โŒ No plugin support
  • โŒ No Command Palette

Build Configuration: Release-Trimmed

๐Ÿ”Œ Full Edition

Perfect for: Power users, plugin developers, extensibility

Features:

  • โœ… Full Lua plugin support
  • โœ… .NET plugin support
  • โœ… Command Palette (Ctrl+Shift+P)
  • โœ… Extensible with custom commands
  • โœ… All core editing features
  • โœ… Regex find/replace (via plugins)
  • โœ… Text transformations (via plugins)
  • โš ๏ธ Larger file size (~20-30MB)
  • โš ๏ธ Slightly slower startup

Build Configuration: Release-Full

๐ŸŽฎ Usage

Basic Keyboard Shortcuts

Shortcut Action
Ctrl+N New File
Ctrl+O Open File
Ctrl+S Save File
Ctrl+Shift+S Save As
Ctrl+Q Exit

Full Edition Only

Shortcut Action
Ctrl+Shift+P Open Command Palette

๐Ÿ”Œ Plugin Development (Full Edition Only)

Lua Plugins

Create a plugins/ folder next to the executable and add .lua files.

Example Plugin:

-- hello.lua
editor.registerCommand(
    "example.hello",
    "Say Hello",
    "Examples",
    function()
        local name = editor.getInput("Name", "Enter your name:", "")
        if name and name ~= "" then
            editor.showMessage("Hello", "Hello, " .. name .. "!")
        end
    end
)

Lua API

Text Operations:

  • editor.getText() - Get all text
  • editor.setText(text) - Set all text
  • editor.getSelectedText() - Get selection
  • editor.replaceSelectedText(text) - Replace selection
  • editor.insertText(text) - Insert at cursor

User Input:

  • editor.getInput(title, prompt, default) - Single-line input
  • editor.getMultiLineInput(title, prompt, default) - Multi-line input
  • editor.confirm(title, message) - Yes/No confirmation

UI:

  • editor.showMessage(title, message) - Show message dialog
  • editor.setStatus(message) - Update status bar

Commands:

  • editor.registerCommand(id, name, category, function) - Register command

Example Plugins Included

  1. text_transform.lua - Upper/lower/title case, reverse
  2. line_tools.lua - Sort, deduplicate, trim
  3. regex_tools.lua - Regex find/replace
  4. find_replace.lua - Simple find/replace
  5. snippets.lua - Lorem ipsum, date insertion
  6. word_stats.lua - Word count statistics

๐Ÿ› ๏ธ Building from Source

Requirements

  • .NET 10.0 SDK or later
  • Terminal.Gui 1.19.0 (auto-installed)
  • MoonSharp 2.0.0 (Full edition only, auto-installed)

Build Commands

Linux/macOS:

chmod +x build.sh
./build.sh

Windows:

.\build.ps1

Manual Build:

# Trimmed AOT Edition
dotnet publish -c Release-Trimmed -r linux-x64 --self-contained

# Full Edition
dotnet publish -c Release-Full -r linux-x64 --self-contained

Build Configurations

Configuration AOT Trimmed Plugins
Release-Trimmed โœ… โœ… โŒ
Release-Full โŒ โŒ โœ…
Release โŒ โŒ โœ… (same as Release-Full)
Debug โŒ โŒ โœ…

๐Ÿ“Š Performance Comparison

Tested on Linux x64:

Metric Trimmed AOT Full Edition
Binary Size ~8 MB ~25 MB
Startup Time ~50ms ~200ms
Memory (idle) ~15 MB ~30 MB
Plugin Support โŒ โœ…

๐Ÿค Contributing

Contributions welcome! Please ensure:

  1. Code works in both Trimmed and Full builds
  2. Use #if PLUGIN_SUPPORT for plugin-specific code
  3. Test both editions before submitting PR

๐Ÿ“ License

MIT License - See LICENSE file

๐Ÿ› Known Issues

Trimmed AOT Edition:

  • Cannot load plugins (by design)
  • No Command Palette (by design)

Full Edition:

  • Larger binary size
  • Slower startup than Trimmed edition

๐Ÿš€ Roadmap

  • Syntax highlighting (Full edition)
  • More built-in Lua plugins
  • Configuration file support
  • Theme customization
  • Undo/Redo support
  • Search/Replace UI (without plugins)

๐Ÿ’ฌ Support

  • GitHub Issues: Report bugs or request features
  • Discussions: Ask questions or share plugins

Made with โค๏ธ using .NET and Terminal.Gui

About

A simple editor for simple needs. but in C#!

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors