Skip to content

Commit

Permalink
docs: update README (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: tris203 <admin@snappeh.com>
  • Loading branch information
tris203 and tris203 authored Dec 22, 2023
1 parent eccd881 commit 4b11f0f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 53 deletions.
95 changes: 59 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
# hawtkeys.nvim
# ⌨️🔥 hawtkeys.nvim

## What is this?
hawtkeys.nvim is a nvim plugin for finding and suggesting memorable and easy to press keys for your nvim shortcuts.
It takes into consideration keyboard layout, easy to press combinations and memorable phrases, and excludes already mapped combinations to provide you with suggested keys for your commands
**hawtkeys.nvim** is a nvim plugin for finding and suggesting memorable and easy-to-press keys for your nvim shortcuts.
It takes into consideration keyboard layout, easy-to-press combinations and memorable phrases, and excludes already mapped combinations to provide you with suggested keys for your commands

## Getting Started
## 📦 Installation
Installation instructions to follow, but as usual with package managers
```lua
return {
"tris203/hawtkeys.nvim",
config = true,
}
```
## Config
The default config is below, but can be changed by passing a table in config with the options

* leader is your current leader key (This will be automatic in future
* homerow is the numerical representation of the home row in your keyboard layout
* powerFingers contains which fingers are prefered for keystrokes, counted from a 0 index reading left to right. 0, 1, 2 ..9.
* keyboardLayout is the layout, currently only QWERTY is defined. More to follow
* keymap, duh

```lua
{
leader = " "
homerow = 2
powerFingers = { 2, 3, 6, 7 }
keyboardLayout = "qwerty",
return {
"tris203/hawtkeys.nvim",
config = true,
}
```

## Usage
## ❔Usage

### Searching New Keymaps

Expand All @@ -40,7 +22,7 @@ There are two interfaces to hawtkeys, the first allows you to Search For Keymaps
:Hawtkeys
```

This will allow you to search keybinds as below:
This will allow you to search key binds as below:

![demo](https://github.com/tris203/hawtkeys.nvim/assets/18444302/3e2d0851-4c6d-480f-97a0-a4112d0a6923)

Expand All @@ -51,27 +33,68 @@ This will allow you to search keybinds as below:
:HawtkeysAll
```

This will launch a window showing all existing keymaps collected from Neovim bindings and from anlysis of your config file.
This will launch a window showing all existing keymaps collected from Neovim bindings and analysis of your config file.

### Showing Duplicate Keymaps

```
HawtkeysDupes
```

Will show potential duplicate keymaps, where you have accidently set the same key for two different things. This can be useful for tracking down issues with plugins not functioning correctly

It will show potential duplicate keymaps, where you have accidentally set the same key for two different things. This can be useful for tracking down issues with plugins not functioning correctly

## Current Issues

* Currently on large configs, the search can take a while to iterate through your config.
* Where a custom remap function is used, keymaps may be missed.
## ⚙️ Config
```lua
return {
leader = " ", -- the key you want to use as the leader, default is space
homerow = 2, -- the row you want to use as the homerow, default is 2
powerFingers = { 2, 3, 6, 7 }, -- the fingers you want to use as the powerfingers, default is {2,3,6,7}
keyboardLayout = "qwerty", -- the keyboard layout you use, default is qwerty
customMaps = {
--- EG local map = vim.api
--- map.nvim_set_keymap('n', '<leader>1', '<cmd>echo 1')
{
["map.nvim_set_keymap"] = { --name of the expression
modeIndex = "1", -- the position of the mode setting
lhsIndex = "2", -- the position of the lhs setting
rhsIndex = "3", -- the position of the rhs setting
optsIndex = "4", -- the position of the index table
method = "dot_index_expression", -- if the function name contains a dot
},
},
--- EG local map2 = vim.api.nvim_set_keymap
["map2"] = { --name of the function
modeIndex = 1, --if you use a custom function with a fixed value, eg normRemap, then this can be a fixed mode eg 'n'
lhsIndex = 2,
rhsIndex = 3,
optsIndex = 4,
method = "function_call",
},
-- If you use whichkey.register with an alias eg wk.register
["wk.register"] = {
method = "which_key",
},
-- If you use lazy.nvim's keys property to configure keymaps in your plugins
["lazy"] = {
method = "lazy",
},
},
highlights = { -- these are the highlight used in search mode
HawtkeysMatchGreat = { fg = "green", bold = true },
HawtkeysMatchGood = { fg = "green"},
HawtkeysMatchOk = { fg = "yellow" },
HawtkeysMatchBad = { fg = "red" },
},
}
```
The default config will get all keymaps using the ```vim.api.nvim_set_keymap``` and ```vim.keymap.set```.

## Contributing
## ✍️ Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
If you have a suggestion to improve the plugin, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!

If there is something specific you want to work on then, please open an issue/discussion first to avoid duplication of efforts
Expand Down
17 changes: 0 additions & 17 deletions TODO.md

This file was deleted.

0 comments on commit 4b11f0f

Please sign in to comment.