Giter VIP home page Giter VIP logo

vimedu's Introduction

vimedu's People

Contributors

blukat29 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

vimedu's Issues

Improve KeysViewer

Its primary goal is to act as an alive cheatsheet. It has to be compact and yet accurate.

Some jobs to decrease its (vertical) size:

  • Group related keys (e.g. hjkl, ()) into a line. done.
  • Make use of keysDisp property of commandList elements. done.

Some jobs to handle its interactiveness in more elegant way:

  • Use assign classes to each elements. done.
  • Don't show or hide the whole group. Just hide it when all its children are hidden. partially done.

Some jobs to help newbies:

  • Add "new" keyword depend on quest progress.
  • Add ex commands to key list.

Features to implement

  • Treat Esc key as special command. (e42d45c)
  • Build FSM for visual mode, as it accepts motion first and then operation. (85e7d3a)
  • Display key helps horizontally. (cba2e0d)
  • Add tips that introduces some core commands. (started writing.)
  • Adjust sizes of left-middle-right panes. (120e4e3)
  • Show text buffer. (22403dc)
  • Better error handling for wrong input or command abort. (b18adda)
  • Implement FSM for repeat count. (226c5cb)
  • Consider partial keys to lookahead display. (e3cd211)

Redefine problem of context aware key help

Continue from #1.

The problem we want to solve is to defining a function such that

  • Given
    • A keypress
    • History of keypresses (hope this is omitted)
    • Current State (using custom FSM)
    • Current vim mode (could be included in FSM)
  • Returns
    • LIst of legal keypresses.

Showing text buffer

a.k.a. clipboard, or registers.

Vim has many registers. Most of them are named like a and b. And there is an unnamed buffer (actually named as "). This unnamed buffer is updated every time I execute the change, copy, or delete command.

Since this project is for beginners, just displaying the unnamed buffer will be enough.
Major reason for showing register is to demonstrate that delete operation is actually cut operation.

In keymap/vim.js, is a private class Register. It has methods like setText(), toString() and so on.
I can hook up a CodeMirror signal and pass its content thorugh signal argument.

Use CSS classes in CodeMirror

Some elements in CodeMirror (and the ones defined in vim keymap) are styled as element styles. I want them to be styled through CSS classes. The list of missing parts is:

  • CodeMirror-linenumbers: font color
  • CodeMirror-dialog: font color, font color on error
  • Selected text should refer to CodeMirror-selected and CodeMirror-focused.CodeMirror-selected.

[Bug] 'c' operator moves to normal mode.

Two cases are involved.

  1. In normal mode, press "cc". This is "change this line" command. So Vim should result in insert mode. CodeMirror seems to work correctly, but the FSM does not.
  2. In visual mode, press "c". This terminates the visual mode and allow changing that part. So again, Vim should end up in insert mode. Both CodeMirror and the FSM arrives in Normal mode.

Curriculum

  • Go to next level via closing this file. A shell-like frame replaces vim area and let user choose a level, or next level, redo this level with simple command.
  • Each level is a file. All the descriptions are inside vim. There should be an area to test this behaviour. i.e. practice targets.
  • Number of levels should be around 10. Too many will exhaust the learner.

[codemirror] buildKeyMap

Requirements:

  1. Use live keys sets (do not use defaultKeyMap[]. overrides from API calls should be considered)
  2. One function to build (Mode, Key) -> (command name or command type)
  3. Another function to build (command type [, keybuf]) -> (command candidates)

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.