Git Product home page Git Product logo

jim's Introduction

Jim is a JavaScript library that adds a Vim mode to the excellent in-browser editor Ace. Github uses Ace for its editor, so you can use the Jim bookmarklet to Jimmy rig it with Vim-ness.

Try it out

misfo.github.com/jim

Embed Jim with Ace in your app

<script src="ace.js" type="text/javascript"></script>
<script src="jim-ace.min.js" type="text/javascript"></script>

<script type="text/javascript">
  $(document).ready(function() {
    var editor = ace.edit('editor');
    // configure Ace
    Jim.aceInit(editor);
  });
</script>

Annotated source

What works so far

  • modes: normal, visual (characterwise and linewise), insert, replace
  • operators: c, d, y, >, and < in normal and visual modes (double operators work as linewise commands in normal mode, too)
  • motions (can be used with counts and/or operators, and in visual mode)
    • h, j, k, l
    • W, E, B, w, e, b
    • 0, ^, $
    • G, gg
    • H, M, L
    • /, ?, n, N, *, #
    • f, F, t, T
  • other commands
    • insert switches: i, a, o, O, I, A, and C
    • commands: D, gJ, J, p, P, r, s, x, X, u, and .
    • visual mode commands: gJ, J, p and P
  • default register (operations yank text in the register for pasting)
  • u works as it does in Vim (Cmd-z and Cmd-y still work as they do in Ace)

If you have a feature request create an issue

Known issues

Take a gander at the issue tracker

Hack

git clone git://github.com/misfo/jim.git
cd jim
git submodule update --init

Then just open index.html and you're good to go.

Chrome needs a special command line argument to allow XHRs to files: google-chrome --allow-file-access-from-files

To keep the development js file built while you develop, you'll need CoffeeScript:

npm install coffee-script

Then build your files in the background:

cake build:ace:watch

Open test/test.html to run the tests

Thanks!

Thanks to all contributors. In other words: thanks sourrust.

jim's People

Contributors

misfo avatar sourrust avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.