Code Monkey home page Code Monkey logo

homerows.nvim's Introduction

drawing

homerows.nvim

I don't care what keyboard layout I'm using, I just want my keybinding on my homerows...

problem

I don't know if you've noticed but qwerty is f***ing everywhere. I think it sucks so I opt for a alternate layout when I can.

I put most of my keybindings on my homerows for convenience but when I switch between my laptop and my sick lightup colemak-dh keyboard, things gets messed up.

If only there was a way to easily switch between keyboard layouts and keep my homerow keybindings.

Then I thought, "I don't make the rules but I do make shitty nvim plugins."

homerows

Homerows allows you to map your keybindings to the position of the key and not the letter making it impeccably easy to maintain your keybinding positions across various keyboard layouts.

The key positions follow the diagrams below, with the naming convention:
HAND - FINGER - VERTICALITY

staggered layout

columnar layout

The middle row drops the VERTICALITY indicator for brevity's sake as it is default.

To capitalise the letter, making the HAND portion capital.

name hand finger vert qwerty colemak
l0 left first middle g g
r3t right third top o y
L1b left first bottom V D
local hr = require("homerows.homerows")

vim.keymap.set(
  'n', 
  '<leader>' .. hr.l3 .. hr.R1b,
  function() do_stuff() end,
  { desc = "does things" }
)

install

Use a package manager of your choice; examples using common one below. Requires plenary.nvim.

use {
  "kbario/homerows.nvim",
  requires = {"nvim-lua/plenary.nvim"} -- if you don't have it already
}
Plug "nvim-lua/plenary.nvim" " if you don't have it already
Plug "kbario/homerows.nvim"

settings

global settings of homerows that are set on setup:

settings = {
  -- used to give preference to ripples. see ripples below.
  pref = { "programmers_dvorak", "colemak_dh" }
  -- whether or not to add the keybinding for changing the current homerows layout
  add_change_keymap = true,
  -- whether or not to add the keybinding for printing the current homerows layout
  add_print_keymap = true
  -- where you add layouts that don't come standard with homerows.
  custom_layouts = {
    your_layout = {
      r1 = "a",
      r2 = "b",
      ...
    }
  }
}

preconfigured layouts

Current layouts that come with homerows include

  • qwerty
  • dvorak
  • programmers dvorak
  • colemak
  • colemak-dh

Add your own in the custom layouts attribute of the global settings object. Find a premade custom_layouts object below to copy and paste into your config to save time.

If you think there's a layout that should come standard with homerows, make a PR.

commands

:HomerowsTo

This command changes the keyboard layout that homerows is using to determine the what keys are in what positions. Either type the layout you're using (i.e. qwerty, colemak, etc.) or you can use a ripple (i.e. asdf, arst, etc.).

Enable or disable the default keybinding for this command - "<leader>hrt" - with

add_change_keymap = true/false

in the setup of homerows. Or use another keybinding by supplying the mapping as the value (i.e.

add_change_keymap = '<leader> .. hr.l1t .. hr.l2t'

:HomerowsAre

forgot what keyboard layout you're using? "<leader>hra" prints this in the bottom bar, or change it in the setup.

ripples

at present, this does not reload your neovim so you will need to restart for the changes to take effect. If you know how to do this, please make a pull request to change it.

custom_layouts object

homerows.nvim's People

Contributors

kbario avatar

Stargazers

Ryo Hirayama avatar  avatar Yuta Katayama avatar  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.