Coder Social home page Coder Social logo

cherim's Introduction

Cherim

Sakura Editor wrap Vim (like) KeyBind

About

サクラエディタの操作系をVimで乗っ取るプラグイン

Usage

  1. zipファイルをプラグインとして導入
  2. キー割当から、esc, h, j, k, l, yのみ、それぞれプラグインのkey_esc, key_h, (以下略)に差し替える
    • 選択機能を使うためには、キー自体を上書きする必要があるため、通常の入力で取得できないEscと合わせて、登録している
  3. タイプ別設定→インデント→スマートインデント→cherimを設定

How it Works

  • スマートインデントは、キー入力のがあるたびに毎回スクリプトが走る設計であることを利用している
  • キー入力をスマートインデント用のイベントからもらって、内部で入力キーごとに分岐処理を行なっている
  • 実際にはキーボードからの入力文字はエディタ上に書き込まれているが、挿入モード以外では即座にUndoすることで見かけ上再現している
    • そのため、超高速で入力されると、間に合わなくて文字が見えることがある
  • モード情報とコマンドのバッファは、サクラエディタのCookie機能を使って記憶させている

Tips Note

  • 実装の都合上Ctrl+vの矩形選択が、Shift+vの割り当てられている
    • Ctrlを使うためには、キー割当をする必要がある
    • なるべくキー割当を行わない設計にしている(単純に手間なので…)

ToDo

  • 数字指定のコマンドの実装
  • リファクタ(結構イマイチコードが多め)

cherim's People

Contributors

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