+1
日增长
5,651
stars
149
forks
74
watchers
10
prs
48
issues
13
releases
README
vim.wasm: Vim Ported to WebAssembly
================================================================================
[![Build Status][travis-ci-badge]][travis-ci]
[![npm version][npm-badge]][npm-package]
This project is an experimental fork of [Vim editor][] by [@rhysd][] to compile
it into [WebAssembly][] using [emscripten][] and [binaryen][]. Vim runs on [Web Worker][]
and interacts with the main thread via [SharedArrayBuffer][shared-array-buffer].
The goal of this project is running Vim editor on browsers without losing Vim's powerful
functionalities by compiling Vim C sources into WebAssembly.
[Try it with your browser][try it]
- USAGE
- Almost all Vim's powerful features (syntax highlighting, Vim script, text objects,
...) including the latest features (popup window, ...) are supported.
- Drag&Drop files to browser tab opens them in Vim.
- :write only writes file on memory. Download current buffer by :export or
specific file by :export {file}.
- Clipboard register " is supported. For example, paste system clipboard text
to Vim with "p or :put , and copy text in Vim to system clipboard with
"y or :yank .
If you want to synchronize Vim's clipboard with system clipboard,
:set clipboard=unnamed should work like normal Vim.
- Files under ~/.vim directory is persistently stored in [Indexed DB][idb].
Please write your favorite configuration in ~/.vim/vimrc (NOT ~/.vimrc).
- file={filepath}={url} fetches a file from {url} to {filepath}. Arbitrary
remote files can be opened (care about CORS).
- Default colorscheme is [onedark.vim][onedark], but [vim-monokai][monokai] is
also available as high-contrast colorscheme.
- :!/path/to/file.js evaluates the JavaScript code in browser. :!% evaluates
current buffer.
- vimtutor is available by :e tutor.
- Add arg= query parameters (e.g. ?arg=~%2f.vim%2fvimrc&arg=hello.txt) to
add vim command line arguments.
- Please read the usage documentation for more details.
- NOTICE
- Please access from desktop Chrome, Firefox, Safari or Chromium based browsers
since this project uses SharedArrayBuffer and Atomics. On Firefox or Safari,
feature flags (javascript.options.shared_memory for Firefox) must be enabled
for now.
- vim.wasm takes key inputs from DOM keydown event. Please disable your browser
extensions which intercept key events (incognito mode would be the best).
- This project is very early phase of experiment. You may notice soon on
trying it... it's buggy :)
- If inputting something does not change anything, please try to click somewhere
in the page. Vim may have lost the focus.
- Vim exits on :quit, but it does not close a browser tab. Please close it
manually :)
This project is packaged as [vim-wasm npm pacakge][npm-package] to be used in
web application easily. Please read the documentation for
more details.
The current ported Vim version is 8.2.0055 with 'normal' and 'small' features setTop issues
#45SharedArrayBuffer restricted in new browser versions12 comments · 2021-09-17#51Clipboard read on visual select5 comments · 2023-01-23#44wasm-ld: error: unknown file type: vim.bc5 comments · 2021-06-22#40" '' should be object " appears when starting firefox5 comments · 2020-01-18#26Can not input chinese characters2 comments · 2019-05-01#55CVE-2022-21831 comments · 2025-01-10#53`.cmdline()` method not working1 comments · 2024-03-04#52Access to vim api and context from a containing app1 comments · 2024-02-23
Latest release
v0.0.13 wasm-0.0.13 2019-12-30- Improve: Upstream Vim version was updated to v8.2.55 - Improve: Wasm binary is built with the latest emscripten v1.39.5 - Improve: Update npm dependencies