nvim tweaks

This commit is contained in:
Henrik Bakken
2025-04-02 22:40:52 +02:00
parent e82050f672
commit 49a7988045
+20 -29
View File
@@ -339,11 +339,6 @@ local function makespecs_themes()
end, end,
}, },
"morhetz/gruvbox", "morhetz/gruvbox",
{
"sonph/onehalf",
lazy = false,
config = function(plugin) vim.opt.rtp:append(plugin.dir .. "/vim") end,
},
{ {
"catppuccin/nvim", "catppuccin/nvim",
lazy = false, lazy = false,
@@ -387,6 +382,18 @@ local function makespec_lspconfig()
}, },
}, },
}) })
lspconfig.clangd.setup({
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=llvm",
},
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
})
lspconfig.html.setup({ lspconfig.html.setup({
cmd = { "vscode-html-language-server", "--stdio" }, cmd = { "vscode-html-language-server", "--stdio" },
settings = { settings = {
@@ -839,10 +846,6 @@ local function makespec_whichkey()
desc = "Window Hydra Mode (which-key)", desc = "Window Hydra Mode (which-key)",
}, },
}, },
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
end,
} }
end end
@@ -945,6 +948,7 @@ local function makespec_snacks()
{ "<leader>su", function() Snacks.picker.undo() end, desc = "Undo History" }, { "<leader>su", function() Snacks.picker.undo() end, desc = "Undo History" },
}, },
init = function() init = function()
-- stylua: ignore
vim.api.nvim_create_autocmd("User", { vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy", pattern = "VeryLazy",
callback = function() callback = function()
@@ -954,12 +958,8 @@ local function makespec_snacks()
vim.print = _G.dd -- Override print to use snacks for `:=` command vim.print = _G.dd -- Override print to use snacks for `:=` command
Snacks.toggle.indent():map("<leader>u<tab>") Snacks.toggle.indent():map("<leader>u<tab>")
Snacks.toggle Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map("<leader>ub")
.option("background", { off = "light", on = "dark", name = "Dark Background" }) Snacks.toggle.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }):map("<leader>uc")
:map("<leader>ub")
Snacks.toggle
.option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 })
:map("<leader>uc")
Snacks.toggle.diagnostics():map("<leader>ud") Snacks.toggle.diagnostics():map("<leader>ud")
Snacks.toggle.dim():map("<leader>uD") Snacks.toggle.dim():map("<leader>uD")
Snacks.toggle.inlay_hints():map("<leader>ui") Snacks.toggle.inlay_hints():map("<leader>ui")
@@ -1108,21 +1108,12 @@ local function makespec_flash()
return { return {
"folke/flash.nvim", "folke/flash.nvim",
opts = {}, opts = {},
-- stylua: ignore
keys = { keys = {
{ "<cr>", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, { "<cr>", mode = { "n", "o", "x" }, function() require("flash").jump() end, desc = "Flash" },
{ { "<M-cr>", mode = { "n", "o", "x" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
"<M-cr>",
mode = { "n", "o", "x" },
function() require("flash").treesitter() end,
desc = "Flash Treesitter",
},
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
"R",
mode = { "o", "x" },
function() require("flash").treesitter_search() end,
desc = "Treesitter Search",
},
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, { "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
}, },
} }
@@ -1176,7 +1167,7 @@ local function makespec_treesitter()
-- incremental_selection done by flash plugin -- incremental_selection done by flash plugin
}, },
}, },
config = function() vim.opt.foldexpr = "nvim_treesitter#foldexpr()" end, init = function() vim.opt.foldexpr = "nvim_treesitter#foldexpr()" end,
} }
end end