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.
- 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)
- 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
- Linux: 100%
- MacOS: Not Planned
- Windows: Not Planned
Download latest phantom executable from releases
Place executable in /usr/bin (or in any folder in your path)
-
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/release
directory.
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
- Linux:
~/.config/phantom
Ctrl+Q
: Quit the editor?
: Show keybinding help
i
orInsert
: 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 mode/
: 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)
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
Esc
: Return to Normal modey
: Copy selected text to system clipboard- Arrow keys: Extend selection
: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
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
- 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
- Live Search: Results update as you type
- Case Sensitivity: Toggle with
Alt+I
in search mode - Regex Support: Toggle with
Alt+R
in search mode - Multiple Matches: Finds all occurrences in the file
- Use
n
andN
to navigate between search results
- Groups consecutive character insertions/deletions into logical operations
- Time-based grouping (operations within 1 second)
- More intuitive undo behavior for better editing flow
- 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
- 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
- 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
phantom includes a debug output area that displays information about key presses, cursor position, and the results of operations like saving files.