nvim tweaks

This commit is contained in:
Henrik Bakken
2026-04-09 19:31:03 +02:00
parent 49dae6be39
commit adbe1641ec
+6 -85
View File
@@ -98,7 +98,6 @@ vim.diagnostic.config({
}, },
float = { source = true }, float = { source = true },
}) })
vim.lsp.set_log_level(2)
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
desc = "Disable auto-commenting on new line", desc = "Disable auto-commenting on new line",
@@ -337,48 +336,20 @@ end, { nargs = 1 })
local function makespecs_themes() local function makespecs_themes()
return { return {
{ "aktersnurra/no-clown-fiesta.nvim", opts = { transparent = false } },
"NLKNguyen/papercolor-theme",
"junegunn/seoul256.vim", "junegunn/seoul256.vim",
"mcauley-penney/phobos-anomaly.nvim", "mcauley-penney/phobos-anomaly.nvim",
"folke/tokyonight.nvim", "folke/tokyonight.nvim",
{ "bluz71/vim-moonfly-colors", name = "moonfly", lazy = false },
{ {
"uloco/bluloco.nvim", "uloco/bluloco.nvim",
lazy = false, lazy = false,
dependencies = { "rktjmp/lush.nvim" }, dependencies = { "rktjmp/lush.nvim" },
opts = {}, opts = {},
}, },
{ "sainnhe/gruvbox-material",
"mhartington/oceanic-next", "sainnhe/everforest",
config = function() "sainnhe/edge",
local customthemegroup = vim.api.nvim_create_augroup("customthemegroup", {}) "sainnhe/sonokai",
vim.api.nvim_create_autocmd("ColorScheme", { { "catppuccin/nvim", name = "catppuccin", opts = { auto_integrations = true } },
pattern = { "OceanicNext" },
group = customthemegroup,
callback = function()
vim.api.nvim_set_hl(0, "DiffAdded", { default = false, link = "DiffAdd" })
vim.api.nvim_set_hl(0, "DiffRemoved", { default = false, link = "DiffDelete" })
vim.api.nvim_set_hl(0, "Normal", {})
vim.api.nvim_set_hl(0, "LineNr", {})
vim.api.nvim_set_hl(0, "SignColumn", {})
vim.api.nvim_set_hl(0, "EndOfBuffer", {})
end,
})
end,
},
"morhetz/gruvbox",
{
"catppuccin/nvim",
name = "catppuccin",
-- opts = { integrations = { grug_far = true, mason = true, noice = true, snacks = true, which_key = true } },
},
{
"Shatur/neovim-ayu",
init = function() vim.g.ayu_extended_palette = 1 end,
},
"tomasr/molokai",
"jnurmine/Zenburn",
} }
end end
@@ -557,17 +528,6 @@ local function makespec_smearcursor()
} }
end end
local function makespec_neoscroll()
return {
"karb94/neoscroll.nvim",
event = "VeryLazy",
config = function()
-- Initialize with empty mappings. It is loaded, but completely dormant.
require("neoscroll").setup({ mappings = {} })
end,
}
end
local function makespec_hexokinase() local function makespec_hexokinase()
return { return {
-- coloring of colornames -- coloring of colornames
@@ -1173,44 +1133,6 @@ local function makespec_snacks()
get = function() return require("smear_cursor").enabled end, get = function() return require("smear_cursor").enabled end,
set = function(state) require("smear_cursor").enabled = state end, set = function(state) require("smear_cursor").enabled = state end,
}):map("<leader>uS") }):map("<leader>uS")
-- Toggle for Neoscroll
local ns_keys = {
["<C-u>"] = function() require("neoscroll").ctrl_u({ half_win_duration = 250 }) end,
["<C-d>"] = function() require("neoscroll").ctrl_d({ half_win_duration = 250 }) end,
["<C-b>"] = function() require("neoscroll").ctrl_b({ half_win_duration = 450 }) end,
["<C-f>"] = function() require("neoscroll").ctrl_f({ half_win_duration = 450 }) end,
["<C-y>"] = function()
require("neoscroll").scroll(-0.1, { move_cursor = false, duration = 100 })
end,
["<C-e>"] = function()
require("neoscroll").scroll(0.1, { move_cursor = false, duration = 100 })
end,
["zt"] = function() require("neoscroll").zt({ half_win_duration = 250 }) end,
["zz"] = function() require("neoscroll").zz({ half_win_duration = 250 }) end,
["zb"] = function() require("neoscroll").zb({ half_win_duration = 250 }) end,
}
vim.g.neoscroll_enabled = false
Snacks.toggle({
name = "Smooth Scroll",
get = function() return vim.g.neoscroll_enabled end,
set = function(state)
vim.g.neoscroll_enabled = state
if state then
-- Turn ON: Map the keys to Neoscroll's functions
for key, func in pairs(ns_keys) do
vim.keymap.set({ "n", "v", "x" }, key, func, { desc = "Smooth Scroll " .. key })
end
else
-- Turn OFF: Delete the maps, returning Neovim to default scrolling
for key, _ in pairs(ns_keys) do
pcall(vim.keymap.del, { "n", "v", "x" }, key)
end
end
end,
}):map("<leader>uN")
end, end,
}) })
end, end,
@@ -1752,7 +1674,6 @@ for _, spec in ipairs({
makespec_flash(), makespec_flash(),
makespec_grugfar(), makespec_grugfar(),
-- visuals -- visuals
makespec_neoscroll(),
makespec_smearcursor(), makespec_smearcursor(),
makespec_hexokinase(), makespec_hexokinase(),
makespec_lualine(), makespec_lualine(),
@@ -1793,4 +1714,4 @@ require("lazy").setup({
spec = lazyspecs, spec = lazyspecs,
checker = { enabled = true }, checker = { enabled = true },
}) })
vim.cmd("colorscheme bluloco-dark") vim.cmd("colorscheme catppuccin-nvim")