From 98c084dcca2562df242582de1dd18a50405e8e6b Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 5 Apr 2025 11:01:14 +0200 Subject: [PATCH] some changes ported from the main config --- lua/pika/core/keymaps.lua | 37 ++++++++++++++++++++++++++++--------- lua/pika/core/options.lua | 5 +++-- lua/pika/plugins/qol.lua | 31 +++++++------------------------ lua/pika/plugins/ui.lua | 34 +++++++++++++++++++++++++++++----- 4 files changed, 67 insertions(+), 40 deletions(-) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index 57203c8..c48cd1b 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -1,5 +1,7 @@ +-- INFO: Maps leader to 'space' vim.g.mapleader = " " +-- TIP: Unmap keymaps -- ─< lua/keymaps.lua >───────────────────────────────────────────────────────────────── local nomap = vim.keymap.set nomap("i", "", "") @@ -8,17 +10,16 @@ nomap("n", "q", "") nomap("v", "q", "") nomap("v", "S", "") +-- INFO: vim.keymap.set with map() local map = vim.keymap.set map("n", "", "nohlsearch") -- ─< Comment >───────────────────────────────────────────────────────────────────────── +-- INFO: makes instant comments, no plugin needet map("n", "", "gcc", { desc = "comment toggle", remap = true }) map("v", "", "gc", { desc = "comment toggle", remap = true }) --- ─< Terminal >──────────────────────────────────────────────────────────────────────── -map("t", "", "", { desc = "terminal escape terminal mode" }) - -- ─< Movement while in "insert"-mode >───────────────────────────────────────────────── map("i", "", "^i", { desc = "move beginning of line" }) map("i", "", "", { desc = "move end of line" }) @@ -28,10 +29,9 @@ map("i", "", "", { desc = "move down" }) map("i", "", "", { desc = "move up" }) map("n", ";", ":", { desc = "CMD enter command mode" }) -map("i", "jk", "") -map("i", "", "") -map("n", "", "") -map("v", "", "") + +-- CTRL-C for escape +map({ "i", "n", "v" }, "", "") map("n", "x", "bd!") @@ -48,12 +48,31 @@ map("n", "k", "", { desc = "Move focus to the upper window" }) -- map("n", "p", vim.cmd.Ex) map("n", "q", vim.cmd.q) +map("n", "Q", "q!") map("n", "s", vim.cmd.w) map("n", "", vim.cmd.w) --- ─< rename word under cursor >─────────────────────────────────────────────────────────── -map("n", "R", [[:%s/\<\>//gI]]) +-- Visual mode: Indent selected lines +-- INFO: got removed becouse of the mini-move plugin +-- map("v", "", ">gv", { desc = "Indent and keep selection" }) +-- map("v", "", "sv", "v", { desc = "Split window vertically" }) -- split window vertically map("n", "sh", "s", { desc = "Split window horizontally" }) -- split window horizontally + +-- ─< Terminal >──────────────────────────────────────────────────────────────────────── +-- NOTE: This is only for terminal mode +map("t", "", "", { desc = "terminal escape terminal mode" }) + +-- ──────────────────────────────< rename word under cursor >────────────────────────────── +-- map("n", "R", [[:%s/\<\>//gI]]) +-- ───────────────< Enhanced word under cursor renaming in current buffer >──────────── +map({ "n", "x" }, "R", function() + local text = vim.fn.mode() == "n" and vim.fn.expand("") or vim.fn.trim(vim.fn.getreg('"')) + vim.ui.input({ prompt = "Replace: ", default = text }, function(input) + if input and input ~= text then + vim.cmd(("keeppatterns %%s/%s/%s/g"):format(vim.pesc(text), vim.pesc(input))) + end + end) +end, { desc = "Rename in buffer" }) diff --git a/lua/pika/core/options.lua b/lua/pika/core/options.lua index fa3fc11..47fe86c 100644 --- a/lua/pika/core/options.lua +++ b/lua/pika/core/options.lua @@ -53,7 +53,8 @@ o.laststatus = 3 o.swapfile = false -- Disable the tilde on empty lines -o.fillchars = { eob = " " } +-- enable slimline bubble chain ( )----( ) +o.fillchars = { eob = " ", stl = "─" } -- SudaRead automatic if file is inaccessible vim.g.suda_smart_edit = 1 @@ -77,7 +78,7 @@ vim.cmd([[ if vim.g.neovide then -- vim.g.neovide_transparency = 0.35 - vim.g.neovide_transparency = 1 + vim.g.neovide_opacity = 1 vim.g.neovide_theme = "dark" vim.g.neovide_refresh_rate = 90 vim.g.neovide_cursor_vfx_mode = "torpedo" diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua index 2e39595..a423ecc 100644 --- a/lua/pika/plugins/qol.lua +++ b/lua/pika/plugins/qol.lua @@ -138,7 +138,7 @@ return { ), }, - -- ─< INFO: Those comments are really great! >────────────────────────────────────────── + -- ─< ERROR: Those comments are really great! >────────────────────────────────────────── -- ─────────────────────< NOTE: And they can be pretty satisfying... >───────────────────── -- ╭──────────────────────────────────────╮ -- │ WARN: Also they can change in color! │ @@ -148,9 +148,10 @@ return { dependencies = { "nvim-lua/plenary.nvim" }, opts = { keywords = { - NOTE = { icon = " ", color = "hint" }, - INFO = { icon = " ", color = "info" }, - WARNING = { icon = " ", color = "warning", alt = { "WARN" } }, + NOTE = { icon = " ", color = "hint", alt = { "TIP" } }, + INFO = { icon = " ", color = "info", alt = { "INFORMATION" } }, + ERROR = { icon = " ", color = "error", alt = { "ERR" } }, + WARNING = { icon = " ", color = "warning", alt = { "WARN", "WHY" } }, }, }, }, @@ -164,6 +165,7 @@ return { ---Render style ---@usage 'background'|'foreground'|'virtual' render = "background", + -- render = "virtual", ---Set virtual symbol (requires render to be set to 'virtual') virtual_symbol = "■", @@ -200,7 +202,7 @@ return { enable_named_colors = true, ---Highlight tailwind colors, e.g. 'bg-blue-500' - enable_tailwind = false, + enable_tailwind = true, ---Set custom colors ---Label must be properly escaped with '%' to adhere to `string.gmatch` @@ -216,25 +218,6 @@ return { }, }, - -- ╭──────────────────────────────────────╮ - -- │ flash - to navigate more efficiently │ - -- ╰──────────────────────────────────────╯ - { - "folke/flash.nvim", - event = "VeryLazy", - vscode = true, - -- @type Flash.Config - opts = {}, - -- stylua: ignore - keys = { - { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - { "S", 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", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, - { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, - }, - }, - -- ╭──────────────────────────────╮ -- │ renaming (also project wide) │ -- ╰──────────────────────────────╯ diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua index a09c5e6..c03e179 100644 --- a/lua/pika/plugins/ui.lua +++ b/lua/pika/plugins/ui.lua @@ -217,6 +217,7 @@ return { -- vim.notify = require("notify") -- end, -- }, + -- ╭──────────────────────────────╮ -- │ slimline - nice bar for nvim │ -- ╰──────────────────────────────╯ @@ -228,9 +229,37 @@ return { verbose_mode = false, -- Mode as single letter or as a word style = "bg", -- or "fg". Whether highlights should be applied to bg or fg of components mode_follow_style = true, -- Whether the mode color components should follow the style option + spaces = { + components = "─", + left = "─", + right = "─", + }, + configs = { + path = { + hl = { + primary = "Define", + }, + }, + git = { + hl = { + primary = "Function", + }, + }, + diagnostics = { + hl = { + primary = "Statement", + }, + }, + filetype_lsp = { + hl = { + primary = "String", + }, + }, + }, components = { -- Choose components and their location left = { "mode", + "progress", -- "path", -- "git", }, @@ -244,11 +273,6 @@ return { "progress", }, }, - spaces = { - components = " ", -- string between components - left = " ", -- string at the start of the line - right = " ", -- string at the end of the line - }, sep = { hide = { first = false, -- hides the first separator