config/user/.config/nvim/lua/priv/autocmd.lua

11 lines
332 B
Lua
Raw Normal View History

2024-07-23 13:42:05 +00:00
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "email-list.md",
callback = function ()
local infile = vim.fn.expand('%:p')
local outfile = os.getenv("HOME") .. '/docs/notes/harc/emails/raw-list.md'
local command = string.format("grep -o '[^ ^ ]*@[^ ^ ]*' %s > %s", infile, outfile)
os.execute(command)
end,
})