Files
nvim/lua/conf/autos.lua
Squibid 7c96b43098 kitchen sink...
just gonna put the changes that I can remember making here:
 - replace blink with native completion (omnifunc)
 - remove some unneeded plugins
 - add a misc function for making sure complex bindings don't cause
   flickering
 - remove some stale snippets
 - remove folding (I don't find myself folding that often)
2025-08-02 11:25:38 -04:00

34 lines
828 B
Lua

local auto, augroup = core.misc.auto, core.misc.augroup
-- auto commands which interact with buffers without modifying them
local bufcheck = augroup("bufcheck")
-- auto commands which modify things on the filesystem
local fsmod = augroup("fsmod")
auto("FocusGained", {
group = bufcheck,
desc = "Update contents of file.",
command = "checktime"
})
auto("BufRead", {
group = bufcheck,
desc = "Return to the last place the buffer was closed in.",
callback = function()
vim.fn.setpos(".", vim.fn.getpos("'\""))
vim.cmd("norm! zz")
end
})
auto("BufWritePre", {
group = fsmod,
desc = "remove trailing spaces on file save",
callback = function()
local pos = vim.api.nvim_win_get_cursor(0)
vim.cmd([[%s/\s\+$//e]])
vim.api.nvim_win_set_cursor(0, pos)
end
})
core.color.setup_termbg_sync()