This commit is contained in:
Pagwin 2025-09-25 01:00:46 -04:00
parent 88969e03a2
commit 1cd9fc15e8
No known key found for this signature in database
GPG key ID: 81137023740CA260

View file

@ -0,0 +1,11 @@
local function split_sentences()
local view = vim.fn.winsaveview() -- keep cursor & view stable
vim.cmd([[%s/\([.?!]\)\s\+/\1\r/ge]])
vim.fn.winrestview(view)
end
-- run after leaving insert mode
vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged" }, {
pattern = { "*.md", "*.txt" },
callback = split_sentences
})