Coder Social home page Coder Social logo

docs-vim's Introduction

docs-vim

Cloning Instructions

This repository uses git submodule, after cloning it you should run git submodule init and git submodule update.

Overview

This simulates very limited versions of vim's insert and normal modes on Google Docs.

Currently supported features:

  • Insert mode:
    • Typing
    • Escaping to normal with Esc
    • Escaping to normal with a two-key combination
  • Normal mode
    • Getting to insert mode with the "i" key
    • Moving with the home-row keys
    • Repeated motions using the number keys
  • Chrome (tested on 63.0)
  • (Not really) Firefox
    • It will install, but many of the features work incorrectly.

How?

Glad you asked - this project is built with the docs-plus library, which enables rich interactions with the Google Docs editor. Improvements made to the library here (particularly those in the docs-plus-plus.js file) will probably eventually be pushed back up to the main docs-plus library.

Keys

Currently set up to work with my DVORAK layout, these are the default keybindings:

  • Insert Mode:
    • Esc: enter normal mode
    • hn: enter normal mode
  • Normal Mode:
    • i: enter insert mode
    • dhtn: move

Note that most of these can be changed in docs-vim.js. For example, if you want to use the more common QWERTY keybindings, you'd change to:

vim = {
    "mode": "insert",
    "keys": {
        "move": "hjkl",
        "escapeSeq": "jk",
    }
};

Near the top of docs-vim.js.

Future Features

I don't really use all that much of vim's shortcuts, but a few particular things I want to add eventually:

  • Selections with v/shift-V (visual/visual line mode)
  • Command mode with find and replace, go to line #, etc.
  • Quick find with /

docs-vim's People

Contributors

lovetocode999 avatar

Watchers

 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.