The smallest vim you can scp anywhere — and the $EDITOR that can't lose your commit message.
A modal terminal text editor in a single ~920 KB static binary. No config file, no plugin system, no runtime: ~2,500 lines of dependency-light Rust you can read in one sitting.
It exists for two moments:
- You're inside something with no editor. A trimmed container, a rescue shell, a
box where
nano/vimaren't installed and the package manager is broken. Copy one static file in —docker cp,scp, or a singlecurl— and you get real vim keys instead of BusyBoxvi's stripped-down behavior. - A tool opened an editor for you.
git commit,crontab -e,kubectl edit,systemctl edit,sudoedit. as-vim shows:w/:q!hints on screen, refuses to quit with unsaved changes (:q!to override), and marks the buffer[+]the moment it differs from disk — you can't lose your commit message by accident.
curl -LO https://github.com/ashusevim/as-vim/releases/latest/download/as-vim-x86_64-unknown-linux-musl.tar.gz
tar xzf as-vim-x86_64-unknown-linux-musl.tar.gz
./as-vim-*/as-vim notes.txtAarch64 Linux, macOS (Intel/Apple Silicon), and Windows binaries are on the releases page.
| as-vim | nano | BusyBox vi |
vim/Helix | |
|---|---|---|---|---|
| vim keys | ✔ (subset) | ✘ | ✔ (hostile) | ✔ |
| static binary, zero deps | ~920 KB | needs ncurses | in BusyBox | multi-MB |
| won't quit on unsaved changes | ✔ always | ✘ | ✘ | ✔ with config |
| undo/redo, search, syntax highlighting | ✔ | ✔ | ✘ | ✔ |
| system clipboard over SSH (OSC 52) | ✔ built in | partial | ✘ | ✔ |
| config to maintain | none | .nanorc |
none | .vimrc/toml |
| readable source, one sitting | ~2,500 lines | large | — | very large |
If you want LSP, splits, or a file tree, use Helix or Neovim — as-vim deliberately stays out of that race.
- Modal editing — NORMAL / INSERT / COMMAND, vim-style
- Undo/redo —
u/Ctrl+r, vim-style change grouping (dd,o+typing, word-runs each undo as one step) - Search —
/with incremental prompt,n/Nto repeat, wrap-around, match highlighting, smart-case - Substitute —
:s/old/new/,:s/../../g,:%s/old/new/g; escapes, last-search reuse, one undo step per command - Yank/paste + system clipboard —
yy,p/P,x/ddfill the unnamed register; yanks sync to the system clipboard via OSC 52 (works over SSH) - Syntax highlighting — Rust, C/C++, JavaScript/TypeScript, Python, Go, Java, Shell, JSON, TOML; zero dependencies, block comments track across lines
- Motions —
h j k l, arrow keys,0,$,gg,G,PageUp/PageDown, count prefixes (5j,3dd,2yy,12G) - Editing —
iaAoO,x,dd, full multi-byte (emoji, CJK) safety - Visual mode —
v+ motions,d/xdelete,yyank (OSC 52),oswap ends; selections span lines - Ex commands —
:w,:w <file>,:q,:q!,:wq,:x,:undo,:redo - Safe defaults —
:qrefuses to discard unsaved changes; dirty indicator[+]in the status bar - Scrolling — files bigger than the viewport scroll vertically and horizontally
- Resize-aware — reflows when you resize the terminal
- Unicode correct — wide characters and tabs render and cursor-track properly
cargo install as-vimGrab a static binary for Linux (x86_64/aarch64), macOS (Intel/Apple Silicon), or Windows from the releases page:
# example: Linux x86_64
curl -LO https://github.com/ashusevim/as-vim/releases/latest/download/as-vim-x86_64-unknown-linux-musl.tar.gz
tar xzf as-vim-x86_64-unknown-linux-musl.tar.gz
sudo mv as-vim-*/as-vim /usr/local/bin/git clone https://github.com/ashusevim/as-vim
cd as-vim
cargo install --path .as-vim notes.txt # open (or create on save)
as-vim # empty unnamed buffer, use :w <file> to save
# as the safe default editor
export EDITOR=as-vim # git, crontab, kubectl, systemctl, sudoedit| Key | Action |
|---|---|
h j k l / arrows |
move cursor |
0 / $ |
line start / line end |
gg / G |
buffer start / buffer end |
Enter |
next line, first column |
i / a / A |
insert before / after cursor / at line end |
o / O |
open line below / above |
x, Delete |
delete char under cursor (count: 4x) |
dd |
delete line(s) (count: 3dd) |
yy |
yank line(s) (count: 2yy, also → system clipboard via OSC 52) |
p / P |
paste register after / before cursor (count: 3p) |
u / Ctrl+r |
undo / redo |
v |
visual mode: motions select, d/x delete, y yank, o swap ends |
/ |
search (then Enter, n, N) |
: |
enter COMMAND mode |
Ctrl+C |
hint (nothing is force-killed) |
| Key | Action |
|---|---|
| printable chars | insert at cursor |
Enter |
split line at cursor |
Backspace |
delete before cursor / join previous line |
Delete |
delete at cursor / join next line |
Esc |
back to NORMAL |
| Command | Action |
|---|---|
:w [file] |
save (optionally to a new file) |
:q |
quit (warns if unsaved changes) |
:q! |
quit discarding changes |
:wq / :x |
save and quit |
:undo / :redo |
undo / redo |
:s/old/new/ |
replace first match on the current line |
:s/old/new/g |
replace every match on the current line |
:%s/old/new/g |
replace across the whole buffer |
Esc |
cancel command |
- State is minimal and explicit; rendering is a pure function of that state
- Editor logic is terminal-agnostic and unit-tested (no pty needed for the test suite)
- Small surface area — read
src/editor.rsand you have read the editor
cargo test # 85 tests, no terminal required
cargo clippy # lint
cargo build --release- Undo/redo (
u,Ctrl+r) - Search (
/,n,N) with highlighting - System clipboard over SSH (OSC 52)
- Syntax highlighting (9 file families)
-
:ssubstitute / search with replacement - Count-prefixed motions (
5j,3dd) - Visual mode (
v+d/y) - Linewise visual mode (
V) -
w/b/eword motions with counts
MIT — see LICENSE.