nvim tweaks (gemini)

This commit is contained in:
Henrik Bakken
2026-03-11 02:32:01 +01:00
parent 2d1994a042
commit 63f288c103
+23 -49
View File
@@ -86,7 +86,6 @@ vim.o.termguicolors = true
vim.o.number = true vim.o.number = true
vim.o.relativenumber = true vim.o.relativenumber = true
vim.opt.termguicolors = true
vim.diagnostic.config({ vim.diagnostic.config({
severity_sort = true, severity_sort = true,
underline = true, underline = true,
@@ -99,7 +98,7 @@ vim.diagnostic.config({
}, },
signs = false, signs = false,
virtual_lines = { virtual_lines = {
current_line = true, only_current_line = true,
spacing = vim.o.shiftwidth, spacing = vim.o.shiftwidth,
severity = { min = vim.diagnostic.severity.ERROR }, severity = { min = vim.diagnostic.severity.ERROR },
}, },
@@ -165,10 +164,6 @@ map("v", ">", ">gv")
map("v", "<Tab>", ">gv") map("v", "<Tab>", ">gv")
map("v", "<S-Tab>", "<gv") map("v", "<S-Tab>", "<gv")
-- commenting
map("n", "gco", "o<esc>Vcx<esc><cmd>normal gcc<cr>fxa<bs>", { desc = "Add Comment Below" })
map("n", "gcO", "O<esc>Vcx<esc><cmd>normal gcc<cr>fxa<bs>", { desc = "Add Comment Above" })
-- new file -- new file
map("n", "<leader>n", "<cmd>enew<cr>", { desc = "New File" }) map("n", "<leader>n", "<cmd>enew<cr>", { desc = "New File" })
@@ -545,9 +540,7 @@ local function makespec_hexokinase()
return { return {
-- coloring of colornames -- coloring of colornames
"rrethy/vim-hexokinase", "rrethy/vim-hexokinase",
build = function(plugin) build = function(plugin) vim.system({ "make", "hexokinase" }, { cwd = plugin.dir }):wait() end,
vim.system({ "make", "hexokinase" }, { cwd = plugin.dir }):wait()
end,
config = function() vim.g.Hexokinase_highlighters = { "virtual" } end, config = function() vim.g.Hexokinase_highlighters = { "virtual" } end,
} }
end end
@@ -743,7 +736,7 @@ local function makespecs_previewers()
return { return {
{ {
"chomosuke/typst-preview.nvim", "chomosuke/typst-preview.nvim",
lazy = false, -- or ft = 'typst' lazy = false,
version = "1.*", version = "1.*",
opts = { opts = {
-- debug = true, -- debug = true,
@@ -1059,12 +1052,7 @@ local function makespec_snacks()
image = { enabled = true }, image = { enabled = true },
indent = { enabled = true }, indent = { enabled = true },
lazygit = { enabled = vim.fn.has("lazygit") == 1 }, lazygit = { enabled = vim.fn.has("lazygit") == 1 },
notifier = { notifier = { enabled = true, style = "minimal", refresh = 500, top_down = false },
enabled = true,
style = "minimal",
refresh = 500,
top_down = false,
},
---@class snacks.picker ---@class snacks.picker
picker = { picker = {
formatters = { file = { filename_first = true } }, formatters = { file = { filename_first = true } },
@@ -1084,12 +1072,7 @@ local function makespec_snacks()
}, },
}, },
toggle = { enabled = true }, toggle = { enabled = true },
styles = { styles = { lazygit = { width = 0, height = 0 } },
lazygit = {
width = 0,
height = 0,
},
},
}, },
-- stylua: ignore -- stylua: ignore
keys = { keys = {
@@ -1235,15 +1218,15 @@ local function makespec_smartsplits()
lazy = false, lazy = false,
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{ "<M-h>", function() require("smart-splits").move_cursor_left() end, { desc = "Go to Left Window", remap = true } }, { "<M-h>", function() require("smart-splits").move_cursor_left() end, desc = "Go to Left Window" },
{ "<M-j>", function() require("smart-splits").move_cursor_down() end, { desc = "Go to Left Window", remap = true } }, { "<M-j>", function() require("smart-splits").move_cursor_down() end, desc = "Go to Lower Window" },
{ "<M-k>", function() require("smart-splits").move_cursor_up() end, { desc = "Go to Left Window", remap = true } }, { "<M-k>", function() require("smart-splits").move_cursor_up() end, desc = "Go to Upper Window" },
{ "<M-l>", function() require("smart-splits").move_cursor_right() end, { desc = "Go to Left Window", remap = true } }, { "<M-l>", function() require("smart-splits").move_cursor_right() end, desc = "Go to Right Window" },
{ "<M-\\>", function() require("smart-splits").move_cursor_previous() end, { desc = "Go to Previous Window", remap = true } }, { "<M-\\>", function() require("smart-splits").move_cursor_previous() end, desc = "Go to Previous Window" },
{ "<C-h>", function() require("smart-splits").resize_left() end, { desc = "Resize Window Left", remap = true } }, { "<C-h>", function() require("smart-splits").resize_left() end, desc = "Resize Window Left" },
{ "<C-j>", function() require("smart-splits").resize_down() end, { desc = "Resize Window Down", remap = true } }, { "<C-j>", function() require("smart-splits").resize_down() end, desc = "Resize Window Down" },
{ "<C-k>", function() require("smart-splits").resize_up() end, { desc = "Resize Window Up", remap = true } }, { "<C-k>", function() require("smart-splits").resize_up() end, desc = "Resize Window Up" },
{ "<C-l>", function() require("smart-splits").resize_right() end, { desc = "Resize Window Right", remap = true } }, { "<C-l>", function() require("smart-splits").resize_right() end, desc = "Resize Window Right" },
}, },
} }
end end
@@ -1305,7 +1288,7 @@ local function makespec_flash()
exclude = { exclude = {
function(win) function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype return vim.bo[vim.api.nvim_win_get_buf(win)].filetype
~= "snacks_picker_list" == "snacks_picker_list"
end, end,
}, },
}, },
@@ -1381,8 +1364,10 @@ local function makespec_treesitter()
}, },
auto_install = true, auto_install = true,
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true, disable = { "python" } }, indent = {
-- incremental_selection done by flash plugin enable = true,
disable = function(lang, buf) return lang == "python" end,
},
}, },
init = function() vim.opt.foldexpr = "nvim_treesitter#foldexpr()" end, init = function() vim.opt.foldexpr = "nvim_treesitter#foldexpr()" end,
} }
@@ -1461,10 +1446,7 @@ local function makespec_conform()
typst = { "typstyle" }, typst = { "typstyle" },
yaml = { "yamlfmt" }, yaml = { "yamlfmt" },
}, },
default_format_opts = { default_format_opts = { timeout_ms = 3000, lsp_format = "fallback" },
timeout_ms = 3000,
lsp_format = "fallback",
},
formatters = { formatters = {
javascript = { require_cwd = true }, javascript = { require_cwd = true },
stylua = { append_args = { "--indent-type", "Spaces", "--collapse-simple-statement", "Always" } }, stylua = { append_args = { "--indent-type", "Spaces", "--collapse-simple-statement", "Always" } },
@@ -1493,17 +1475,12 @@ local function makespec_avante()
providers = { providers = {
openai = { openai = {
model = "gpt-4.1", model = "gpt-4.1",
extra_request_body = { extra_request_body = { temperature = 0 },
temperature = 0,
},
max_tokens = 4096, max_tokens = 4096,
}, },
gemini = { gemini = {
model = "gemini-2.5-flash", model = "gemini-2.5-flash",
extra_request_body = { extra_request_body = { temperature = 0, max_tokens = 4096 },
temperature = 0,
max_tokens = 4096,
},
}, },
}, },
ignore_patterns = { ignore_patterns = {
@@ -1573,10 +1550,7 @@ local function makespec_noice()
}, },
signature = { enabled = true, auto_open = { enabled = false, throttle = 50 } }, signature = { enabled = true, auto_open = { enabled = false, throttle = 50 } },
}, },
presets = { presets = { command_palette = true, long_message_to_split = true },
command_palette = true,
long_message_to_split = true,
},
routes = { routes = {
{ filter = { event = "msg_show", kind = "search_count" }, opts = { skip = true } }, { filter = { event = "msg_show", kind = "search_count" }, opts = { skip = true } },
{ filter = { kind = "", min_height = 2 }, view = "split" }, { filter = { kind = "", min_height = 2 }, view = "split" },