From 6060e83a166c0c10b3b60a946246f0f65c32ae9f Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Wed, 2 Apr 2025 12:36:01 +0200 Subject: [PATCH] fix: spring cleanup --- after/ftplugin/qf.lua | 5 - lazy-lock.json | 6 +- lua/weeheavy/plugins/theme/tokyonight.lua | 124 +++++++++++----------- lua/weeheavy/remap.lua | 36 ++----- 4 files changed, 71 insertions(+), 100 deletions(-) delete mode 100644 after/ftplugin/qf.lua diff --git a/after/ftplugin/qf.lua b/after/ftplugin/qf.lua deleted file mode 100644 index d8d62f0..0000000 --- a/after/ftplugin/qf.lua +++ /dev/null @@ -1,5 +0,0 @@ --- Disable column width indicators in quickfix/Trouble windows --- vim.opt.colorcolumn = "" -vim.opt.colorcolumn = "" -vim.opt_local.colorcolumn = "" -vim.wo.colorcolumn = "0" diff --git a/lazy-lock.json b/lazy-lock.json index 2e38162..8bb6cec 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,6 +1,6 @@ { - "auto-dark-mode.nvim": { "branch": "master", "commit": "c31de126963ffe9403901b4b0990dde0e6999cc6" }, "blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" }, + "ccc.nvim": { "branch": "main", "commit": "9abb22d5d47460852a935129b4feff39fd8033e3" }, "conform.nvim": { "branch": "master", "commit": "a6f5bdb78caa305496357d17e962bbc4c0b392e2" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" }, @@ -9,10 +9,10 @@ "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "mini.nvim": { "branch": "main", "commit": "d0464ced00abfd9bbed196fa36ccf3b1691c6b2c" }, + "mini.nvim": { "branch": "main", "commit": "687fa868d869078194c02065628712982d971fd6" }, "newpaper.nvim": { "branch": "main", "commit": "d8f2a29001f795a59e4f28713427c200c15449ea" }, "nvim-lint": { "branch": "master", "commit": "93b8040115c9114dac1047311763bef275e752dc" }, - "nvim-treesitter": { "branch": "master", "commit": "9be6836ebeb88a536055bf1ce0961eef68da4bc6" }, + "nvim-treesitter": { "branch": "master", "commit": "30654ee72a69e7c76a54b66d748dae088429e863" }, "nvim-treesitter-context": { "branch": "master", "commit": "93b29a32d5f4be10e39226c6b796f28d68a8b483" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, diff --git a/lua/weeheavy/plugins/theme/tokyonight.lua b/lua/weeheavy/plugins/theme/tokyonight.lua index e7af43a..313ee98 100644 --- a/lua/weeheavy/plugins/theme/tokyonight.lua +++ b/lua/weeheavy/plugins/theme/tokyonight.lua @@ -1,65 +1,65 @@ return { - "folke/tokyonight.nvim", - tag = "stable", - lazy = false, - enabled = true, - priority = 1000, - opts = {}, - config = function() - local tokyonight = require("tokyonight") - local util = require("tokyonight.util") - tokyonight.setup({ - styles = { - -- See :help nvim_set_hl - comments = { italic = true }, - --functions = { underdotted = true }, - }, - on_colors = function(colors) - -- Brighten up comments a bit - colors.comment = "#888fac" - -- Better visible visual selection background color - --colors.bg_visual = "#e82a86" - --colors.bg_visual = colors.teal - end, - on_highlights = function(hl, c) - -- Brighter line numbers - hl.LineNr = { - fg = util.darken(c.dark5, 0.6), - } - --hl.ColorColumn = { - -- bg = c.purple, - --} + "folke/tokyonight.nvim", + tag = "stable", + lazy = false, + enabled = false, + priority = 1000, + opts = {}, + config = function() + local tokyonight = require("tokyonight") + local util = require("tokyonight.util") + tokyonight.setup({ + styles = { + -- See :help nvim_set_hl + comments = { italic = true }, + --functions = { underdotted = true }, + }, + on_colors = function(colors) + -- Brighten up comments a bit + colors.comment = "#888fac" + -- Better visible visual selection background color + --colors.bg_visual = "#e82a86" + --colors.bg_visual = colors.teal + end, + on_highlights = function(hl, c) + -- Brighter line numbers + hl.LineNr = { + fg = util.darken(c.dark5, 0.6), + } + --hl.ColorColumn = { + -- bg = c.purple, + --} - -- Remove borders from Telescope windows - local prompt = "#2d3149" - hl.TelescopeNormal = { - bg = c.bg_dark, - fg = c.fg_dark, - } - hl.TelescopeBorder = { - bg = c.bg_dark, - fg = c.bg_dark, - } - hl.TelescopePromptNormal = { - bg = prompt, - } - hl.TelescopePromptBorder = { - bg = prompt, - fg = prompt, - } - hl.TelescopePromptTitle = { - bg = prompt, - fg = prompt, - } - hl.TelescopePreviewTitle = { - bg = c.bg_dark, - fg = c.bg_dark, - } - hl.TelescopeResultsTitle = { - bg = c.bg_dark, - fg = c.bg_dark, - } - end, - }) - end, + -- Remove borders from Telescope windows + local prompt = "#2d3149" + hl.TelescopeNormal = { + bg = c.bg_dark, + fg = c.fg_dark, + } + hl.TelescopeBorder = { + bg = c.bg_dark, + fg = c.bg_dark, + } + hl.TelescopePromptNormal = { + bg = prompt, + } + hl.TelescopePromptBorder = { + bg = prompt, + fg = prompt, + } + hl.TelescopePromptTitle = { + bg = prompt, + fg = prompt, + } + hl.TelescopePreviewTitle = { + bg = c.bg_dark, + fg = c.bg_dark, + } + hl.TelescopeResultsTitle = { + bg = c.bg_dark, + fg = c.bg_dark, + } + end, + }) + end, } diff --git a/lua/weeheavy/remap.lua b/lua/weeheavy/remap.lua index cc094d1..bb7bbcd 100644 --- a/lua/weeheavy/remap.lua +++ b/lua/weeheavy/remap.lua @@ -1,11 +1,8 @@ -- keyboard shortcuts --- Leader key set to space, base for any key combo --- vim.g.mapleader = " " +-- Leader key. Base for any key combo vim.g.mapleader = ";" ---vim.keymap.set("n", "r", vim.cmd.Ex, { noremap = true, desc = "netrw File Browser" }) -- netrw file explorer ---vim.keymap.set("n", "e", "lua require('oil').toggle_float('.')", { noremap = true, silent = true }) vim.keymap.set("n", "e", ":Oil --float", { desc = "Oil" }) -- List recently opened files @@ -20,7 +17,7 @@ vim.keymap.set( ) -- Live find string (using ripgrep) -vim.keymap.set("n", "fg", ":Telescope live_grep", { noremap = true, desc = "Search string" }) +vim.keymap.set("n", "fg", ":Telescope live_grep", { noremap = true, desc = "String search" }) -- Find string under cursor (using ripgrep) vim.keymap.set( @@ -29,18 +26,10 @@ vim.keymap.set( ":Telescope grep_string", { noremap = true, desc = "Search text under cursor in cwd/grep search string" } ) --- Find string under cursor ---vim.keymap.set( --- "n", --- "fs", --- [[lua require('telescope.builtin').grep_string()]], --- { silent = true, noremap = true } ---) vim.keymap.set("n", "", ":Telescope buffers", { noremap = true, desc = "Show open buffers" }) -- todo-comments.nvim vim.keymap.set("n", "ft", ":TodoTelescope", { noremap = true, desc = "Find TODOs" }) ---vim.keymap.set("n", "gs", ":Telescope git_status", { noremap = true, desc = "Git status" }) vim.keymap.set( "n", "gla", @@ -48,15 +37,12 @@ vim.keymap.set( { noremap = true, desc = "Git log (across all files)" } ) vim.keymap.set("n", "glf", ":Telescope git_bcommits", { noremap = true, desc = "Git log (this file)" }) ---vim.keymap.set("n", "gdp", ":Gitsigns diffthis", { noremap = true, desc = "Git diff previous (this file)" }) ---vim.keymap.set("n", "gd", ":Gitsigns diffthis", { noremap = true, desc = "Git diff previous (this file)" }) vim.keymap.set("n", "gd", function() if next(require("diffview.lib").views) == nil then vim.cmd("DiffviewOpen") else vim.cmd("DiffviewClose") end - --end, { noremap = true, desc = "Diff this shit" }) end, { noremap = true, desc = "Toggle diff/stage UI " }) vim.keymap.set( "n", @@ -72,14 +58,11 @@ vim.keymap.set("n", "b", "B") -- skip punctuation when moving to end of previous --vim.keymap.set("n", "i", "gg=G``", { noremap = true, desc = "Re-indent whole file" }) -- '``' makes it stay at current line+column position --- Thank you @ThePrimeagen for those --- https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua +-- Thanks https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua vim.keymap.set("v", "J", ":m '>+1gv=gv") -- move whole lines/blocks down in visual mode vim.keymap.set("v", "K", ":m '<-2gv=gv") -- move whole lines/blocks up in visual mode - vim.keymap.set("n", "", "zz") -- eye-friendly down scrolling vim.keymap.set("n", "", "zz") -- eye-friendly up scrolling - vim.keymap.set("n", "J", "mzJ`z") -- when merging lines, keep cursor at current position vim.keymap.set( @@ -99,24 +82,21 @@ vim.keymap.set({ "n", "v" }, "o", function() }) end, { desc = "Format file or range (in visual mode)" }) --- Toggle zen-mode.nvim -vim.keymap.set("n", "z", ":ZenMode") - -- Go to next diagnostic item (any severity) vim.keymap.set({ "n", "v" }, "da", function() - vim.diagnostic.goto_next({}) + vim.diagnostic.get_next({}) vim.api.nvim_feedkeys("zz", "n", false) end, { desc = "Go to next diagnostic" }) -- Go to next diagnostic item (error severity) vim.keymap.set({ "n", "v" }, "de", function() - vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR }) + vim.diagnostic.get_next({ severity = vim.diagnostic.severity.ERROR }) vim.api.nvim_feedkeys("zz", "n", false) end, { desc = "Go to next error diagnostic" }) -- Go to next diagnostic item (warning severity) vim.keymap.set({ "n", "v" }, "dw", function() - vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.WARN }) + vim.diagnostic.get_next({ severity = vim.diagnostic.severity.WARN }) vim.api.nvim_feedkeys("zz", "n", false) end, { desc = "Go to next warning diagnostic" }) @@ -125,10 +105,6 @@ vim.keymap.set({ "n", "v" }, "dd", function() vim.diagnostic.enable(not vim.diagnostic.is_enabled()) end, { desc = "Turn diagnostics on/off" }) --- Toggle trouble (for document) ---vim.keymap.set("n", "qq", ":TroubleToggle") ---vim.keymap.set("n", "qq", "Trouble diagnostics toggle") - -- By default, show virtual_text and hide virtual_lines. -- This keymap allows to do the opposite. Can be useful when there are multiple -- severities on the same line