- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| src | ||
| .gitignore | ||
| cargo.list | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
phantom
phantom is a lightweight, terminal-based linux text editor written in Rust. It combines the simplicity of a basic text editor with some powerful features inspired by Vim.
Features
- Simple and intuitive interface
- Vim-like modal editing (Normal, Insert, Visual, and Command modes)
- Syntax highlighting
- System clipboard integration
- Customizable (Currently Keybindings and Colors)
- Directory Navigation (Sidebar)
- CLI Coding Agents (Sidebar)
- Debug Output Menu
- Search in file
- Undo and Redo
- Tabs
- Minimap
- Git status
- Smart auto-indentation
- Enhanced search with regex and case-insensitive options
- Intelligent undo/redo with operation grouping
- Swappable Themes
Cross-Plaform Status
- Linux: 100%
- MacOS: Not Planned
- Windows: Not Planned
Installation
Arch User Repository
Binary
Git
Binary Release
Download latest phantom executable from releases
Place executable in /usr/bin (or in any folder in your path)
Build From Source
-
Ensure you have Rust and Cargo installed on your system. If not, install them from https://www.rust-lang.org/.
-
Clone this repository:
git clone https://github.com/0xGingi/phantom.git -
Navigate to the project directory:
cd phantom -
Build the project:
cargo build --release -
The executable will be created in the
target/releasedirectory.
Usage
To start phantom:
phantom
phantom file.txt
phantom ~/Project
If a filename is provided, phantom will attempt to open that file. Otherwise, it will start with a blank document. If a directory is provided, phantom will enter directory navigation mode
Default Keybinds and Commands
Config file locations
- Linux:
~/.config/phantom
Global
Ctrl+Q: Quit the editor?: Show keybinding help
Normal Mode
iorInsert: Enter Insert modea: Enter Insert mode after the cursoro: Insert a new line below and enter Insert modeO: Insert a new line above and enter Insert modedd: Delete the current lineyy: Yank (copy) the current linep: Paste after the current lineCtrl+Y: Copy the current line to system clipboardCtrl+P: Paste from system clipboard below the current linev: Enter Visual mode- Arrow keys: Move the cursor
Home: Move to the start of the lineEnd: Move to the end of the lineDelete: Delete the character under the cursor:: Enter Command modeCtrl+B: Toggle debug menu visibilityCtrl+E: Enter directory navigation modeCtrl+G: Open agents sidebar/: Enter Search moden: Go to next search resultN: Go to previous search resultPageUp: Scroll up one pagePageDown: Scroll down one pageCtrl+U: UndoCtrl+R: RedoCtrl+T: New TabCtrl+W: Close TabF1-F9: Switch to Tab 1-9Tab: Swap Between TabsCtrl+M: Toggle MinimapCtrl+L: Toggle line number mode (Off/Absolute/Relative/Hybrid)Ctrl+I: Toggle auto-indentationCtrl+J: Toggle word wrapShift+T: Cycle through color themes?: Show keybinding helpMouse Click: Move cursor to clicked positionMouse Wheel: Scroll up/down (3 lines)Shift+Mouse Wheel: Scroll left/right (5 columns)
Insert Mode
Esc: Return to Normal modeEnter: Insert a new line with smart auto-indentationBackspace: Delete the character before the cursor- Any character key: Insert the character at the cursor position
Visual Mode
Esc: Return to Normal modey: Copy selected text to system clipboard- Arrow keys: Extend selection
Command Mode
:w: Save the current file:w filename: Save the current file as 'filename':q: Quit the editor:wq: Save and quit:e filename: Open 'filename' for editing:agents: Toggle agents sidebar:agent <command>: Launch a custom agent command in the sidebar
Search Mode
Enter: Perform search and return to Normal modeEsc: Cancel search and return to Normal modeAlt+I: Toggle case-sensitive searchAlt+R: Toggle regex search mode- Any character: Live search as you type
Enhanced Features
Smart Auto-Indentation
- Automatically indents new lines based on the previous line
- Recognizes common programming constructs (if, for, while, brackets)
- Supports both tabs and spaces with configurable indent size
- Toggle with
Ctrl+I
Advanced Search
- Live Search: Results update as you type
- Case Sensitivity: Toggle with
Alt+Iin search mode - Regex Support: Toggle with
Alt+Rin search mode - Multiple Matches: Finds all occurrences in the file
- Use
nandNto navigate between search results
Intelligent Undo/Redo
- Groups consecutive character insertions/deletions into logical operations
- Time-based grouping (operations within 1 second)
- More intuitive undo behavior for better editing flow
Mouse Support
- Click to Position: Click anywhere in the editor to move cursor
- Vertical Scrolling: Mouse wheel scrolls up/down
- Horizontal Scrolling: Shift+mouse wheel scrolls left/right
- Text Selection: Drag to select text, right-click to copy
Line Numbers
- Absolute: Shows actual line numbers (1, 2, 3...)
- Relative: Shows distance from current line
- Hybrid: Shows current line number + relative distances
- Toggle modes with
Ctrl+L
Color Themes
- One Dark (default): Modern dark theme inspired by Atom/VS Code
- Dracula: Popular purple and pink accent theme
- Solarized Dark: Scientifically designed color scheme, easy on eyes
- Nord: Arctic-inspired cool blue theme
- Monokai: Classic warm colors, popular in Sublime Text
- Gruvbox: Retro groove colors with warm, earthy tones
- Cycle through themes with
Shift+T
Debug Output
phantom includes a debug output area that displays information about key presses, cursor position, and the results of operations like saving files.