diff --git a/init.lua b/init.lua index d966482..419d9fc 100644 --- a/init.lua +++ b/init.lua @@ -54,17 +54,59 @@ opt.mouse = "" opt.shortmess:append("atI") opt.hidden = true opt.termguicolors = true -- Important for modern LSPs/UI +opt.updatetime = 300 -- Faster response for diagnostics -- ============================================================================= -- 4. DIAGNOSTICS (Error display) -- ============================================================================= vim.diagnostic.config({ - virtual_text = false, -- No text noise in the line + virtual_text = { + prefix = "●", -- Subtle dot for error messages + }, underline = true, -- Errors are underlined - signs = false, -- No icons on the edge (less noise) + signs = true, -- Enable icons in the gutter update_in_insert = false, + severity_sort = true, }) +-- Show error message in a floating window on hover +vim.api.nvim_create_autocmd("CursorHold", { + callback = function() + vim.diagnostic.open_float(nil, { focusable = false, border = "rounded" }) + end, +}) + +-- Custom icons for diagnostics +local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) +end + +-- ============================================================================= +-- 4.5 TREESITTER (Syntax & Error Highlighting) +-- ============================================================================= +vim.schedule(function() + local ok_ts, ts = pcall(require, "nvim-treesitter.configs") + if ok_ts then + ts.setup({ + ensure_installed = { "lua", "python", "rust" }, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + }) + end +end) + +-- ============================================================================= +-- 4.6 HIGHLIGHTS (Visibility) +-- ============================================================================= +vim.api.nvim_set_hl(0, "DiagnosticUnderlineError", { undercurl = true, sp = "red", bold = true }) +vim.api.nvim_set_hl(0, "DiagnosticUnderlineWarn", { undercurl = true, sp = "orange" }) +vim.api.nvim_set_hl(0, "DiagnosticError", { fg = "red" }) +vim.api.nvim_set_hl(0, "DiagnosticWarn", { fg = "orange" }) + -- ============================================================================= -- 5. KEYMAPS (Leader: Space) -- ============================================================================= diff --git a/lua/config/dashboard.lua b/lua/config/dashboard.lua index 59f708a..65d81cc 100644 --- a/lua/config/dashboard.lua +++ b/lua/config/dashboard.lua @@ -45,7 +45,7 @@ end -- The main menu function M.open() local lines = { - " Mono VIM - 0.17", + " Mono VIM - 0.18", "========================", "", " [n] New File",