nvim updates

This commit is contained in:
Henrik Bakken
2026-10-06 23:07:02 +02:00
parent 1687bc25d1
commit 7ba1342f8a
2 changed files with 62 additions and 20 deletions
+61 -20
View File
@@ -1,4 +1,4 @@
vim.g.mapleader = vim.keycode("<space>") vim.g.mapleader = vim.keycode(" ")
vim.g.maplocalleader = vim.keycode("/") vim.g.maplocalleader = vim.keycode("/")
vim.opt.langmap = "ø:" vim.opt.langmap = "ø:"
@@ -108,7 +108,7 @@ vim.diagnostic.config({
float = { source = true }, float = { source = true },
}) })
vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd("FileType", {
desc = "Disable auto-commenting on new line", desc = "Disable auto-commenting on new line",
pattern = "*", pattern = "*",
callback = function() vim.opt_local.formatoptions:remove({ "r", "o" }) end, callback = function() vim.opt_local.formatoptions:remove({ "r", "o" }) end,
@@ -153,8 +153,8 @@ map("i", ".", ".<c-g>u")
map("i", ";", ";<c-g>u") map("i", ";", ";<c-g>u")
-- save file -- save file
map({ "x", "n", "s" }, "<leader>ww", "<cmd>w<cr><esc>", { desc = "Save File" }) map({ "x", "n", "s" }, "<leader>ww", "<cmd>w<cr>", { desc = "Save File" })
map({ "x", "n", "s" }, "<leader>wa", "<cmd>wa<cr><esc>", { desc = "Save Files" }) map({ "x", "n", "s" }, "<leader>wa", "<cmd>wa<cr>", { desc = "Save Files" })
-- quit -- quit
map("n", "<leader>qq", "<cmd>q<cr>", { desc = "Close Window" }) map("n", "<leader>qq", "<cmd>q<cr>", { desc = "Close Window" })
@@ -1150,7 +1150,17 @@ local function makespecs_mini()
"echasnovski/mini.basics", "echasnovski/mini.basics",
opts = { options = { basic = true, extra_ui = true }, mappings = { move_with_alt = true } }, opts = { options = { basic = true, extra_ui = true }, mappings = { move_with_alt = true } },
}, },
{ "echasnovski/mini.icons", opts = {} }, {
"echasnovski/mini.icons",
opts = {},
init = function()
-- catch nvim-web-devicons
package.preload["nvim-web-devicons"] = function()
require("mini.icons").mock_nvim_web_devicons()
return package.loaded["nvim-web-devicons"]
end
end,
},
{ {
"echasnovski/mini.bracketed", "echasnovski/mini.bracketed",
version = false, version = false,
@@ -1355,9 +1365,10 @@ end
local function makespec_treesitter() local function makespec_treesitter()
return { return {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
branch = "main",
build = ":TSUpdate", build = ":TSUpdate",
lazy = false, lazy = false,
main = "nvim-treesitter.configs", main = "nvim-treesitter.config",
opts = { opts = {
ensure_installed = { ensure_installed = {
"bash", "bash",
@@ -1375,6 +1386,7 @@ local function makespec_treesitter()
"lua", "lua",
"markdown", "markdown",
"markdown_inline", "markdown_inline",
"query", -- for folds
"python", "python",
"regex", "regex",
"toml", "toml",
@@ -1395,6 +1407,41 @@ local function makespec_treesitter()
} }
end end
local function makespec_blink()
return {
"saghen/blink.cmp",
version = false,
event = "InsertEnter",
build = function() require("blink.cmp").build():pwait() end,
dependencies = {
"saghen/blink.lib",
},
opts = {
keymap = { preset = "default" },
completion = {
accept = { auto_brackets = { enabled = false } },
documentation = { auto_show = true },
},
fuzzy = { sorts = { "exact", "score", "sort_text" } },
sources = {
default = { "lsp", "buffer", "path" },
providers = {
lsp = {
-- Strip any completion item that tries to inject an auto-import
transform_items = function(_, items)
return vim.tbl_filter(function(item)
-- If the LSP item includes additionalTextEdits, it's mutating
-- lines outside your cursor (e.g., adding an import at the top)
return not (item.additionalTextEdits and #item.additionalTextEdits > 0)
end, items)
end,
},
},
},
},
}
end
local function makespec_treewalker() local function makespec_treewalker()
return { return {
"aaronik/treewalker.nvim", "aaronik/treewalker.nvim",
@@ -1471,8 +1518,6 @@ end
local function makespec_conform() local function makespec_conform()
return { return {
"stevearc/conform.nvim", "stevearc/conform.nvim",
-- Load conform right before you save a file, or when you trigger a keymap
event = { "BufWritePre" },
cmd = { "ConformInfo" }, cmd = { "ConformInfo" },
keys = { keys = {
{ {
@@ -1510,6 +1555,7 @@ local function makespec_conform()
}, },
default_format_opts = { default_format_opts = {
lsp_format = "fallback", lsp_format = "fallback",
timeout_ms = 1000,
}, },
formatters = { formatters = {
javascript = { require_cwd = true }, javascript = { require_cwd = true },
@@ -1613,7 +1659,6 @@ local function makespec_noice()
override = { override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true, ["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
}, },
signature = { enabled = true, auto_open = { enabled = false, throttle = 50 } }, signature = { enabled = true, auto_open = { enabled = false, throttle = 50 } },
}, },
@@ -1644,13 +1689,17 @@ local lazyspecs = {
{ "ethanholz/nvim-lastplace", opts = {} }, -- keep location upon reopening { "ethanholz/nvim-lastplace", opts = {} }, -- keep location upon reopening
"tpope/vim-eunuch", -- Move, Rename etc "tpope/vim-eunuch", -- Move, Rename etc
"tpope/vim-sleuth", -- do the right thing with tabstop and softtabstop "tpope/vim-sleuth", -- do the right thing with tabstop and softtabstop
} {
for _, spec in ipairs({ "esmuellert/codediff.nvim",
cmd = "CodeDiff",
opts = { diff = { compute_moves = true } },
},
makespec_lazydev(), -- nvim lsp helpers makespec_lazydev(), -- nvim lsp helpers
makespec_snacks(), makespec_snacks(),
makespec_conform(), -- autoformat makespec_conform(), -- autoformat
makespec_lspconfig(), makespec_lspconfig(),
makespec_treesitter(), makespec_treesitter(),
makespec_blink(),
makespec_treewalker(), makespec_treewalker(),
makespec_todocomments(), makespec_todocomments(),
makespec_autotag(), makespec_autotag(),
@@ -1677,18 +1726,10 @@ for _, spec in ipairs({
makespec_fugitive(), makespec_fugitive(),
makespec_diffview(), makespec_diffview(),
makespec_vimflog(), makespec_vimflog(),
}) do
table.insert(lazyspecs, spec)
end
for _, specs in ipairs({
makespecs_themes(), makespecs_themes(),
makespecs_mini(), makespecs_mini(),
makespecs_previewers(), makespecs_previewers(),
}) do }
for _, spec in ipairs(specs) do
table.insert(lazyspecs, spec)
end
end
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
+1
View File
@@ -56,6 +56,7 @@ installmap = dict(
"ripgrep", "ripgrep",
"npm", # required for nvim plugins "npm", # required for nvim plugins
"go", # required for vim-hexokinase build "go", # required for vim-hexokinase build
"tree-sitter-cli", # required for nvim treesitter
), ),
utils=("uv", "ncdu", "unzip", "jq", "bluetui"), utils=("uv", "ncdu", "unzip", "jq", "bluetui"),
gittools=( gittools=(