{"id":19814852,"url":"https://github.com/chris-ritsen/vim-autocorrect","last_synced_at":"2025-09-18T06:32:15.321Z","repository":{"id":111514086,"uuid":"461021309","full_name":"chris-ritsen/vim-autocorrect","owner":"chris-ritsen","description":"Vim package to autocorrect over 45,000 qwerty typos and misspellings","archived":false,"fork":false,"pushed_at":"2024-05-23T18:51:39.000Z","size":1927,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-19T10:13:34.363Z","etag":null,"topics":["autocorrect","vim","vim-packages","vim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris-ritsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-02-18T22:14:33.000Z","updated_at":"2024-05-23T18:51:43.000Z","dependencies_parsed_at":"2024-02-07T15:59:35.929Z","dependency_job_id":null,"html_url":"https://github.com/chris-ritsen/vim-autocorrect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-ritsen%2Fvim-autocorrect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-ritsen%2Fvim-autocorrect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-ritsen%2Fvim-autocorrect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-ritsen%2Fvim-autocorrect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-ritsen","download_url":"https://codeload.github.com/chris-ritsen/vim-autocorrect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233456042,"owners_count":18678963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocorrect","vim","vim-packages","vim-plugin"],"created_at":"2024-11-12T10:03:29.871Z","updated_at":"2025-09-18T06:32:15.311Z","avatar_url":"https://github.com/chris-ritsen.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\n\nThis is a vim package for an autocorrect feature built on the `iabbrev` and\n`spellsuggest` commands and years worth of spelling mistakes and typos made on\nqwerty keyboards.\n\nThe result is useful for writing general prose or code, but is especially good\nfor a stream-of-consciousness or for transcription. It's fast and accurate\nenough to consider using unconditionally every time vim is started.\n\nThe goal is to create the largest list of typos and spelling mistakes with\nopinionated corrections that exists, without compromising accuracy and without\never doing anything unexpected.\n\nIt's not possible to fix everything all the time, but if used correctly, many\ntypos will be seen once and never again.\n\nThe full list of over 51,000 typos is in\n[abbrev](opt/vim-abbrev/plugin/abbrev). The words in the included list were\ngenerated from various sources, such as personal notes, fiction, non-fiction,\nand while writing code. It is made up of only lines like these:\n\n```\nteh the\n```\n\nThese are then added to vim as iabbrev definitions:\n\n```vim\niabbrev teh the\n```\n\nIt's not a grammar checker. There's no way to fix transposition typos on\nshort words like `from`/`form`, but it works well for longer words or those\nthat are difficult to spell.\n\n## Demos\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/chris-ritsen/vim-autocorrect/blob/master/demo/description.gif?raw=true\" alt=\"\" title=\"vim-autocorrect description\" width=\"474\"/\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/chris-ritsen/vim-autocorrect/blob/master/demo/rules.gif?raw=true\" alt=\"\" title=\"vim-autocorrect rules\" width=\"474\"/\u003e\u003c/p\u003e\n\n## Installation\n\nThis repo is not a plugin; it is a package of two vim plugins and should be\ninstalled to `~/.vim/pack/vim-autocorrect`. The\n[vim-abbrev-add](start/vim-abbrev-add/) plugin has functions to interactively\nadd abbreviations to the list, while the list is stored and loaded in\n[vim-abbrev](start/vim-abbrev).\n\n## Configuration\n\nBy default, the typos and their corrections are added to\n[abbrev](opt/vim-abbrev/plugin/abbrev), but this can be overridden by setting\nthe variable `g:abbrev_file`.\n\n```vim\nlet g:abbrev_file = expand('~/.vim/pack/vim-autocorrect/opt/vim-abbrev/plugin/abbrev')\n```\n\n## Usage\n\n### Loading the list\n\nTo source the list of abbreviations (i.e., enable autocorrect) use the\n`packadd` command on the package:\n\n```vim\npackadd vim-abbrev\n```\n\nThis will take several seconds to load, but shouldn't inconvenience the user.\nThe problem is that it takes time to source this list and with every\nabbreviation added it takes vim longer to insert one, which blocks user input.\nAbbreviations are loading asynchronously in batches of decreasing size at a\ndelay with `timer_start`. About 6-10 seconds after loading the package, it\nshould have sourced everything.\n\n### Adding to the list\n\nTo quickly add abbreviations to the file after making typos, map the\n`AutoCorrect` command like this:\n\n```vim\nnnoremap \u003csilent\u003e \u003cleader\u003ed \u003cesc\u003evip:call AutoCorrect()\u003cCR\u003e\n```\n\nThe `vip` here will select the current paragraph and pull out typos and use\nthe built-in `spellsuggest` feature to guess at a correction. After pressing\n`enter` or `\u003cc-j\u003e` to confirm the new abbreviations, they will be written to\nthe file and added with iabbrev.\n\n### Editing the list\n\nRemoval of words must be done manually. Open\n[abbrev](opt/vim-abbrev/plugin/abbrev) and make any necessary changes.\n\n### Disabling autocorrect\n\n```vim\niabclear\nlet g:loaded_AutoCorrect = 0\n```\n\n### Workflow while writing\n\nIf you need to write a word that would otherwise be autocorrected, such as\n`teh`, type `\u003cC-C\u003e` or `\u003cC-V\u003e` after writing the word. `\u003cC-C\u003e` goes back to\nnormal mode without performing the correction, while `\u003cC-V\u003e` stays in insert\nmode.\n\nSome tips for writing prose with this:\n\n- Add words to the good word list with `zg` to avoid accidentally correcting\n  them.\n- Don't assume that `spellsuggest` is going to suggest the correct word.\n- If a word is likely to have been typed badly, type it again at least once\n  more. Unless editing is done soon after, the correct word may not be\n  obvious.\n- If a word starts off badly, either delete it or add a space and type it\n  again. Typos with unrelated prefixes are not as useful and are easily\n  avoided.\n- Review recently added typos and check for errors. Hastily adding\n  corrections isn't reliable.\n\n## About the list\n\nI've been building this list since 2012. This list exists for my own benefit,\nso I'm not interested in contributions. Reasonable suggestions will be\nconsidered. I write in the `en-US` locale with a standard qwerty layout. It\nwas created on the following keyboards:\n\n- Apple US English keyboard MB110LL/B\n- [HHKB Pro JP](https://hhkb.io/models/HHKB_Professional_JP/)\n- [HHKB Professional 2](https://hhkb.io/models/HHKB_Professional_2/)\n- MacBook air (2012)\n- MacBook pro (2020)\n- Topre Realforce 91UDK-G NG02B0\n\nDeleting the words in [abbrev](opt/vim-abbrev/plugin/abbrev) and starting from\nscratch with any set of rules is an option, but the included list was created\nby making every effort to avoid unintentional corrections. Typos will be\npruned from this list regularly. This list contains obvious errors (i.e.,\ncorrecting a word to a misspelling, or going against the listed rules).\n\nOnly one correction can exist for any given typo, so sometimes a decision must\nbe made to prioritize different types of typing mistakes. There are several\napparent categories of typos in this list. The main ones are:\n\n- Extraneous or missing characters due to sloppy typing (`Henfdrix`/`Hendrix`\n  and (`accont`/`account`). This includes extreme laziness\n  (`Cahrtaxccteristics`/`Characteristics`).\n- Omission of diacritical marks (correct `Patisambhida`/`Paṭisambhidā` and\n  `Cliche`/`Cliché` but not `resume`/`résumé`).\n- Repeated characters due to a high network latency or high key repeat rate\n  (`Whaaaat`/`What`).\n- Spelling mistakes, including a refusal to learn to correctly spell a word or\n  guesses (`compatability`/`compatibility`) (`anurism`/`aneurysm`).\n- Timing errors with the shift keys (`INform`/`Inform`).\n- Timing errors with the spacebar (`atht`/`at` and `costsa`/`costs`).\n- Transposition of characters due to timing errors between hands or fingers\n  (`thta`/`that`).\n- Wrong key pressed (`Hpw`/`How`).\n\nNumbers are almost always considered to be extraneous characters by this list,\nespecially when within a word (`However3`/`However` and `z3est`/`zest`).\n\nTiming errors are common when shift is used for capitalization\n(`ONly`/`Only`). Transposition of characters is usually due to individual\nfingers pressing keys at the wrong time while trying to coordinate both hands\nas quickly as possible.\n\nTiming errors with the spacebar are also common. The typo `yto` could be the\nword `toy`, but it's extremely unlikely. It was actually a stray letter from\na previous word prefixed to the word `to`. To typo the word `toy` as `yto`\nrequires pressing the keys in a reversed order with one hand and is not simply\na timing error between hands. While possible, that type of error almost never\nhappens in practice.\n\n### Rules for the list\n\n#### General\n\n- Avoid adding short typos or words, such as those under four characters long.\n- Avoid making decisions about mixed-case acronyms.\n- Don't add any symbols to the correction. `DBus` should not correct to\n  `D-Bus`.\n- Don't add contractions or word fragments. `hadn` shouldn't correct to\n  `hand` and no entry should exist for `shouldn` or `couldn`. No corrections\n  like `couldnt`/`couldn't` or `dont`/`don't` should be added. It's not\n  likely to be handled correctly by the script that adds abbreviations,\n  either.\n- Don't add words that are unlikely to broadly usable, such as camel case\n  variable names. Correcting `EventEMitter`, to `EventEmitter` is fine.\n- Don't consider foreign words as typos, if known.\n- Don't correct common abbreviations—such as `acct` for `account`—even if it\n  happened to be a typo for `act`.\n- Prioritize compatibility with writing prose over code, but attempt to make\n  it work with both if possible.\n- Remove any autocorrection that results in a word that was unintended.\n- Remove any typos that end up being programs, libraries, variables, names,\n  nouns, brands, etc., but only when discovered. For example, the program\n  named `mosquitto` should not be corrected to `mosquito` and `msoquitto`\n  should be corrected to `mosquitto`, not `mosquito`.\n\n#### Spelling mistakes\n\n- Add diacritical marks to letters only if the correct word is unambiguous.\n  Correcting `Senor` to `Señor` is fine right up until `Senor` is written as a\n  typo for `Sensor` or `Senior`.\n- Avoid changing capitalization of words, as it could be part of a string\n  literal or variable name. `Paypal` should not be changed into `PayPal`, but\n  `LaTex` correcting to `LaTeX` is fine. The word `I` should not corrected\n  when `i` is typed. Mistakes with shift key timing are only considered for\n  the first two characters.\n- Don't attempt to localize/localise words.\n- Don't enforce a preferred spelling, even for archaic words. `Eery` should\n  not be corrected to `Eerie`.\n\n#### Typing mistakes\n\n- Don't correct short words with a missing letter.\n- Don't use this for expanding abbreviated words. At most, this should be\n  limited to a character or two omitted from the end of a long word, or a\n  short word if the correct word is unambiguous. Correcting `abou` to `about`\n  is fine.\n- Don't change the tense of words. Be explicit about it if possible.\n- Generally, don't pluralize words that weren't already pluralized. While\n  `keyboaresd` is obviously a transposition typo for `keyboards`, it's\n  corrected to `keyboard` instead. Type an explicit `s` at the end of a badly\n  typed word to ensure the correction will also have an `s` at the end. In\n  practice, this looks like `Effecsts`/`Effects`. This rule only applies to\n  pluralization, so `suppooes` would be corrected to `suppose`. `COntorsl`\n  should still be corrected to `Controls`, as this is due to mistimed hands,\n  not fingers on the same hand.\n- No synthetic typos.\n- Remove any leading characters from the previous word due to a mistimed\n  spacebar press, unless they are valid words or used as variable names. The\n  typo `atht` made by typing `at that` with a mistimed spacebar should not be\n  corrected into `at` or `that`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-ritsen%2Fvim-autocorrect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-ritsen%2Fvim-autocorrect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-ritsen%2Fvim-autocorrect/lists"}