Multi-Cursor Editing
Glass supports sophisticated multi-cursor editing, allowing you to edit multiple locations simultaneously.Select Next Occurrence
Use
SelectNext to find and select the next occurrence of your current selection. This is perfect for quickly renaming variables or making bulk edits.Select Previous Occurrence
Use
SelectPrevious to select the previous occurrence, giving you bidirectional control over your selections.Line Operations
Glass offers precise control over line-level text manipulation.Moving Within Lines
- Beginning of Line
- End of Line
The
MoveToBeginningOfLine action supports smart navigation:- stop_at_soft_wraps: Respects soft-wrapped lines
- stop_at_indent: First stop at indentation, then at the actual beginning
Selecting and Deleting
Glass provides corresponding selection and deletion operations:SelectToBeginningOfLine/SelectToEndOfLine- Extend selectionsDeleteToBeginningOfLine/DeleteToEndOfLine- Remove text efficientlyCutToEndOfLine- Cut text from cursor to end of line
All line operations respect the editor’s soft wrap settings, ensuring natural editing behavior even with long lines.
Word and Subword Navigation
Glass distinguishes between words and subwords, supporting both programming conventions like camelCase and snake_case.Word Operations
DeleteToNextWordEnd/DeleteToPreviousWordStartDeleteToNextSubwordEnd/DeleteToPreviousSubwordStart
Code Manipulation
Comments
Toggle comments with fine-grained control:- advance_downwards: Move cursor down after toggling
- ignore_indent: Don’t adjust comment position based on indentation
Code Folding
Collapse code blocks to focus on what matters:FoldAtLevel(u32)- Fold all blocks at a specific indentation level- Useful for getting a high-level view of large files
Page Navigation
Move through your code efficiently:center_cursor is true, the cursor is centered vertically after the page movement, maintaining visual context.
Movement System
Glass’s movement module provides sophisticated navigation that accounts for:- Soft wraps: Navigate naturally through wrapped lines
- Variable-width characters: Proper handling of Unicode and special characters
- Display vs. buffer coordinates: Consistent behavior with folds and inlays
Advanced Text Selection
Extending Selections by Lines
Precisely control your selection scope:Excerpt Expansion
When working with excerpted views (like search results), expand context as needed:ExpandExcerpts- Expand all excerptsExpandExcerptsUp- Expand above current positionExpandExcerptsDown- Expand below current position
Code Context
The editor maintains rich context about your code:- Syntax-aware movement: Understands brackets, words, and language structure
- Bracket matching: Automatic highlighting of matching brackets
- Indent guides: Visual feedback for code structure
- Inlay hints: Inline type hints and parameter names from LSP
The editor’s display map system (crates/editor/src/display_map.rs) manages the transformation between buffer content and what you see on screen, handling folds, wraps, inlays, and more.
Best Practices
- Use multi-cursor editing for repetitive changes instead of find-and-replace
- Leverage subword navigation when working with camelCase or snake_case
- Combine selections with actions - many operations work on all active selections
- Fold code strategically to maintain context while focusing on specific areas
- Use soft wraps for better visibility of long lines without manual line breaks
Related Features
- Navigation - Go to definition, find references, and symbol navigation
- Git Integration - View diffs and blame information inline
- Testing - Run tasks and tests from your editor