Giter Club home page Giter Club logo

vim.js's Introduction

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

Command Description
Esc switch to general mode
u returned 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 [HOME] move to head of line
$ or [End] move to end of line
G go to end
gg go to first line
delete, copy and paste:
x or [Delete] delete single character
nx or n[Delete] delete n characters
yy copy current line
nyy copy n lines
dd delete current line
ndd delete n lines
p,P p paste after,P paste before
w or W move to next word
supported nw and nW
yw copy one word
nyw copy n words
dw delete one word
ndw delete n words

2. edit mode

Command Description
i insert
I insert line head
a append
A append line tail
o open line below and enter edit mode
O open line after and enter edit mode
r replace one character

3. visual mode

Command Description
v or V switch ot visual mode
y copy the selected text
x or d delete the selected text

vim.js's People

Contributors

toplan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.