Skip to content
TejasBaidPublic

About

A rust based lightweight code editor that works faster than most alternatives

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

Raze icon

Raze

A small, fast code editor for macOS, written in Rust on GPUI.

Raze with a Rust file open, the file tree on the left

Raze puts a folder in a window: a file tree, tabs, syntax highlighting, find and replace, quick open, search across files, and a built-in terminal. The window frame is translucent, and you can tint it with up to three colours. Raze starts in about 150–220 ms, and scrolling a 20,000-line file uses about 2 ms of each frame (see performance).

Features

  • Editing.
    • Multiple cursors, and undo that groups typing into words.
    • Auto-indent, comment toggling, and moving or duplicating lines.
    • Brackets and quotes pair up automatically.
    • The bracket at the cursor is matched, and indent guides are shown.
    • Soft wrap and zoom.
  • Text input. Typing goes through the macOS input system, so dead keys, accents, Chinese, Japanese and Korean input, and the emoji picker all work.
  • Highlighting (tree-sitter): Rust, JavaScript/JSX, TypeScript/TSX, Python, Markdown, JSON, shell, HTML, CSS, YAML and TOML.
  • File tree.
    • Type icons for each file, and git status tints.
    • Hides what your .gitignore excludes.
    • Updates live when files change elsewhere.
    • Create, rename, trash, reveal in Finder and copy path from the toolbar or the right-click menu.
  • Find your way around. Fuzzy quick open (⌘P), go to line (⌃G), find and replace (⌘F, ⌥⌘F), and search across the whole folder (⇧⌘F).
  • Terminal. Runs your login shell under the editor (⌃`), built on alacritty_terminal. Drag the gap above it to resize.
  • Files stay safe.
    • Saves are atomic, and keep permissions, symlinks, line endings and indentation.
    • Changes made on disk are picked up.
    • Closing anything with unsaved changes asks first.
  • Windows.
    • Raze reopens the windows that were open when you quit.
    • With nothing to reopen, it shows a welcome window with recent folders.
    • A single file can open on its own, without a folder.
  • Theme. 18 presets, plus hue, strength, tint, grain, colour count, light/dark and blur (⌥⌘T).
Quick open Search across the folder
Quick open: fuzzy file names, ⌘P Search across every file in the folder, ⇧⌘F
The built-in terminal The theme panel
Terminal: your shell under the editor, ⌃` Theme: presets and live sliders, ⌥⌘T

Install

You need macOS, Rust (tested with 1.99) and Xcode. GPUI compiles Metal shaders at build time, and with Xcode 26 the Metal compiler is a separate download:

xcodebuild -downloadComponent MetalToolchain                     # once, if `xcrun metal` says it's missing
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer  # if xcode-select points at the Command Line Tools

Then build and install:

git clone https://github.com/TejasBaid/Raze-IDE.git raze && cd raze
scripts/install.sh            # builds Raze.app, installs it in /Applications and `raze` in ~/.local/bin
scripts/install.sh --bundle   # only builds target/Raze.app

The first build takes a few minutes because GPUI is large; later builds take seconds. The app is signed ad hoc, which is enough to run it on the Mac that built it.

Usage

raze                  # open the current folder
raze ~/code/project   # open a folder
raze notes.md         # open just a file
raze . src/main.rs    # open a folder with a file in it

You can also open folders and files from Finder: use Open With, drop them on the Dock icon, or drop them into a window. open -a Raze path works too. Without installing, use cargo run --release -- path.

When Raze opens a file on its own, the file goes to the window whose folder contains it. If no window holds it, the file opens in a window without a folder, where other loose files join it as tabs. Use File › Close Folder to return a window to the welcome screen.

The welcome window with recent folders

Keys

Keys Action
⌘O, ⇧⌘N open a folder or file, new window
⌘N, ⌘S, ⇧⌘S new file, save, save as
⌘W, ⇧⌘W close tab (closes the window when no tabs are left), close window
⌘P, ⌃G quick open, go to line (line or line:column)
⌃Tab / ⌃⇧Tab, ⇧⌘] / ⇧⌘[ next / previous tab
⌘F, ⌥⌘F find, find and replace (⏎ next, ⇧⏎ previous, ⌥⏎ select all matches)
⌘G / ⇧⌘G, ⇧⌘L, ⌥⌘C next / previous match, select all matches, case sensitivity
⇧⌘F search the whole folder
⌘D, ⌥⌘↑ / ⌥⌘↓, ⌥-click add the next occurrence, add a cursor above / below, add a cursor
⌘A, ⌘L, double / triple click select all, select line, select word / line
⌥← / ⌥→, ⌘← / ⌘→, ⌘↑ / ⌘↓ move by word, line (smart home), document; add ⇧ to select
⌥⌫, ⌘⌫, ⌥⌦ delete word left, to line start, word right
⌘/, ⌘] / ⌘[, ⇥ / ⇧⇥ toggle comment, indent / outdent
⌥↑ / ⌥↓, ⇧⌘D, ⇧⌘K move line up / down, duplicate line, delete line
⌘Z / ⇧⌘Z, ⌘X ⌘C ⌘V undo / redo, cut, copy, paste (the whole line when nothing is selected)
⌥Z, ⌘+ / ⌘− / ⌘0 soft wrap, zoom in / out / reset
⌘B, ⇧⌘E toggle the sidebar, focus the file tree (arrows move, ⏎ opens, F2 renames, ⌘⌫ trashes)
⌃` toggle the terminal (⌘K clears it)
⌥⌘T, ⌥⌘P, ⌥⌘B, ⌥⌘G theme panel, next preset, toggle blur, toggle grain
⌃⌘Space emoji and symbols

Every command is also in the menu bar.

Where Raze keeps things

Everything lives in ~/Library/Application Support/raze/: theme settings, recent folders, the last session and the zoom level. Performance logs go to ~/Library/Logs/raze/perf.log.

Development

cargo run --release -- .   # run from source
cargo test --release       # unit tests: editing model, documents and saving, wrap, highlighting, tree, fuzzy match, git
scripts/e2e.sh             # end-to-end tests, driving the real app against a throwaway folder
scripts/e2e.sh find        # only the cases whose names contain "find"

scripts/e2e.sh launches the release build once per check. Each run passes:

  • --keys: a script of keystrokes, text, clicks, drags, IME composition and menu actions.
  • --print-state: prints the tabs, text, selections, open panels, terminal output and windows.

The test then checks that output and the files on disk. Test windows never take keyboard focus. --screenshot out.png saves the window after the script runs, which is how the images above were made. Benchmarks are covered in docs/performance.md.

The app icon is drawn by packaging/make_icon.py (needs Pillow), which writes packaging/Raze.icns.

Layout

Path What's there
src/main.rs command line, app setup, menus, opening paths, session save, quit
src/workspace.rs a window: tabs, find bar, palette, status bar, prompts, welcome screen
src/editor.rs the editor view: rows, carets, mouse, IME, scrollbar, saving
src/buffer.rs the editing model: selections, undo, every editing command (no GPUI; unit tested)
src/document.rs, src/wrap.rs rope text with a per-line display cache, atomic saving, soft wrap
src/highlight.rs tree-sitter highlighting and language detection
src/sidebar.rs, src/file_tree.rs, src/git.rs the file tree, file operations, git status
src/project_search.rs, src/fuzzy.rs search across the folder, fuzzy matching for quick open
src/text_input.rs, src/prompt.rs single-line inputs, native prompts
src/terminal.rs, src/terminal_view.rs the terminal: PTY and parser, and its panel
src/theme.rs, src/chrome.rs, src/chrome/ colours and fonts, the translucent frame, tint, grain, the theme panel
src/session.rs recent folders, the last session, zoom
src/icons.rs, assets/icons/ line icons and file-type icons, embedded in the binary
src/script.rs, src/screenshot.rs the test driver and self-screenshots
src/perf.rs, src/bench.rs, src/bin/term-bench.rs performance harness and benchmarks
packaging/, scripts/ Info.plist, icon, install, benchmark and end-to-end scripts

Known limitations

  • macOS only. GPUI runs elsewhere, but the window chrome, prompts and packaging are Mac-specific.
  • Whole-file highlighting. Each edit re-highlights the whole file in the background, about 200 ms for 20k lines. Colours land a frame or so after the text.
  • Polled file tree. The tree is polled, not watched: open folders are checked every second and git status every few seconds. Files can't be moved by dragging within the tree.
  • Plain-text folder search. No regular expressions, and no replace across files.
  • Terminal glyphs. The terminal uses the editor's font. Prompts that rely on Nerd Font symbols show boxes unless you have such a font installed.

Licence

Raze is licensed under Apache-2.0. The file-type icons in assets/icons/filetypes come from Material Icon Theme (MIT; its licence is included alongside them).

The macOS dependency graph is MIT, Apache-2.0, BSD, Zlib, ISC, Unicode-3.0, CC0 or Unlicense, with one exception: option-ext (MPL-2.0, file-level copyleft, used unmodified via gpui's font stack). No GPL or LGPL code is built.

About

A rust based lightweight code editor that works faster than most alternatives

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages