Skip to content

Drew's Behave Next theme for Zed with enhanced TS grammar

Notifications You must be signed in to change notification settings

arittr/zed-behave-theme-next

Repository files navigation

Drew's Behave Highlights for Zed

Enhanced TypeScript/TSX syntax highlighting for Zed editor to match the token granularity of the Behave TextMate theme.

Features

This extension provides more granular syntax highlighting for TypeScript and TSX files, adding distinctions for:

TypeScript Enhancements

  • Properties: Differentiate between member properties, object keys, and shorthand properties
  • Functions: Distinguish arrow functions, generators, method signatures, and decorators
  • Types: Enhanced highlighting for type parameters, aliases, interfaces, and enums
  • Parameters: Separate highlighting for optional, rest, and destructured parameters
  • Imports: Granular highlighting for named, default, and namespace imports
  • Operators: Special highlighting for optional chaining, nullish coalescing, and type assertions

TSX/JSX Enhancements

  • Components vs HTML: Different colors for React components (PascalCase) vs HTML elements
  • Attributes: Special highlighting for className, event handlers, data/aria attributes
  • JSX Expressions: Enhanced highlighting for expressions within JSX
  • React Patterns: Recognition of hooks (useXxx), props interfaces, and common patterns

Installation

  1. Clone this repository with submodules:
git clone --recursive https://github.com/yourusername/zed-behave-theme-next.git
  1. Build the extension:
cd zed-behave-theme-next
./build.sh
  1. Install in Zed:
# Copy to Zed extensions directory
cp -r . ~/.config/zed/extensions/zed-behave-theme-next

Development

Structure

  • upstream-zed/ - Git submodule tracking Zed's language files (sparse checkout)
  • languages/ - Built language definitions with custom highlights applied
  • custom-highlights/ - Custom Tree-sitter queries extending base highlighting
  • build.sh - Script to merge upstream and custom highlights

Updating from Upstream

To update the base language files from Zed:

cd upstream-zed
git pull origin main
cd ..
./build.sh

Customizing

Edit files in custom-highlights/ to add or modify highlighting rules. The build script appends these to the base Zed highlights.

Color Mapping

Based on the Behave theme colors:

  • Variables/Identifiers: #5AB8E5
  • Functions: #61D29D
  • Classes/Types: #f0d879
  • Strings: #ec9076
  • Numbers/Constants: #c9a9f9
  • Keywords/Operators: #7dcbc4
  • Comments: #808691

License

MIT

About

Drew's Behave Next theme for Zed with enhanced TS grammar

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors