fix(config): cleanup bugs, redundancy, and add agent-friendly auto-reload
- remove broken mini.files mappings (plugin disabled; yazi is used now) - dedupe tint.nvim spec (drop plugins/theme.lua, keep ui.lua) - drop dead copilot cmp source + moot Supermaven symbol (Supermaven stays inline) - remove yaml from biome formatters (biome has no yaml support) - collapse 3x biome chain to a single biome-check pass - remove duplicate insert-mode jk mapping - lazy-load tailwind-tools by filetype - diagnostics: update_in_insert = false - untrack .nvimlog, add .gitignore - auto-reload files changed on disk (autoread + checktime autocmds) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
.nvimlog
|
||||
@@ -1 +0,0 @@
|
||||
WRN 2026-02-16T16:29:54.587 ?.8 server_start:199: Failed to start server: read-only file system: /run/user/1000/nvim.8.0
|
||||
@@ -31,6 +31,7 @@ pcall(dofile, vim.g.base46_cache .. "statusline")
|
||||
|
||||
require "options"
|
||||
require "nvchad.autocmds"
|
||||
require "autocmds"
|
||||
|
||||
vim.schedule(function()
|
||||
require "mappings"
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
-- Reload buffers when their file changes on disk (e.g. edited by a coding agent).
|
||||
-- `autoread` (set in options.lua) only takes effect when something triggers a check,
|
||||
-- so we run `checktime` on focus/movement/buffer events. Event-based only: no idle
|
||||
-- polling, so there's zero overhead when nvim is sitting still.
|
||||
local grp = vim.api.nvim_create_augroup("auto_reload", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI", "TermClose", "TermLeave" }, {
|
||||
group = grp,
|
||||
callback = function()
|
||||
-- skip while typing a command or in the command-line window
|
||||
if vim.fn.mode() ~= "c" and vim.fn.getcmdwintype() == "" then
|
||||
vim.cmd "silent! checktime"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileChangedShellPost", {
|
||||
group = grp,
|
||||
callback = function()
|
||||
vim.notify("File reloaded (changed on disk)", vim.log.levels.INFO)
|
||||
end,
|
||||
})
|
||||
+2
-3
@@ -3,11 +3,11 @@ local lspkind = require "lspkind"
|
||||
local nvchad_options = require "nvchad.configs.cmp"
|
||||
|
||||
local options = {
|
||||
-- Supermaven handles AI completion inline (ghost text, accept with <C-Enter>);
|
||||
-- it is not a cmp source, so it is intentionally absent here.
|
||||
sources = {
|
||||
-- { name = "supermaven" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "copilot" },
|
||||
{ name = "buffer" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "path" },
|
||||
@@ -17,7 +17,6 @@ local options = {
|
||||
format = lspkind.cmp_format {
|
||||
mode = "symbol",
|
||||
max_width = 50,
|
||||
symbol_map = { Supermaven = "" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
rust = { "rustfmt", require_cwd = true },
|
||||
javascript = { "biome-check", "biome", "biome-organize-imports" },
|
||||
typescript = { "biome-check", "biome", "biome-organize-imports" },
|
||||
json = { "biome-check", "biome" },
|
||||
yaml = { "biome-check" },
|
||||
-- biome-check runs format + organize-imports + safe lint fixes in one pass
|
||||
javascript = { "biome-check" },
|
||||
typescript = { "biome-check" },
|
||||
json = { "biome-check" },
|
||||
solidity = { "forge_fmt" },
|
||||
nix = { "nixfmt" },
|
||||
toml = { "taplo" },
|
||||
|
||||
@@ -59,7 +59,7 @@ M.defaults = function()
|
||||
[vim.diagnostic.severity.INFO] = "",
|
||||
},
|
||||
},
|
||||
update_in_insert = true,
|
||||
update_in_insert = false,
|
||||
underline = true,
|
||||
severity_sort = true,
|
||||
virtual_text = false,
|
||||
|
||||
+1
-17
@@ -2,29 +2,13 @@ require "nvchad.mappings"
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
-- remove nvim-tree mappings (using mini.files instead)
|
||||
-- remove nvim-tree mappings (nvim-tree disabled; using yazi instead, see plugins/yazi.lua)
|
||||
vim.keymap.del("n", "<leader>e")
|
||||
vim.keymap.del("n", "<C-n>")
|
||||
vim.keymap.del("n", "<leader>rn")
|
||||
map("n", "<leader>rn", vim.lsp.buf.rename, { desc = "LSP Rename" })
|
||||
|
||||
-- mini.files
|
||||
map("n", "<leader>e", function()
|
||||
local MiniFiles = require "mini.files"
|
||||
if not MiniFiles.close() then
|
||||
MiniFiles.open(vim.api.nvim_buf_get_name(0))
|
||||
end
|
||||
end, { desc = "File explorer (current file)" })
|
||||
|
||||
map("n", "<leader>E", function()
|
||||
local MiniFiles = require "mini.files"
|
||||
if not MiniFiles.close() then
|
||||
MiniFiles.open(vim.uv.cwd())
|
||||
end
|
||||
end, { desc = "File explorer (cwd)" })
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
|
||||
-- close current buffer
|
||||
map("n", "<leader>q", ":q<cr>")
|
||||
|
||||
@@ -21,3 +21,6 @@ vim.g.neovide_scroll_animation_length = 0.15
|
||||
vim.g.neovide_cursor_animation_length = 0.11
|
||||
|
||||
vim.o.swapfile = false
|
||||
|
||||
-- reload files edited on disk (e.g. by coding agents); see lua/autocmds.lua for the trigger
|
||||
vim.o.autoread = true
|
||||
|
||||
@@ -59,6 +59,7 @@ return {
|
||||
{
|
||||
"luckasRanarison/tailwind-tools.nvim",
|
||||
name = "tailwind-tools",
|
||||
ft = { "html", "css", "scss", "javascriptreact", "typescriptreact", "vue", "svelte", "astro" },
|
||||
build = ":UpdateRemotePlugins",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"levouh/tint.nvim",
|
||||
config = function()
|
||||
require("tint").setup {
|
||||
tint = -10,
|
||||
tint_background_colors = true,
|
||||
|
||||
window_ignore_function = function(winid)
|
||||
local bufid = vim.api.nvim_win_get_buf(winid)
|
||||
local buftype = vim.api.nvim_get_option_value("buftype", { buf = bufid })
|
||||
return buftype == "nofile"
|
||||
end,
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user