Update nvim

This commit is contained in:
pmcc committed 2026-10-27 10:02:27 -04:00
1 parent 1349e3b76f
commit f207707bc9
11 files changed
+115 -214

No files matched your search

@@ -0,0 +1,18 @@
vim.pack.add({
{ src = "https://github.com/rmagatti/auto-session", version = vim.version.range("^2") },
})
require("auto-session").setup({
-- Sessions are keyed by cwd, so each folder restores its own buffers/windows.
-- Disable auto-save/restore when launched with file arguments (e.g. nvim foo.txt).
auto_save = function()
return vim.fn.argc(-1) == 0
end,
auto_restore = function()
return vim.fn.argc(-1) == 0
end,
suppressed_dirs = { "~/.", "/tmp", "~/Downloads" },
session_lens = {
load_on_setup = false,
},
})
+5 -1
View File
@@ -13,7 +13,10 @@ local providers = {
}
require("blink.cmp").setup({
keymap = { preset = "super-tab" },
keymap = {
preset = "super-tab",
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
},
appearance = {
nerd_font_variant = "mono",
use_nvim_cmp_as_default = true,
@@ -22,6 +25,7 @@ require("blink.cmp").setup({
documentation = { auto_show = false },
trigger = { prefetch_on_insert = false },
},
signature = { enabled = true },
-- cmdline and / search are handled by wilder.nvim
cmdline = { enabled = false },
sources = {
+2
View File
@@ -16,6 +16,7 @@ vim.api.nvim_create_autocmd("PackChanged", {
require("plugins.theme")
require("plugins.mini-icons")
require("plugins.mini-pairs")
require("plugins.illuminate")
require("plugins.treesitter")
require("plugins.blink")
@@ -27,6 +28,7 @@ require("plugins.bufferline")
require("plugins.telescope")
require("plugins.wilder")
require("plugins.neotree")
require("plugins.auto-session")
require("plugins.conform")
require("plugins.dap")
require("plugins.git")
@@ -0,0 +1,7 @@
vim.pack.add({
{ src = "https://github.com/nvim-mini/mini.pairs", version = "stable" },
})
-- Auto-close pairs: (), [], {}, '', "", ``
-- '<' is intentionally not paired (default; usually a comparison operator).
require("mini.pairs").setup({})
+77 -57
View File
@@ -1,31 +1,55 @@
-- Pinned to the v2 rewrite branch until it replaces v1 on main (2026-11-16,
-- see https://github.com/petertriho/nvim-scrollbar/issues/121). After that,
-- switch to `version = vim.version.range("^2")`.
vim.pack.add({
{ src = "https://github.com/petertriho/nvim-scrollbar" },
{ src = "https://github.com/petertriho/nvim-scrollbar", version = "refactor/v2" },
})
-- Show illuminated word matches as scrollbar marks. nvim-scrollbar's render
-- autocmds (BufWinEnter/WinEnter/TextChanged/VimResized/WinScrolled) do not fire
-- on CursorMoved, which is when illuminate refreshes its references, so hook
-- those events directly, mirroring how the built-in diagnostic handler works.
-- illuminate also refreshes its own refs ~(delay 100ms) after CursorMoved, so
-- re-run the highlight refresh on a small debounce for snappy bars.
local utils = require("scrollbar.utils")
local render = require("scrollbar").throttled_render
require("scrollbar").setup({
exclude = {
filetypes = { ["neo-tree"] = true },
},
local function update_illuminate_marks()
local bufnr = vim.api.nvim_get_current_buf()
local config = require("scrollbar.config").get()
if
config.show == false
or not vim.api.nvim_buf_is_valid(bufnr)
or vim.tbl_contains(config.excluded_buftypes, vim.bo[bufnr].buftype)
or vim.tbl_contains(config.excluded_filetypes, vim.bo[bufnr].filetype)
then
return
end
-- Search marks are native in v2 (no hlslens dependency like v1).
providers = {
search = true,
gitsigns = true,
},
marks = {
Illuminate = { text = "≡", priority = 8, highlight = "Special" },
Search = { highlight = "DiagnosticVirtualTextInfo" },
Error = { highlight = "DiagnosticFloatingError" },
Warn = { highlight = "DiagnosticFloatingWarn" },
Info = { highlight = "DiagnosticFloatingInfo" },
Hint = { highlight = "DiagnosticFloatingHint" },
GitAdd = { highlight = "GitSignsAdd" },
GitChange = { highlight = "GitSignsChange" },
GitDelete = { highlight = "GitSignsDelete" },
},
scrollbar = {
-- Non-focusable so Ctrl+W w never lands on the float; also disables
-- click/drag navigation on the scrollbar.
mouse = false,
-- v1 had no track; the explicit PmenuSbar handle highlight carried over
-- would make the thumb indistinguishable from the v2 track, which also
-- defaults to PmenuSbar. The v2 defaults (PmenuThumb thumb on a
-- PmenuSbar track) give the same subtle-on-subtle look the v1 override
-- was after.
},
})
-- Show illuminated word matches as scrollbar marks. The illuminate plugin
-- refreshes its references after CursorMoved, so hook the events directly and
-- publish through the provider API. `buffer = "provider"` ownership means the
-- manager dispatches no automatic buffer refreshes; our autocmds own that.
-- illuminate also refreshes its own refs ~100ms after CursorMoved, so re-run
-- the refresh on a small debounce for snappy bars.
local function get_illuminate_marks(bufnr)
local ok, reference = pcall(require, "illuminate.reference")
if not ok then
return
return {}
end
-- illuminate stores refs as { {0-indexed line, col}, {0-indexed line, col} },
@@ -40,47 +64,43 @@ local function update_illuminate_marks()
line = line,
text = "≡",
type = "Illuminate",
level = 1,
}
end
end
local marks = utils.get_scrollbar_marks(bufnr)
marks.Illuminate = illuminate_marks
utils.set_scrollbar_marks(bufnr, marks)
render()
return illuminate_marks
end
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorHold", "TextChanged", "BufEnter", "WinEnter" }, {
group = vim.api.nvim_create_augroup("scrollbar_illuminate", { clear = true }),
callback = function(args)
update_illuminate_marks()
if args.event == "CursorMoved" or args.event == "TextChanged" then
vim.defer_fn(update_illuminate_marks, 250)
require("scrollbar.providers").register({
name = "illuminate",
refresh_owner = { buffer = "provider" },
refresh = function(bufnr)
return get_illuminate_marks(bufnr)
end,
setup = function(context)
local function publish(bufnr)
bufnr = (bufnr == nil or bufnr == 0) and vim.api.nvim_get_current_buf() or bufnr
if not vim.api.nvim_buf_is_valid(bufnr) then
return
end
if context.is_buffer_eligible(bufnr) then
context.set_marks(bufnr, get_illuminate_marks(bufnr))
else
context.clear_marks(bufnr)
end
end
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorHold", "TextChanged", "BufEnter", "WinEnter" }, {
group = context.create_augroup("illuminate"),
callback = function(args)
publish(args.buf)
if args.event == "CursorMoved" or args.event == "TextChanged" then
vim.defer_fn(function()
publish(args.buf)
end, 250)
end
end,
})
end,
})
require("scrollbar").setup({
excluded_filetypes = { "neo-tree" },
handle = {
highlight = "PmenuSbar",
},
marks = {
Illuminate = { text = "≡", priority = 8, highlight = "Special" },
Search = { highlight = "DiagnosticVirtualTextInfo" },
Error = { highlight = "DiagnosticFloatingError" },
Warn = { highlight = "DiagnosticFloatingWarn" },
Info = { highlight = "DiagnosticFloatingInfo" },
Hint = { highlight = "DiagnosticFloatingHint" },
GitAdd = { highlight = "GitSignsAdd" },
GitChange = { highlight = "GitSignsChange" },
GitDelete = { highlight = "GitSignsDelete" },
},
handlers = {
search = false, -- requires hlslens
diagnostic = true,
gitsigns = true,
},
})