An open API service indexing awesome lists of open source software.

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.

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.
X

autocmd 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
X

vim.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