Skip to content
hunghg255Public

About

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

MyCode icon

MyCode

A small, fast code editor written in Go. It draws a native UI on the GPU with MyGo, with no webview and no Electron, and the packaged app is about 18 MB.

By hunghg255, from Mayoi by chencheng.

mayoi-motion-graphics.mp4

Features

  • Editor: tabs with preview tabs, Chroma syntax highlighting, a minimap, indent guides, sticky scroll, breadcrumbs, word wrap, and ⇧⌘T to reopen closed tabs
  • Smart editing: auto-indent, auto-closing brackets and quotes, line commands, sorting, and per-tab undo
  • Columns: split the editor side by side, drag tabs between columns, and lock a column for terminals
  • Explorer: a live file tree that follows the disk, dims Git-ignored files, and shows Material or Lucide file icons
  • Quick open: fuzzy file search, go to line (:42), go to symbol (@) and a command palette (>, ⇧⌘P)
  • Find and replace: case, whole-word and regex matching, searched in the background in large files
  • Search: find and replace across the folder's files (⇧⌘F, ⇧⌘H), with files to include and exclude, and a preview of each replacement
  • Git: a source control view to stage, commit, amend, undo, pull, push, sync and force push, every change in one diff, folded around the changes, inline or side by side, with hunk staging, a graph of the commits with their branches and tags, gutter marks that revert or stage a change, inline blame, branches, stash and merge conflicts
  • Review comments: comment on lines of a diff or a file, then send them all to the agent in the terminal
  • Terminal: Ghostty's emulator (libghostty-vt), in the bottom panel or in a tab, with profiles (PowerShell, Git Bash, WSL and your own) and ⌘-click on file:line:col to open it in the editor
  • Image viewer: PNG, JPEG, GIF, WebP and BMP
  • Previews: a live preview of Markdown and SVG beside the source (⇧⌘V)
  • Windows: project tabs that keep every folder in one window, a welcome page with the recent folders, Open Recent (⌃R), and a mycode shell command
  • Themes: light and dark, The Matrix with digital rain, and Claude and Qoder, each in light and dark
  • Auto save, and every window reopened as you left it, with its columns, tabs and carets
  • Settings: JSON files applied as you save them, with the code's and the terminal's fonts, weight, ligatures and line height, and keyboard shortcuts in VS Code's format (see docs/SETTINGS.md)

See docs/FEATURES.md for the details, docs/ARCHITECTURE.md for a tour of the source and how fast it runs, and CONTRIBUTING.md to build, test and release MyCode.

Documentation site

docs/ is also a Vite + React site that presents every feature of MyCode, with the screenshots and shortcuts. It needs Node.js 20.19 or later:

cd docs
npm install
npm run dev        # serve it at http://localhost:5173
npm run build      # build a static site into docs/dist

Tour

Columns: split the editor and drag tabs between columns
Two columns of Go source
Peek a change: click a gutter mark to see the lines at HEAD, then revert or stage them
A change peeked from the gutter
Side-by-side diff: every change in one tab, with changed words tinted
Source control with a side-by-side diff
Commit graph: branches, tags and merges, and each commit's changes in a tab
The commit graph and a commit's diff
Markdown preview: live beside the source
A Markdown file and its preview
Terminal: Ghostty's emulator in the panel or, here, in a tab
A terminal in a column beside the code
Command palette: every command by name, with its shortcut
The command palette
Search in files: as you type, with each match in context
Search across the folder's files
Project tabs: every folder in one window, on a rail
Projects on a rail at the left of the window
The Matrix: one of the themes, with the whole window in the code's font
The Matrix theme

Requirements

  • macOS 13 or later
  • Go 1.27 or later

MyCode also builds for Linux and Windows.

Getting started

go run ./cmd/mayoi ~/some/project    # open a folder or a file
go tool mygo build                   # build build/darwin-arm64/MyCode.app and a .dmg

To open folders from a shell, choose File → Install 'mycode' Command on macOS, then run mycode . or mycode <file>. On Windows the installed app adds mycode to your PATH and Open with MyCode to File Explorer's menu of folders and files by itself.

Keyboard shortcuts

Shortcut Action
⌘P / ⇧⌘O / ⌃G Quick open / go to symbol / go to line
⌘F / ⌥⌘F / ⌘G Find / replace / next match
⇧⌘F / ⇧⌘H Find in files / replace in files
⌘S / ⇧⌘S / ⌥⌘S Save / save as / save all
⌘O / ⌥⌘O / ⌃R Open folder / open folder in a new window / open recent
⌘N / ⌘W / ⌘1…9 / ⌃Tab New file / close tab / go to tab / next tab
⇧⌘T Reopen closed tab
⇧⌘] / ⇧⌘[ / ⌃⌘1…9 Next / previous / go to project, with project tabs
⌘\ / ⌥⌘→ / ⌥⌘← Split right / next column / previous column
⌘B / ⌃` / ⌃⇧` Toggle sidebar / toggle terminal panel / new terminal
⌘Z / ⇧⌘Z Undo / redo
Tab / ⇧Tab, ⌘] / ⌘[ Indent / outdent
⌘/ Toggle line comment
⌃⇧G / ⌥F5 / ⇧⌥F5 Source control / next change / previous change
⇧⌘M Add review comment
⌥↑ / ⌥↓, ⇧⌥↑ / ⇧⌥↓ Move line / copy line
⇧⌘K / ⌘↵ / ⇧⌘↵ Delete line / insert line below / insert line above
⌘L / ⇧⌘\ Select line / go to bracket
⌘= / ⌘- / ⌘0 Zoom text or image in / out / reset
⇧⌘V Toggle Markdown or SVG preview
⌥Z Toggle word wrap for the current tab

License

MIT

About

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages