0.1.2 • Published 10 years ago

vim.js v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Intro

Simple and lightweight Vim for web textarea and input field, to improve writing experience on web.

Demo here

Note:

  • This project is not to replace powerful IDEs on web pages, but rather as a web side writing(such as blogging, writing notes, ect.) of enhancements.

  • This project is in development, there will be some improvements and new features.

  • Please use the vim instructions in the English input method.

demo gif

中文文档

Usage

The vim.min.js only 19kb, and no any dependencies.

<script src="/path/to/vim.js"></script>
<script type="text/javascript">
    vim.open({
        debug   : true,
        showMsg : function(msg){
            alert('vim.js say:' + msg);
        }
    });
</script>

Building

//install
npm install vim.js

//watch
npm run dev

//build
npm run build

//build min js file
npm run build_min

Browser support

  • Chrome v39
  • Firefox v34, v40
  • Safari

Note: Whether to support other browsers still unknown

Features

1. general mode

CommandDescription
Escswitch to general mode
ureturned to the previous operation
Move the cursor :
h or ←move left one character
j or ↓move down one line
k or ↑move up one line
l or →move right one character
supported nh,nj,nk,nl
0 or HOMEmove to head of line
$ or Endmove to end of line
Ggo to end
gggo to first line
delete, copy and paste:
x or Deletedelete single character
nx or nDeletedelete n characters
yycopy current line
nyycopy n lines
dddelete current line
ndddelete n lines
p,Pp paste after,P paste before
w or Wmove to next word
supported nw and nW
ywcopy one word
nywcopy n words
dwdelete one word
ndwdelete n words

2. edit mode

CommandDescription
iinsert
aappend
oopen line below and enter edit mode
Oopen line after and enter edit mode
rreplace one character

3. visual mode

CommandDescription
v or Vswitch ot visual mode
ycopy the selected text
x or ddelete the selected text
0.1.2

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.1.4

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago