Skip to content

Neovim's native abbreviation system will be configured to correct typos that occur with different hands for specific sets of keywords

License

Notifications You must be signed in to change notification settings

arminfro/hand-side-fix.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abbreviations setup with hand-side-fix.nvim

Lua GitHub Workflow Status

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.

Installation via lazy.nvim

Requires neovim-nightly.

{
  "arminfro/hand-side-fix.nvim",
  event = "BufEnter",
  opts = true,
},

Configuration

  • excludes, defines a global list which will be ignored in abbreviations
    • "fi" is just for demonstration, in case of bash 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",
      },
    },
  },
},

Supported Languages

  • Bash
  • C/C++
  • C#
  • Go
  • Haskell
  • Html
  • Java
  • Javascript/Typescript
  • Kotlin
  • Lua
  • Php
  • Python
  • Ruby
  • Rust
  • Scala
  • Swift

Contributing

  • provide some keyboard layout file and I can wire it up
  • provide keywords list for a programming language not supported yet
  • check the keywords defined for a programming language and suggest improvements

About

Neovim's native abbreviation system will be configured to correct typos that occur with different hands for specific sets of keywords

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published