Status: In Progress
A terminal-based text editor built in C++ using the ncurses library, inspired by Vim. Designed to be lightweight, modular, and efficient—with tiling windows, multiple buffers, and Vim-like modal editing.
git clone https://github.com/aarya-bhatia/ncurses-editor.git
cd ncurses-editor
makebin/main [<filename1> [<filename2>...]]bin/testProgram will create and append logs to the file stderr.log in the project directory. View logs in another terminal with tail -f stderr.log.
- Tiling window management using a binary tree layout
- Tab and buffer management for multiple open files
- Vim-style modal editing: Insert, Normal, and Command modes
- Lazy redraw: only update modified parts of the screen
- Graceful terminal resizing
- Plugin-like file event handlers (e.g.,
:Exto explore files) - Chord-style keybindings for navigation and actions
- Modular and extensible architecture
| Key | Action |
|---|---|
<Esc> |
Exit insert mode |
| Command | Description |
|---|---|
:q[uit] |
Exit program |
<Esc> |
Exit command mode |
<Enter> |
Execute command |
:<line> |
Jump to specified line |
:sp, :vs |
create horizontal/vertical split |
:right, :left, :top, :bottom |
navigate to window pane |
:tabnext / :tabprev |
Switch to next or previous tab |
:edit <filename> / :open <filename> |
Open a file if it exists |
:close |
Close current window |
:tabclose |
Close current tab |
:save |
Save current file to disk. |
:tabnew |
Open and switch to new tab. |
:copy |
Copy current line |
:Ex |
Open file explorer in buffer |
| Key | Action |
|---|---|
h |
Move left |
j |
Move down |
k |
Move up |
l |
Move right |
0 |
Jump to start of line |
$ |
Jump to end of line |
i |
Enter insert mode |
: |
Enter command mode |
G |
Go to end of file |
gg |
Go to start of file |
yy |
Copy the current line |
p |
Paste copied line below |
x |
Erase character at cursor |
o |
Insert line below cursor |
dd |
Delete current line |
<space>w + hjkl |
Navigate to window split in left/down/top/right direction. |
<space>wc |
Close window |
<space>t + pn |
Navigate to previous/next tab |
<space>te |
Open new tab |
<space>tc |
Close tab |
- Auto-scroll when cursor jumps off-screen
- Efficient line redraw after inserts/deletes
- Handle empty buffer states
- Read filenames from command-line arguments
- Open and edit multiple files
- Use buffer IDs instead of filenames
- Line number display
- Run external shell commands on current line
- Visual mode
- Popup UI for long messages
- Command history
- Color support

