mirror of
https://github.com/bgrolleman/dotfiles.git
synced 2026-06-26 07:20:43 +02:00
Cleanup nvim with Claude
This commit is contained in:
@@ -1,7 +1,21 @@
|
||||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
--
|
||||
-- Add any additional autocmds here
|
||||
-- with `vim.api.nvim_create_autocmd`
|
||||
--
|
||||
-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults)
|
||||
-- By this point noice.nvim has already replaced vim.notify
|
||||
|
||||
-- Log warnings and errors to file for debugging
|
||||
local log_path = vim.fn.stdpath("log") .. "/nvim_errors.log"
|
||||
local _notify = vim.notify
|
||||
vim.notify = function(msg, level, opts)
|
||||
if level and level >= vim.log.levels.WARN then
|
||||
local f = io.open(log_path, "a")
|
||||
if f then
|
||||
f:write(string.format(
|
||||
"[%s] %s: %s\n",
|
||||
os.date("%Y-%m-%d %H:%M:%S"),
|
||||
level == vim.log.levels.ERROR and "ERROR" or "WARN",
|
||||
tostring(msg)
|
||||
))
|
||||
f:close()
|
||||
end
|
||||
end
|
||||
return _notify(msg, level, opts)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user