Update nvim
This commit is contained in:
1 parent
1349e3b76f
commit
f207707bc9
11 files changed
+115
-214
No files matched your search
@@ -1,22 +0,0 @@
|
|||||||
return {
|
|
||||||
cmd = { "clangd" },
|
|
||||||
filetypes = {
|
|
||||||
"c", "cpp", "objc", "objcpp",
|
|
||||||
"cuda", "proto",
|
|
||||||
},
|
|
||||||
root_markers = {
|
|
||||||
".clangd",
|
|
||||||
".clang-tidy",
|
|
||||||
".clang-format",
|
|
||||||
"compile_commands.json",
|
|
||||||
"compile_flags.txt",
|
|
||||||
"configure.ac",
|
|
||||||
"configure",
|
|
||||||
"config.h",
|
|
||||||
"Makefile",
|
|
||||||
".git",
|
|
||||||
},
|
|
||||||
capabilities = {
|
|
||||||
offsetEncoding = { "utf-16" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
return {
|
|
||||||
cmd = { "lua-language-server" },
|
|
||||||
filetypes = { "lua" },
|
|
||||||
root_markers = {
|
|
||||||
".luarc.json", ".luarc.jsonc", ".luacheckrc",
|
|
||||||
".stylua.toml", "stylua.toml", "selene.toml",
|
|
||||||
"selene.yml", ".git"
|
|
||||||
},
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
runtime = { version = "LuaJIT" }, -- Neovim uses LuaJIT
|
|
||||||
diagnostics = { globals = { "vim" } }, -- Recognize 'vim' global
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
return {
|
|
||||||
cmd = { "ols" },
|
|
||||||
filetypes = { "odin" },
|
|
||||||
root_markers = { "ols.json", ".git" },
|
|
||||||
}
|
|
||||||
@@ -119,15 +119,8 @@ map("i", ",", ",<c-g>u")
|
|||||||
map("i", ".", ".<c-g>u")
|
map("i", ".", ".<c-g>u")
|
||||||
map("i", ";", ";<c-g>u")
|
map("i", ";", ";<c-g>u")
|
||||||
|
|
||||||
-- Auto-close pairs (simple, no plugin needed)
|
-- Auto-close pairs handled by mini.pairs (lua/plugins/mini-pairs.lua)
|
||||||
map("i", "`", "``<left>")
|
-- Note: Single quotes are handled by mini.pairs (no pair inserted after a letter)
|
||||||
map("i", '"', '""<left>')
|
|
||||||
map("i", "(", "()<left>")
|
|
||||||
map("i", "[", "[]<left>")
|
|
||||||
map("i", "{", "{}<left>")
|
|
||||||
map("i", "<", "<><left>")
|
|
||||||
-- Note: Single quotes commented out to avoid conflicts in some contexts
|
|
||||||
-- map("i", "'", "''<left>")
|
|
||||||
|
|
||||||
-- ═══════════════════════════════════════════════════════════
|
-- ═══════════════════════════════════════════════════════════
|
||||||
-- FILE OPERATIONS
|
-- FILE OPERATIONS
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ local default_keymaps = {
|
|||||||
{ keys = "<leader>k", func = vim.lsp.buf.hover, desc = "Hover Documentation", has = "hoverProvider" },
|
{ keys = "<leader>k", func = vim.lsp.buf.hover, desc = "Hover Documentation", has = "hoverProvider" },
|
||||||
{ keys = "K", func = vim.lsp.buf.hover, desc = "Hover (alt)", has = "hoverProvider" },
|
{ keys = "K", func = vim.lsp.buf.hover, desc = "Hover (alt)", has = "hoverProvider" },
|
||||||
{ keys = "gd", func = vim.lsp.buf.definition, desc = "Goto Definition", has = "definitionProvider" },
|
{ keys = "gd", func = vim.lsp.buf.definition, desc = "Goto Definition", has = "definitionProvider" },
|
||||||
|
{ keys = "gD", func = vim.lsp.buf.declaration, desc = "Goto Declaration", has = "declarationProvider" },
|
||||||
|
{ keys = "gi", func = vim.lsp.buf.implementation, desc = "Goto Implementation", has = "implementationProvider" },
|
||||||
|
{ keys = "gr", func = vim.lsp.buf.references, desc = "References", has = "referencesProvider" },
|
||||||
|
{ keys = "gy", func = vim.lsp.buf.type_definition, desc = "Goto Type Definition", has = "typeDefinitionProvider" },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- I use blink.cmp for completion, but you can use native completion too
|
-- I use blink.cmp for completion, but you can use native completion too
|
||||||
|
|||||||
@@ -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,
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -13,7 +13,10 @@ local providers = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
require("blink.cmp").setup({
|
require("blink.cmp").setup({
|
||||||
keymap = { preset = "super-tab" },
|
keymap = {
|
||||||
|
preset = "super-tab",
|
||||||
|
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
|
||||||
|
},
|
||||||
appearance = {
|
appearance = {
|
||||||
nerd_font_variant = "mono",
|
nerd_font_variant = "mono",
|
||||||
use_nvim_cmp_as_default = true,
|
use_nvim_cmp_as_default = true,
|
||||||
@@ -22,6 +25,7 @@ require("blink.cmp").setup({
|
|||||||
documentation = { auto_show = false },
|
documentation = { auto_show = false },
|
||||||
trigger = { prefetch_on_insert = false },
|
trigger = { prefetch_on_insert = false },
|
||||||
},
|
},
|
||||||
|
signature = { enabled = true },
|
||||||
-- cmdline and / search are handled by wilder.nvim
|
-- cmdline and / search are handled by wilder.nvim
|
||||||
cmdline = { enabled = false },
|
cmdline = { enabled = false },
|
||||||
sources = {
|
sources = {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ vim.api.nvim_create_autocmd("PackChanged", {
|
|||||||
|
|
||||||
require("plugins.theme")
|
require("plugins.theme")
|
||||||
require("plugins.mini-icons")
|
require("plugins.mini-icons")
|
||||||
|
require("plugins.mini-pairs")
|
||||||
require("plugins.illuminate")
|
require("plugins.illuminate")
|
||||||
require("plugins.treesitter")
|
require("plugins.treesitter")
|
||||||
require("plugins.blink")
|
require("plugins.blink")
|
||||||
@@ -27,6 +28,7 @@ require("plugins.bufferline")
|
|||||||
require("plugins.telescope")
|
require("plugins.telescope")
|
||||||
require("plugins.wilder")
|
require("plugins.wilder")
|
||||||
require("plugins.neotree")
|
require("plugins.neotree")
|
||||||
|
require("plugins.auto-session")
|
||||||
require("plugins.conform")
|
require("plugins.conform")
|
||||||
require("plugins.dap")
|
require("plugins.dap")
|
||||||
require("plugins.git")
|
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({})
|
||||||
@@ -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({
|
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
|
require("scrollbar").setup({
|
||||||
-- autocmds (BufWinEnter/WinEnter/TextChanged/VimResized/WinScrolled) do not fire
|
exclude = {
|
||||||
-- on CursorMoved, which is when illuminate refreshes its references, so hook
|
filetypes = { ["neo-tree"] = true },
|
||||||
-- 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
|
|
||||||
|
|
||||||
local function update_illuminate_marks()
|
-- Search marks are native in v2 (no hlslens dependency like v1).
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
providers = {
|
||||||
local config = require("scrollbar.config").get()
|
search = true,
|
||||||
if
|
gitsigns = true,
|
||||||
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
|
|
||||||
|
|
||||||
|
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")
|
local ok, reference = pcall(require, "illuminate.reference")
|
||||||
if not ok then
|
if not ok then
|
||||||
return
|
return {}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- illuminate stores refs as { {0-indexed line, col}, {0-indexed line, col} },
|
-- illuminate stores refs as { {0-indexed line, col}, {0-indexed line, col} },
|
||||||
@@ -40,47 +64,43 @@ local function update_illuminate_marks()
|
|||||||
line = line,
|
line = line,
|
||||||
text = "≡",
|
text = "≡",
|
||||||
type = "Illuminate",
|
type = "Illuminate",
|
||||||
level = 1,
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return illuminate_marks
|
||||||
local marks = utils.get_scrollbar_marks(bufnr)
|
|
||||||
marks.Illuminate = illuminate_marks
|
|
||||||
utils.set_scrollbar_marks(bufnr, marks)
|
|
||||||
|
|
||||||
render()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorHold", "TextChanged", "BufEnter", "WinEnter" }, {
|
require("scrollbar.providers").register({
|
||||||
group = vim.api.nvim_create_augroup("scrollbar_illuminate", { clear = true }),
|
name = "illuminate",
|
||||||
callback = function(args)
|
refresh_owner = { buffer = "provider" },
|
||||||
update_illuminate_marks()
|
|
||||||
if args.event == "CursorMoved" or args.event == "TextChanged" then
|
refresh = function(bufnr)
|
||||||
vim.defer_fn(update_illuminate_marks, 250)
|
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
|
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,
|
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,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
{
|
|
||||||
"plugins": {
|
|
||||||
"blink.cmp": {
|
|
||||||
"rev": "78336bc89ee5365633bcf754d93df01678b5c08f",
|
|
||||||
"src": "https://github.com/saghen/blink.cmp",
|
|
||||||
"version": "1.0.0 - 2.0.0"
|
|
||||||
},
|
|
||||||
"bufferline.nvim": {
|
|
||||||
"rev": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3",
|
|
||||||
"src": "https://github.com/akinsho/bufferline.nvim",
|
|
||||||
"version": "4.0.0 - 5.0.0"
|
|
||||||
},
|
|
||||||
"catppuccin": {
|
|
||||||
"rev": "edefef779ab08ce1a4a404713e3012b0d202bd35",
|
|
||||||
"src": "https://github.com/catppuccin/nvim"
|
|
||||||
},
|
|
||||||
"conform.nvim": {
|
|
||||||
"rev": "016802de402556da54c36bd7359b441266b01cdd",
|
|
||||||
"src": "https://github.com/stevearc/conform.nvim"
|
|
||||||
},
|
|
||||||
"diffview.nvim": {
|
|
||||||
"rev": "4516612fe98ff56ae0415a259ff6361a89419b0a",
|
|
||||||
"src": "https://github.com/sindrets/diffview.nvim"
|
|
||||||
},
|
|
||||||
"gitsigns.nvim": {
|
|
||||||
"rev": "851a051e2bd2caba97e23314c68d69f1b1cf5d19",
|
|
||||||
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
|
||||||
},
|
|
||||||
"log-highlight.nvim": {
|
|
||||||
"rev": "b2e00cfd41ca94338265a595f3f3f423d9f9322e",
|
|
||||||
"src": "https://github.com/fei6409/log-highlight.nvim"
|
|
||||||
},
|
|
||||||
"lualine.nvim": {
|
|
||||||
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
|
|
||||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
|
||||||
},
|
|
||||||
"mini.nvim": {
|
|
||||||
"rev": "1345d191bb3da9c7b0e977f4387c5761f9bff68d",
|
|
||||||
"src": "https://github.com/nvim-mini/mini.nvim",
|
|
||||||
"version": "0.18.0 - 0.19.0"
|
|
||||||
},
|
|
||||||
"neo-tree.nvim": {
|
|
||||||
"rev": "f3f3bf73414e400cf9fc13fda50f00404a8f8ab1",
|
|
||||||
"src": "https://github.com/nvim-neo-tree/neo-tree.nvim",
|
|
||||||
"version": "3.0.0 - 4.0.0"
|
|
||||||
},
|
|
||||||
"nui.nvim": {
|
|
||||||
"rev": "10fc361835c856ba4233ef5ea135b919bf3dce97",
|
|
||||||
"src": "https://github.com/MunifTanjim/nui.nvim"
|
|
||||||
},
|
|
||||||
"nvim-dap": {
|
|
||||||
"rev": "cfa2d58f4537aca6ca83e2de1a0d9f1491121264",
|
|
||||||
"src": "https://github.com/mfussenegger/nvim-dap"
|
|
||||||
},
|
|
||||||
"nvim-dap-ui": {
|
|
||||||
"rev": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43",
|
|
||||||
"src": "https://github.com/rcarriga/nvim-dap-ui"
|
|
||||||
},
|
|
||||||
"nvim-nio": {
|
|
||||||
"rev": "edcc181a875301dd21840189aa2f2f9ad69fc172",
|
|
||||||
"src": "https://github.com/nvim-neotest/nvim-nio"
|
|
||||||
},
|
|
||||||
"nvim-treesitter": {
|
|
||||||
"rev": "e289100ff98969e118c702199d88b764ce9e7fdf",
|
|
||||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
|
||||||
},
|
|
||||||
"nvim-treesitter-textobjects": {
|
|
||||||
"rev": "5c7b0263797dfd1bd6202f2b219f3b53a80b2187",
|
|
||||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects",
|
|
||||||
"version": "'main'"
|
|
||||||
},
|
|
||||||
"nvim-web-devicons": {
|
|
||||||
"rev": "58447c1fca354bbf184425e4a8d01deecbd6f3c4",
|
|
||||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
|
||||||
},
|
|
||||||
"plenary.nvim": {
|
|
||||||
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
|
|
||||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
|
||||||
},
|
|
||||||
"render-markdown.nvim": {
|
|
||||||
"rev": "640a3ec6d538bad17c328be373c7cad0293d9589",
|
|
||||||
"src": "https://github.com/MeanderingProgrammer/render-markdown.nvim"
|
|
||||||
},
|
|
||||||
"telescope-fzf-native.nvim": {
|
|
||||||
"rev": "b25b749b9db64d375d782094e2b9dce53ad53a40",
|
|
||||||
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
|
||||||
},
|
|
||||||
"telescope.nvim": {
|
|
||||||
"rev": "40aedd8a68c78a656a10a8d62d80c54af59420fb",
|
|
||||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
|
||||||
},
|
|
||||||
"vim-illuminate": {
|
|
||||||
"rev": "1cc33d347c574c3bd21a4852fc9ffed677c1c58c",
|
|
||||||
"src": "https://github.com/RRethy/vim-illuminate"
|
|
||||||
},
|
|
||||||
"which-key.nvim": {
|
|
||||||
"rev": "3aab2147e74890957785941f0c1ad87d0a44c15a",
|
|
||||||
"src": "https://github.com/folke/which-key.nvim"
|
|
||||||
},
|
|
||||||
"zig.vim": {
|
|
||||||
"rev": "4842ab8cb1b000a9acb0a06170d404d12a154918",
|
|
||||||
"src": "https://codeberg.org/ziglang/zig.vim"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user