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 = " "
-- TIP: Unmap keymaps
-- ─< lua/keymaps.lua >─────────────────────────────────────────────────────────────────
local nomap = vim.keymap.set
nomap("i", "<C-k>", "")
@ -8,17 +10,16 @@ nomap("n", "q", "")
nomap("v", "q", "")
nomap("v", "<leader>S", "")
-- INFO: vim.keymap.set with map()
local map = vim.keymap.set
map("n", "<Esc>", "<cmd>nohlsearch<CR>")
-- ─< Comment >─────────────────────────────────────────────────────────────────────────
-- INFO: makes instant comments, no plugin needet
map("n", "<S-c>", "gcc", { 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 >─────────────────────────────────────────────────
map("i", "<C-b>", "<ESC>^i", { desc = "move beginning 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("n", ";", ":", { desc = "CMD enter command mode" })
map("i", "jk", "<ESC>")
map("i", "<C-c>", "<ESC>")
map("n", "<C-c>", "<ESC>")
map("v", "<C-c>", "<ESC>")
-- CTRL-C for escape
map({ "i", "n", "v" }, "<C-c>", "<ESC>")
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>q", vim.cmd.q)
map("n", "<leader>Q", "<cmd>q!<CR>")
map("n", "<leader>s", vim.cmd.w)
map("n", "<C-s>", vim.cmd.w)
-- Visual mode: Indent selected lines
map("v", "<Tab>", ">gv", { desc = "Indent and keep selection" })
map("v", "<S-Tab>", "<gv", { desc = "Unindent and keep selection" })
-- INFO: got removed becouse of the mini-move plugin
-- map("v", "<Tab>", ">gv", { desc = "Indent and keep selection" })
-- map("v", "<S-Tab>", "<gv", { desc = "Unindent and keep selection" })
-- window management
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
-- ─< Terminal >────────────────────────────────────────────────────────────────────────
-- NOTE: This is only for terminal mode
map("t", "<C-x>", "<C-\\><C-N>", { desc = "terminal escape terminal mode" })
-- ──────────────────────────────< rename word under cursor >──────────────────────────────
-- map("n", "<leader>R", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
-- ──────────────────────< Enhanced word renaming in current buffer >──────────────────────
-- -- Minimal working version
vim.keymap.set({ "n", "x" }, "<leader>R", function()
-- ───────────────< Enhanced word under cursor renaming in current buffer >────────────
map({ "n", "x" }, "<leader>R", function()
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)
if input and input ~= text then

View file

@ -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"

View file

@ -1,17 +1,17 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
@ -23,14 +23,13 @@ vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "pika.plugins" },
{ import = "pika.plugins.lsp" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "nord" } },
-- automatically check for plugin updates
checker = { enabled = true },
spec = {
-- import your plugins
{ import = "pika.plugins" },
{ import = "pika.plugins.lsp" },
},
-- Configure any other settings here. See the documentation for more details.
ui = { backdrop = 100 },
-- automatically check for plugin updates
checker = { enabled = true },
})

View file

@ -116,13 +116,13 @@ return {
"folke/persistence.nvim",
event = "BufReadPre",
opts = {},
-- stylua: ignore
keys = {
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore 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>db", "<cmd>:Dashboard<CR>", desc = "Dashboard"}
},
-- stylua: ignore
keys = {
-- { "<leader>qs", function() require("persistence").load() end, desc = "Restore 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>db", "<cmd>:Dashboard<CR>", desc = "Dashboard"}
},
},
},
}

View file

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

View file

@ -1,22 +1,52 @@
return {
-- INFO:
-- mini-ai for a and i selections or other --> vin" for visual in next ""
{
"echasnovski/mini.ai",
version = "false",
version = "*",
opts = {},
},
-- TIP:
-- ─< mini-surround for surrounding words or lines with "" or () or '' etc.. >──────────
{
"echasnovski/mini.surround",
version = "false",
version = "*",
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 >───────────────────────────────────────────────────────────────────────
{
"echasnovski/mini.icons",
version = "false",
version = "*",
opts = {},
lazy = true,
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... >─────────────────────
-- ╭──────────────────────────────────────╮
-- │ WARN: Also they can change in color! │
@ -148,8 +148,9 @@ return {
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
keywords = {
NOTE = { icon = "", color = "hint" },
INFO = { icon = "", color = "info" },
NOTE = { icon = "", color = "hint", alt = { "TIP" } },
INFO = { icon = "", color = "info", alt = { "INFORMATION" } },
ERROR = { icon = "", color = "error", alt = { "ERR" } },
WARNING = { icon = "", color = "warning", alt = { "WARN" } },
},
},
@ -200,7 +201,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`
@ -219,21 +220,21 @@ 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" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
},
-- {
-- "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" },
-- { "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
-- },
-- },
-- ╭──────────────────────────────╮
-- │ 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
separator_style = "slope",
-- ─< icons >───────────────────────────────────────────────────────────────────────────
modified_icon = "󱞇",
left_trunc_marker = "󰬩",
right_trunc_marker = "󰬫",
modified_icon = "󱞇 ",
left_trunc_marker = "󰬩 ",
right_trunc_marker = "󰬫 ",
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
close_icon = "󱄊",
buffer_close_icon = "󱄊",
close_icon = "󱄊 ",
buffer_close_icon = "󱄊 ",
show_buffer_icons = true, -- disable filetype icons for buffers
show_buffer_close_icons = true,
show_close_icon = true,
show_tab_indicators = true,
hover = {
enabled = true,
delay = 80,
delay = 30,
reveal = { "close" },
hide = { "nvim_lsp" },
},
@ -217,6 +217,7 @@ return {
})
vim.notify = require("notify")
end,
vim.keymap.set("n", "<leader>tn", "<cmd>Telescope notify<CR>", { desc = "Telescope show Notifications" }),
},
-- ╭──────────────────────────────╮
-- │ slimline - nice bar for nvim │
@ -229,9 +230,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",
},
@ -245,11 +274,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
@ -293,8 +317,8 @@ return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 350
vim.o.timeout = false
vim.o.timeoutlen = 0
end,
opts = {
-- your configuration comes here