summaryrefslogtreecommitdiffstats
path: root/lua/conf/autos.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2025-05-06 16:51:24 -0500
committerSquibid <me@zacharyscheiman.com>2025-05-06 16:51:24 -0500
commit7c3289fded1f75f6e060f56bd06edc2a327744d9 (patch)
treebf579e6eb1de84237a74ef13ce67703c15266afe /lua/conf/autos.lua
parent3094bf2a3983b375f4adeccd25c3b12bbbded2aa (diff)
downloadnvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.tar.gz
nvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.tar.bz2
nvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.zip
kitchen sink again :(
Diffstat (limited to 'lua/conf/autos.lua')
-rw-r--r--lua/conf/autos.lua34
1 files changed, 17 insertions, 17 deletions
diff --git a/lua/conf/autos.lua b/lua/conf/autos.lua
index b23d26e..c00745b 100644
--- a/lua/conf/autos.lua
+++ b/lua/conf/autos.lua
@@ -1,37 +1,37 @@
-local misc = require('core.misc')
+local misc = require("core.misc")
local auto, augroup = misc.auto, misc.augroup
-- auto commands which interact with bufferes without modifying them
-local bufcheck = augroup('bufcheck')
+local bufcheck = augroup("bufcheck")
-- auto commands which modify things on the filesystem
-local fsmod = augroup('fsmod')
+local fsmod = augroup("fsmod")
-auto('FocusGained', {
+auto("FocusGained", {
group = bufcheck,
- desc = 'Update contents of file.',
- command = 'checktime'
+ desc = "Update contents of file.",
+ command = "checktime"
})
-auto('TextYankPost', {
+auto("TextYankPost", {
group = bufcheck,
- desc = 'Highlight on yank.',
+ desc = "Highlight on yank.",
callback = function()
vim.highlight.on_yank { timeout = 250 }
end
})
-auto('BufRead', {
+auto("BufRead", {
group = bufcheck,
- desc = 'Return to the last place the buffer was closed in.',
+ desc = "Return to the last place the buffer was closed in.",
callback = function()
- vim.fn.setpos('.', vim.fn.getpos("'\""))
+ vim.fn.setpos(".", vim.fn.getpos("'\""))
vim.cmd("norm! zz")
end
})
-auto('BufWritePre', {
+auto("BufWritePre", {
group = fsmod,
- desc = 'remove trailing spaces on file save',
+ desc = "remove trailing spaces on file save",
callback = function()
local pos = vim.api.nvim_win_get_cursor(0)
vim.cmd([[%s/\s\+$//e]])
@@ -39,12 +39,12 @@ auto('BufWritePre', {
end
})
-auto('BufWritePre', {
+auto("BufWritePre", {
group = fsmod,
- desc = 'Basically mkdir -p.',
+ desc = "Basically mkdir -p.",
callback = function(ctx)
if ctx.match:match("^%w%w+://") then return end
- local dir = vim.fn.fnamemodify(ctx.file, ':p:h')
- vim.fn.mkdir(dir, 'p')
+ local dir = vim.fn.fnamemodify(ctx.file, ":p:h")
+ vim.fn.mkdir(dir, "p")
end
})