https://github.com/tani/vim-typo
Vim-typo is an autocorrection plugin for Vim/Neovim that relies on a syntax file to provide intelligent corrections while typing.
https://github.com/tani/vim-typo
Last synced: 2 months ago
JSON representation
Vim-typo is an autocorrection plugin for Vim/Neovim that relies on a syntax file to provide intelligent corrections while typing.
- Host: GitHub
- URL: https://github.com/tani/vim-typo
- Owner: tani
- License: mit
- Created: 2023-06-26T02:24:43.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T13:08:50.000Z (about 1 year ago)
- Last Synced: 2025-04-14T09:08:31.593Z (2 months ago)
- Language: Vim Script
- Size: 26.4 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.pod
- License: LICENSE
Awesome Lists containing this project
README
---
name: typo
description: Auto-correction plugin for Vim/Neovim
---=pod
=head1 vim-typo
=begin html
=end html
Vim-typo is an auto-correction plugin for Vim/Neovim that relies
on a syntax file to provide intelligent corrections while typing.=head2 Installation X
To install vim-typo, follow the standard procedure for installing Vim plugins.
Here is an example using L:Jetpack 'tani/vim-typo'
=head2 Configuration X
C is a buffer local variable that is set to 1,
when the autocorrection is enabled. if you want to prevent the autocorrection
from being enabled for a specific file type, you can set this variable to 1.
Xautocmd FileType typescript let b:typo_did_setup = 1
To work with the tree-sitter, you need to enable the regex syntax highlighting,
which is disabled by default. You can enable it by adding the following line
Xvim.api.nvim_create_autocmd('FileType', {
pattern = '*',
callback = function(args)
vim.bo[args.buf].syntax = 'on'
end,
})=head2 Algorithm Overview X
The auto-correction algorithm used in vim-typo involves two main operations:
completion and swapping. Typos in words, excluding the first and last letters,
are corrected. The algorithm focuses specifically on correcting typos in words
that are at least 6 characters long.During typing, vim-typo dynamically retrieves the word source
from the syntax file, enabling on-the-fly autocorrections.=head2 License X
This plugin is released under the MIT License.
(c) 2023 Masaya Taniguchi=cut