This plugin is based on the idea that many typos occur because letters are typed with different hands. It applies the idea to a small set of keywords.
The algorithm simply checks if two letters in sequence are pressed by different hands. Based on this list, neovim's native abbreviation system will be configured to correct the typo.
Each language-specific abbreviation configuration will be applied once the defined file extension matches.
For example, in a language that supports the const
keyword, typing cosnt
will correct the typo (in the case of a US keyboard). See the test data for all abbreviations.
You can also configure your own custom keywords based on file extension.
Requires neovim-nightly.
{
"arminfro/hand-side-fix.nvim",
event = "BufEnter",
opts = true,
},
excludes
, defines a global list which will be ignored in abbreviations"fi"
is just for demonstration, in case ofbash
it's not needed, keywords are ignored by default
custom_keywords
, is a list with file extension(s) and keywords to set specific abbreviation config
{
layout = "us",
excludes = { "fi" },
custom_keywords = {
{
pattern = "*.md",
keywords = {
"the", "of", "and", "to", "in", "is", "was", "that", "for", "as", "with", "by",
"on", "are", "from", "be", "or", "his", "were", "it", "an", "at", "not", "which",
"have", "he", "had", "this", "has", "also", "their", "but", "one", "can", "its",
"on", "the", "other", "been", "more", "they", "used", "first", "all", "two",
},
},
},
},
- Bash
- C/C++
- C#
- Go
- Haskell
- Html
- Java
- Javascript/Typescript
- Kotlin
- Lua
- Php
- Python
- Ruby
- Rust
- Scala
- Swift