Giter Site home page Giter Site logo

omega-keys's Introduction

Ω Keys

Omega Keys is a global minor mode for Emacs that provides modal editing using customized keys.

It is similar to Evil, but instead of using Vim keys, it uses i, j, k and l keys for moving around. In my opinion this is more natural for someone not used to Vim because the physical layout of the keys is similar to normal arrow keys.

Installation

For now just download the omega-keys.el file and put it somewhere on your computer. I will try to get this on MELPA later for easy installation.

Configuration

I recommend the keybinding M-j for enabling Omega Keys. Minimal configuration with use-package could look something like this:

(use-package omega-keys
  :demand t
  :load-path "~/.emacs.d/myPackages/omega-keys"
  :after ido
  :bind (("M-j" . omega-keys-enable))
  :config
  (global-omega-keys-mode t))

Obviously change the :load-path to reflect the directory where you put the omega-keys.el file. If you use Ido make sure it is loaded first (the :after ido part) because then Omega Keys knows to use Ido-versions of some functions. The (global-omega-keys-mode t) at the end enables Omega Keys by default in new buffers.

Personally I also like to use M-q for aborting an ongoing action instead of the Emacs default C-g because I think it is much more convenient keybinding for my fingers. With that in mind, the :bind section could look something like this:

(("M-j" . omega-keys-enable)
 ("M-q" . keyboard-quit)
 :map minibuffer-local-map
 ("M-q" . abort-recursive-edit)
 :map query-replace-map
 ("M-q" . quit))

In practice you should probably define much more personalized keybindings depending on which packages you are using to enhance the default Emacs features. For example, I am using Swiper for searching instead of isearch and so on.

There is also a separate keymap omega-keys-custom-map for defining keys for your own custom functions. It is activated from c when Omega Keys is enabled.

Cursor

Omega Keys can change the cursor type depending on whether the mode is enabled or disabled. This makes it more easy to know which mode you are in. The customizable variable omega-keys-cursor-type defines the cursor to use when the mode is enabled. Setting it to nil disables the changing of cursors. See the built-in cursor-type for possible values to use. It defaults to t.

I set my default cursor to narrow bar in my init file that is used when Omega Keys is not active:

(setq-default cursor-type '(bar . 2))

Usage

Changing modes:

  • Use f to disable Omega Keys ("activate edit mode")
  • Use M-j to enable Omega Keys ("activate command mode")

Omega Keys consists of three "layers" of keys:

  1. Simple keys without modifiers from a to z.
  2. Meta keys from M-a to M-z. They are generally "stronger" versions of the simple keys. For example l moves forward by one character while M-l moves forward by one word. Omega Keys only binds about half of the Meta keys from a-z, so the other half will be bound to Emacs defaults.
  3. Extended keys defined in omega-keys-extended-map and activated by pressing the x key. Extended keys are used to save file (xs), open file (xf) or exit emacs (xq) for example.

I do not want to list the complete keymaps here in the README file because the code is very short and readable, so duplicating everything in the README would be redundant. Please see the code instead for all the keys.

Etymology

Omega is the final character of the Greek alphabet. The name implies that Omega Keys is the final key configuration you need to learn in order to be really efficient and productive with a text editor.

omega-keys's People

Contributors

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