some plugin changes and visual optimisations

This commit is contained in:
pika 2025-04-05 10:51:29 +02:00
parent 89322b376a
commit 741556792b
8 changed files with 143 additions and 77 deletions

View file

@ -1,5 +1,7 @@
-- INFO: Maps leader to 'space'
vim.g.mapleader = " " vim.g.mapleader = " "
-- TIP: Unmap keymaps
-- ─< lua/keymaps.lua >───────────────────────────────────────────────────────────────── -- ─< lua/keymaps.lua >─────────────────────────────────────────────────────────────────
local nomap = vim.keymap.set local nomap = vim.keymap.set
nomap("i", "<C-k>", "") nomap("i", "<C-k>", "")
@ -8,17 +10,16 @@ nomap("n", "q", "")
nomap("v", "q", "") nomap("v", "q", "")
nomap("v", "<leader>S", "") nomap("v", "<leader>S", "")
-- INFO: vim.keymap.set with map()
local map = vim.keymap.set local map = vim.keymap.set
map("n", "<Esc>", "<cmd>nohlsearch<CR>") map("n", "<Esc>", "<cmd>nohlsearch<CR>")
-- ─< Comment >───────────────────────────────────────────────────────────────────────── -- ─< Comment >─────────────────────────────────────────────────────────────────────────
-- INFO: makes instant comments, no plugin needet
map("n", "<S-c>", "gcc", { desc = "comment toggle", remap = true }) map("n", "<S-c>", "gcc", { desc = "comment toggle", remap = true })
map("v", "<S-c>", "gc", { desc = "comment toggle", remap = true }) map("v", "<S-c>", "gc", { desc = "comment toggle", remap = true })
-- ─< Terminal >────────────────────────────────────────────────────────────────────────
map("t", "<C-x>", "<C-\\><C-N>", { desc = "terminal escape terminal mode" })
-- ─< Movement while in "insert"-mode >───────────────────────────────────────────────── -- ─< Movement while in "insert"-mode >─────────────────────────────────────────────────
map("i", "<C-b>", "<ESC>^i", { desc = "move beginning of line" }) map("i", "<C-b>", "<ESC>^i", { desc = "move beginning of line" })
map("i", "<C-e>", "<End>", { desc = "move end of line" }) map("i", "<C-e>", "<End>", { desc = "move end of line" })
@ -28,10 +29,9 @@ map("i", "<C-j>", "<Down>", { desc = "move down" })
map("i", "<C-k>", "<Up>", { desc = "move up" }) map("i", "<C-k>", "<Up>", { desc = "move up" })
map("n", ";", ":", { desc = "CMD enter command mode" }) map("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
map("i", "<C-c>", "<ESC>") -- CTRL-C for escape
map("n", "<C-c>", "<ESC>") map({ "i", "n", "v" }, "<C-c>", "<ESC>")
map("v", "<C-c>", "<ESC>")
map("n", "<leader>x", "<cmd>bd!<CR>") map("n", "<leader>x", "<cmd>bd!<CR>")
@ -48,22 +48,27 @@ map("n", "<leader>k", "<C-w><C-k>", { desc = "Move focus to the upper window" })
-- map("n", "<leader>p", vim.cmd.Ex) -- map("n", "<leader>p", vim.cmd.Ex)
map("n", "<leader>q", vim.cmd.q) map("n", "<leader>q", vim.cmd.q)
map("n", "<leader>Q", "<cmd>q!<CR>")
map("n", "<leader>s", vim.cmd.w) map("n", "<leader>s", vim.cmd.w)
map("n", "<C-s>", vim.cmd.w) map("n", "<C-s>", vim.cmd.w)
-- Visual mode: Indent selected lines -- Visual mode: Indent selected lines
map("v", "<Tab>", ">gv", { desc = "Indent and keep selection" }) -- INFO: got removed becouse of the mini-move plugin
map("v", "<S-Tab>", "<gv", { desc = "Unindent and keep selection" }) -- map("v", "<Tab>", ">gv", { desc = "Indent and keep selection" })
-- map("v", "<S-Tab>", "<gv", { desc = "Unindent and keep selection" })
-- window management -- window management
map("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically map("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically
map("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally map("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" }) -- split window horizontally
-- ─< Terminal >────────────────────────────────────────────────────────────────────────
-- NOTE: This is only for terminal mode
map("t", "<C-x>", "<C-\\><C-N>", { desc = "terminal escape terminal mode" })
-- ──────────────────────────────< rename word under cursor >────────────────────────────── -- ──────────────────────────────< rename word under cursor >──────────────────────────────
-- map("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]]) -- map("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
-- ──────────────────────< Enhanced word renaming in current buffer >────────────────────── -- ───────────────< Enhanced word under cursor renaming in current buffer >────────────
-- -- Minimal working version map({ "n", "x" }, "<leader>R", function()
vim.keymap.set({ "n", "x" }, "<leader>R", function()
local text = vim.fn.mode() == "n" and vim.fn.expand("<cword>") or vim.fn.trim(vim.fn.getreg('"')) local text = vim.fn.mode() == "n" and vim.fn.expand("<cword>") or vim.fn.trim(vim.fn.getreg('"'))
vim.ui.input({ prompt = "Replace: ", default = text }, function(input) vim.ui.input({ prompt = "Replace: ", default = text }, function(input)
if input and input ~= text then if input and input ~= text then

View file

@ -53,7 +53,8 @@ o.laststatus = 3
o.swapfile = false o.swapfile = false
-- Disable the tilde on empty lines -- Disable the tilde on empty lines
o.fillchars = { eob = " " } -- enable slimline bubble chain ( )----( )
o.fillchars = { eob = " ", stl = "" }
-- SudaRead automatic if file is inaccessible -- SudaRead automatic if file is inaccessible
vim.g.suda_smart_edit = 1 vim.g.suda_smart_edit = 1
@ -77,7 +78,7 @@ vim.cmd([[
if vim.g.neovide then if vim.g.neovide then
-- vim.g.neovide_transparency = 0.35 -- vim.g.neovide_transparency = 0.35
vim.g.neovide_transparency = 1 vim.g.neovide_opacity = 1
vim.g.neovide_theme = "dark" vim.g.neovide_theme = "dark"
vim.g.neovide_refresh_rate = 90 vim.g.neovide_refresh_rate = 90
vim.g.neovide_cursor_vfx_mode = "torpedo" vim.g.neovide_cursor_vfx_mode = "torpedo"

View file

@ -29,8 +29,7 @@ require("lazy").setup({
{ import = "pika.plugins.lsp" }, { import = "pika.plugins.lsp" },
}, },
-- Configure any other settings here. See the documentation for more details. -- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins. ui = { backdrop = 100 },
install = { colorscheme = { "nord" } },
-- automatically check for plugin updates -- automatically check for plugin updates
checker = { enabled = true }, checker = { enabled = true },
}) })

View file

@ -118,9 +118,9 @@ return {
opts = {}, opts = {},
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" }, -- { "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
{ "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, -- { "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" },
{ "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, -- { "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" },
{ "<leader>db", "<cmd>:Dashboard<CR>", desc = "Dashboard"} { "<leader>db", "<cmd>:Dashboard<CR>", desc = "Dashboard"}
}, },
}, },

View file

@ -4,6 +4,9 @@ return {
"williamboman/mason-lspconfig.nvim", "williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim",
}, },
-- opts = {
--
-- }
config = function() config = function()
-- import mason -- import mason
local mason = require("mason") local mason = require("mason")
@ -46,6 +49,9 @@ return {
}) })
mason_tool_installer.setup({ mason_tool_installer.setup({
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup({})
end,
ensure_installed = { ensure_installed = {
"shfmt", "shfmt",
"prettier", "prettier",

View file

@ -1,22 +1,52 @@
return { return {
-- INFO:
-- mini-ai for a and i selections or other --> vin" for visual in next "" -- mini-ai for a and i selections or other --> vin" for visual in next ""
{ {
"echasnovski/mini.ai", "echasnovski/mini.ai",
version = "false", version = "*",
opts = {}, opts = {},
}, },
-- TIP:
-- ─< mini-surround for surrounding words or lines with "" or () or '' etc.. >────────── -- ─< mini-surround for surrounding words or lines with "" or () or '' etc.. >──────────
{ {
"echasnovski/mini.surround", "echasnovski/mini.surround",
version = "false", version = "*",
opts = {}, opts = {},
}, },
-- Move any selection in any direction
{
"echasnovski/mini.move",
version = "*",
opts = {
-- Module mappings. Use `''` (empty string) to disable one.
mappings = {
-- Move visual selection in Visual mode. Defaults are Alt (Meta) + hjkl.
left = "<S-Tab>",
right = "<Tab>",
down = "<S-j>",
up = "<S-k>",
line_left = "<S-h>",
line_right = "<S-l>",
line_down = "<S-j>",
line_up = "<S-k>",
-- Move current line in Normal mode
},
-- Options which control moving behavior
options = {
-- Automatically reindent selection during linewise vertical move
reindent_linewise = true,
},
},
},
-- ─< miniIcons >─────────────────────────────────────────────────────────────────────── -- ─< miniIcons >───────────────────────────────────────────────────────────────────────
{ {
"echasnovski/mini.icons", "echasnovski/mini.icons",
version = "false", version = "*",
opts = {}, opts = {},
lazy = true, lazy = true,
specs = { specs = {

View file

@ -138,7 +138,7 @@ return {
), ),
}, },
-- ─< INFO: Those comments are really great! >────────────────────────────────────────── -- ─< ERROR: Those comments are really great! >──────────────────────────────────────────
-- ─────────────────────< NOTE: And they can be pretty satisfying... >───────────────────── -- ─────────────────────< NOTE: And they can be pretty satisfying... >─────────────────────
-- ╭──────────────────────────────────────╮ -- ╭──────────────────────────────────────╮
-- │ WARN: Also they can change in color! │ -- │ WARN: Also they can change in color! │
@ -148,8 +148,9 @@ return {
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
opts = { opts = {
keywords = { keywords = {
NOTE = { icon = "", color = "hint" }, NOTE = { icon = "", color = "hint", alt = { "TIP" } },
INFO = { icon = "", color = "info" }, INFO = { icon = "", color = "info", alt = { "INFORMATION" } },
ERROR = { icon = "", color = "error", alt = { "ERR" } },
WARNING = { icon = "", color = "warning", alt = { "WARN" } }, WARNING = { icon = "", color = "warning", alt = { "WARN" } },
}, },
}, },
@ -200,7 +201,7 @@ return {
enable_named_colors = true, enable_named_colors = true,
---Highlight tailwind colors, e.g. 'bg-blue-500' ---Highlight tailwind colors, e.g. 'bg-blue-500'
enable_tailwind = false, enable_tailwind = true,
---Set custom colors ---Set custom colors
---Label must be properly escaped with '%' to adhere to `string.gmatch` ---Label must be properly escaped with '%' to adhere to `string.gmatch`
@ -219,21 +220,21 @@ return {
-- ╭──────────────────────────────────────╮ -- ╭──────────────────────────────────────╮
-- │ flash - to navigate more efficiently │ -- │ flash - to navigate more efficiently │
-- ╰──────────────────────────────────────╯ -- ╰──────────────────────────────────────╯
{ -- {
"folke/flash.nvim", -- "folke/flash.nvim",
event = "VeryLazy", -- event = "VeryLazy",
vscode = true, -- vscode = true,
-- @type Flash.Config -- -- @type Flash.Config
opts = {}, -- -- opts = {},
-- stylua: ignore -- -- stylua: ignore
keys = { -- keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, -- { "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" }, -- { "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", 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" },
}, -- },
}, -- },
-- ╭──────────────────────────────╮ -- ╭──────────────────────────────╮
-- │ renaming (also project wide) │ -- │ renaming (also project wide) │

View file

@ -23,19 +23,19 @@ return {
move_wraps_at_ends = true, -- whether or not the move command "wraps" at the first or last position move_wraps_at_ends = true, -- whether or not the move command "wraps" at the first or last position
separator_style = "slope", separator_style = "slope",
-- ─< icons >─────────────────────────────────────────────────────────────────────────── -- ─< icons >───────────────────────────────────────────────────────────────────────────
modified_icon = "󱞇", modified_icon = "󱞇 ",
left_trunc_marker = "󰬩", left_trunc_marker = "󰬩 ",
right_trunc_marker = "󰬫", right_trunc_marker = "󰬫 ",
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
close_icon = "󱄊", close_icon = "󱄊 ",
buffer_close_icon = "󱄊", buffer_close_icon = "󱄊 ",
show_buffer_icons = true, -- disable filetype icons for buffers show_buffer_icons = true, -- disable filetype icons for buffers
show_buffer_close_icons = true, show_buffer_close_icons = true,
show_close_icon = true, show_close_icon = true,
show_tab_indicators = true, show_tab_indicators = true,
hover = { hover = {
enabled = true, enabled = true,
delay = 80, delay = 30,
reveal = { "close" }, reveal = { "close" },
hide = { "nvim_lsp" }, hide = { "nvim_lsp" },
}, },
@ -217,6 +217,7 @@ return {
}) })
vim.notify = require("notify") vim.notify = require("notify")
end, end,
vim.keymap.set("n", "<leader>tn", "<cmd>Telescope notify<CR>", { desc = "Telescope show Notifications" }),
}, },
-- ╭──────────────────────────────╮ -- ╭──────────────────────────────╮
-- │ slimline - nice bar for nvim │ -- │ slimline - nice bar for nvim │
@ -229,9 +230,37 @@ return {
verbose_mode = false, -- Mode as single letter or as a word 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 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 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 components = { -- Choose components and their location
left = { left = {
"mode", "mode",
"progress",
-- "path", -- "path",
-- "git", -- "git",
}, },
@ -245,11 +274,6 @@ return {
"progress", "progress",
}, },
}, },
spaces = {
components = " ", -- string between components
left = " ", -- string at the start of the line
right = " ", -- string at the end of the line
},
sep = { sep = {
hide = { hide = {
first = false, -- hides the first separator first = false, -- hides the first separator
@ -293,8 +317,8 @@ return {
"folke/which-key.nvim", "folke/which-key.nvim",
event = "VeryLazy", event = "VeryLazy",
init = function() init = function()
vim.o.timeout = true vim.o.timeout = false
vim.o.timeoutlen = 350 vim.o.timeoutlen = 0
end, end,
opts = { opts = {
-- your configuration comes here -- your configuration comes here