Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3926d5f6c
|
||
|
|
5e4dc431f0
|
||
|
|
97f3962d46
|
No files matched your search
-11
@@ -1,11 +0,0 @@
|
|||||||
image: alpine/edge
|
|
||||||
secrets:
|
|
||||||
- 88cce185-d2ec-4573-9546-e33f36f79bbf
|
|
||||||
sources:
|
|
||||||
- git+ssh://git@git.sr.ht/~swaits/thethethe.nvim
|
|
||||||
tasks:
|
|
||||||
- mirror-to-github: |
|
|
||||||
cd ~/thethethe.nvim
|
|
||||||
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
|
|
||||||
git remote add github git@github.com:swaits/thethethe.nvim.git
|
|
||||||
git push --mirror github
|
|
||||||
@@ -17,7 +17,7 @@ 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,
|
lazy = true,
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = { },
|
opts = { },
|
||||||
@@ -28,7 +28,7 @@ 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",
|
||||||
config = function()
|
config = function()
|
||||||
require("thethethe").setup()
|
require("thethethe").setup()
|
||||||
end
|
end
|
||||||
@@ -38,7 +38,7 @@ 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()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
local M = {}
|
|
||||||
|
|
||||||
-- Time (milliseconds) to wait before loading abbreviations
|
|
||||||
M.delay_ms = 2000
|
|
||||||
|
|
||||||
return M
|
|
||||||
+9
-31
@@ -1,37 +1,15 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
-- 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)
|
||||||
-- load our default configuration
|
opts = opts or {}
|
||||||
local config = require("thethethe.config")
|
vim.defer_fn(function()
|
||||||
|
for line in require("thethethe.dictionary"):gmatch("[^\n]+") do
|
||||||
-- check for default overrides passed in
|
local typo, fix = line:match("^([^:]+):(.+)$")
|
||||||
if opts then
|
if typo and fix then
|
||||||
config.delay_ms = opts.delay_ms or config.delay_ms
|
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
|
||||||
Reference in new issue
Block a user