Compare commits

...
12 Commits
Author SHA1 Message Date
swaits f3926d5f6c chore: repoint remaining links at git.swaits.com
Rewrites lingering github.com / *.sr.ht references to this Gitea instance,
translating GitHub and Sourcehut URL shapes to Gitea's (/blob/<ref>/ and
sr.ht /tree/<ref>/item/ -> /src/branch/<ref>/, /tree/<tag> -> /src/tag/<tag>,
/actions/workflows/X -> /actions?workflow=X, /edit/ -> /_edit/).

Left pointing at the old hosts on purpose: pull-request links (PRs were not
migrated), forks that were never migrated, and GitHub-only surfaces Gitea
lacks. OpenPGP identity proofs are untouched by design.
2026-08-31 18:32:24 -06:00
swaits 5e4dc431f0 chore: remove Sourcehut CI manifest
Migrated to git.swaits.com; Sourcehut builds no longer run.
2026-08-31 17:16:40 -06:00
swaits 97f3962d46 refactor: inline config, simplify init to 14 lines 2026-04-09 18:30:05 -06:00
swaits 357580127c add github mirror 2024-01-29 10:23:27 -07:00
swaits c542d26de1 change reference packer to pckr.nvim 2023-10-26 09:09:48 -06:00
swaits 1977a65cb0 suggest lazy loading for lazy.vim instructions in README.md 2023-10-20 22:09:57 -06:00
swaits f61e0a1419 don't load config until setup() is called 2023-10-20 20:53:06 -06:00
swaits c00f1ae51e surface license in README.md 2023-10-20 10:54:41 -06:00
swaits 93f4128beb add screencast demo 2023-10-20 10:46:42 -06:00
swaits 9f327d4f0e README tweaks 2023-10-19 20:11:55 -06:00
swaits e1ce2a385f add .stylua.toml and fix indentation 2023-10-19 20:02:11 -06:00
swaits bc4d162b63 update README.md 2023-10-19 17:31:35 -06:00
5 changed files with 48 additions and 45 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 100
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2023 Stephen Waits <steve@waits.net> Copyright © 2023 Stephen Waits <steve@waits.net>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+36 -8
View File
@@ -1,11 +1,15 @@
# thethethe # thethethe.nvim
This is a Neovim plugin to autocorrect common misspellings and typos. If you This is a Neovim plugin to autocorrect common misspellings and typos. If you
type _teh_, neovim will automatically correct it to _the_. type _teh_, neovim will automatically correct it to _the_.
It's based on [vim-autocorrect](https://github.com/panozzaj/vim-autocorrect), It's based on [vim-autocorrect](https://github.com/panozzaj/vim-autocorrect),
but designed for Neovim and written in pure Lua. Unlike that plugin, this loads but designed for Neovim and written in pure Lua. It also loads the dictionary
the dictionary in the background, so it doesn't delay startup time. in the background, so it doesn't delay startup time.
## Demo
[![asciicast](https://asciinema.org/a/WtUg846Z7wNiMrzPgjod1picV.svg)](https://asciinema.org/a/WtUg846Z7wNiMrzPgjod1picV)
## Installing ## Installing
@@ -13,16 +17,18 @@ the dictionary in the background, so it doesn't delay startup time.
```lua ```lua
{ {
"https://git.sr.ht/~swaits/thethethe.nvim", "https://git.swaits.com/swaits/thethethe.nvim",
lazy = true,
event = "VeryLazy",
opts = { }, opts = { },
} }
``` ```
### [packer](https://github.com/wbthomason/packer.nvim) ### [pckr](https://github.com/lewis6991/pckr.nvim)
```lua ```lua
{ {
"https://git.sr.ht/~swaits/thethethe.nvim", "https://git.swaits.com/swaits/thethethe.nvim",
config = function() config = function()
require("thethethe").setup() require("thethethe").setup()
end end
@@ -32,7 +38,7 @@ the dictionary in the background, so it doesn't delay startup time.
### [vim-plug](https://github.com/junegunn/vim-plug) ### [vim-plug](https://github.com/junegunn/vim-plug)
```vim ```vim
Plug 'https://git.sr.ht/~swaits/thethethe.nvim' Plug 'https://git.swaits.com/swaits/thethethe.nvim'
lua require("thethethe").setup() lua require("thethethe").setup()
``` ```
@@ -49,7 +55,29 @@ opts = {
## Future Directions ## Future Directions
- Allow specifying a custom dictionary files - Allow specifying custom dictionary files
- List custom dictionary entries directly in `opts {}` - List custom dictionary entries directly in `opts {}`
- Split current (large!) dictionary into something like small, medium, large - Split current (large!) dictionary into something like small, medium, large
- Recategorize current dictionary "English" and add options to include non-English dictionaries - Recategorize current dictionary "English" and add options to include non-English dictionaries
## MIT License
Copyright © 2023 Stephen Waits <steve@waits.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-6
View File
@@ -1,6 +0,0 @@
local M = {}
-- Time (milliseconds) to wait before loading abbreviations
M.delay_ms = 2000
return M
+8 -30
View File
@@ -1,37 +1,15 @@
local M = {} local M = {}
-- load our default configuration
local config = require("thethethe.config")
-- load abbreviations.dict
local function load_abbreviations()
-- load our dictionary string
local s = require("thethethe.dictionary")
-- split dictionary by lines
for line in s:gmatch("([^\n]*)\n?") do
-- split each line by the colon
local parts = {}
for part in line:gmatch("[^:]+") do
table.insert(parts, part)
end
if #parts == 2 and parts[1] and parts[2] then
-- Add abbreviation via `iabbrev` (through vim.cmd)
vim.cmd(string.format("iabbrev %s %s", parts[1], parts[2]))
end
end
end
-- create our exported setup() function
function M.setup(opts) function M.setup(opts)
-- check for default overrides passed in opts = opts or {}
if opts then vim.defer_fn(function()
config.delay_ms = opts.delay_ms or config.delay_ms for line in require("thethethe.dictionary"):gmatch("[^\n]+") do
local typo, fix = line:match("^([^:]+):(.+)$")
if typo and fix then
vim.cmd.iabbrev(typo, fix)
end end
end
-- execute the function after config.delay_ms end, opts.delay_ms or 2000)
vim.defer_fn(load_abbreviations, config.delay_ms)
end end
return M return M