From 8c9e74223521db0e4d9ea01ef22ff5368d4c2543 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 17 Mar 2025 14:46:14 +0100 Subject: [PATCH 01/36] rem: removed old and unneedet config --- init.lua | 35 ------------------ lua/pika/plugins/avante-ai.lua | 59 ------------------------------- lua/pika/plugins/cmd-line.lua | 41 --------------------- lua/pika/plugins/colorschemes.lua | 23 ------------ 4 files changed, 158 deletions(-) delete mode 100644 lua/pika/plugins/avante-ai.lua delete mode 100644 lua/pika/plugins/cmd-line.lua diff --git a/init.lua b/init.lua index 68f2a4d..a4a2ea5 100644 --- a/init.lua +++ b/init.lua @@ -7,38 +7,3 @@ require("pika.lazy") -- ╰──────────────────────────────────────────────────────╯ vim.cmd.colorscheme("oldschool") - --- Keybind for saving clipboard screenshot and inserting a Markdown link -vim.api.nvim_set_keymap("n", "ps", ":lua SaveScreenshotAndInsertLink()", { noremap = true, silent = true }) - -function SaveScreenshotAndInsertLink() - -- Prompt for Hugo base directory if needed - - -- Define the Hugo base directory and screenshot subfolder path - local base_dir - local current_file_dir = vim.fn.expand("%:p:h") - - -- Detect base dir by looking for the Hugo structure, or prompt if not found - if current_file_dir:match("/content/") then - base_dir = current_file_dir:match("(.*)/content/") - else - -- Prompt for Hugo base directory if automatic detection fails - base_dir = vim.fn.input("Enter base directory of your Hugo site: ", "", "file") - end - - local img_folder = base_dir .. "/static/images/screenshots/" - vim.fn.mkdir(img_folder, "p") -- Ensure the directory exists - - -- Define the image name and full path - local img_name = os.date("%Y-%m-%d_%H-%M-%S") .. ".png" - local full_path = img_folder .. img_name - - -- Save clipboard image as binary PNG file using wl-paste - os.execute("wl-paste --type image/png > " .. full_path) - - -- Insert markdown image link at cursor position - local img_markdown = "![](/images/screenshots/" .. img_name .. ")\n" - vim.api.nvim_put({ img_markdown }, "c", true, true) - - print("Screenshot saved and link added: " .. full_path) -end diff --git a/lua/pika/plugins/avante-ai.lua b/lua/pika/plugins/avante-ai.lua deleted file mode 100644 index 682a95f..0000000 --- a/lua/pika/plugins/avante-ai.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - "yetone/avante.nvim", - event = "VeryLazy", - version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes. - opts = { - -- add any opts here - -- for example - provider = "openai", - openai = { - endpoint = "https://api.openai.com/v1", - model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) - timeout = 30000, -- timeout in milliseconds - temperature = 0, -- adjust if needed - max_tokens = 4096, - -- reasoning_effort = "high" -- only supported for reasoning models (o1, etc.) - }, - }, - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - build = "make", - -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows - dependencies = { - "nvim-treesitter/nvim-treesitter", - "stevearc/dressing.nvim", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - "echasnovski/mini.pick", -- for file_selector provider mini.pick - "nvim-telescope/telescope.nvim", -- for file_selector provider telescope - "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - "ibhagwan/fzf-lua", -- for file_selector provider fzf - "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - "zbirenbaum/copilot.lua", -- for providers='copilot' - { - -- support for image pasting - "HakonHarnes/img-clip.nvim", - event = "VeryLazy", - opts = { - -- recommended settings - default = { - embed_image_as_base64 = false, - prompt_for_file_name = false, - drag_and_drop = { - insert_mode = true, - }, - -- required for Windows users - use_absolute_path = true, - }, - }, - }, - { - -- Make sure to set this up properly if you have lazy=true - "MeanderingProgrammer/render-markdown.nvim", - opts = { - file_types = { "markdown", "Avante" }, - }, - ft = { "markdown", "Avante" }, - }, - }, -} diff --git a/lua/pika/plugins/cmd-line.lua b/lua/pika/plugins/cmd-line.lua deleted file mode 100644 index ea0e2f5..0000000 --- a/lua/pika/plugins/cmd-line.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - "VonHeikemen/fine-cmdline.nvim", - dependencies = { - { "MunifTanjim/nui.nvim" }, - }, - config = function() - require("fine-cmdline").setup({ - cmdline = { - enable_keymaps = true, - smart_history = true, - prompt = " ", - }, - popup = { - position = { - row = "10%", - col = "50%", - }, - size = { - width = "60%", - }, - border = { - style = "rounded", - }, - win_options = { - winhighlight = "Normal:Normal,FloatBorder:FloatBorder", - }, - }, - hooks = { - before_mount = function(input) - -- code - end, - after_mount = function(input) - -- code - end, - set_keymaps = function(imap, feedkeys) - -- code - end, - }, - }) - end, -} diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua index d977b29..750d932 100644 --- a/lua/pika/plugins/colorschemes.lua +++ b/lua/pika/plugins/colorschemes.lua @@ -10,20 +10,7 @@ return { { "eldritch-theme/eldritch.nvim" }, -- { "sainnhe/sonokai" }, { "samharju/synthweave.nvim" }, - { "sainnhe/gruvbox-material" }, - { "pauchiner/pastelnight.nvim" }, - { "ptdewey/darkearth-nvim" }, { "marko-cerovac/material.nvim" }, - -- { - -- "ferdinandrau/lavish.nvim", - -- opts = { - -- style = { - -- italic_comments = false, - -- italic_strings = false, - -- transparent = false, - -- }, - -- }, - -- }, { "neko-night/nvim", lazy = false, @@ -44,16 +31,6 @@ return { }, }, }, - { - "scottmckendry/cyberdream.nvim", - name = "cyberdream", - lazy = false, - opts = { - transparent = true, - hide_fillchars = true, - terminal_colors = true, - }, - }, { "ribru17/bamboo.nvim", opts = { From 600a7163fa6a65cc9442d09b560377fbeb572918 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 17 Mar 2025 15:04:08 +0100 Subject: [PATCH 02/36] restructure: removed unneedet plugins and made structured files for it --- lua/pika/plugins/autopairs.lua | 30 --- lua/pika/plugins/barbecue.lua | 55 ------ lua/pika/plugins/bufferline.lua | 49 ----- lua/pika/plugins/colorizer.lua | 72 ------- lua/pika/plugins/comment-box.lua | 40 ---- lua/pika/plugins/comment.lua | 19 -- lua/pika/plugins/flash.lua | 15 -- lua/pika/plugins/grug-far.lua | 22 --- lua/pika/plugins/indent-blankline.lua | 13 -- lua/pika/plugins/notify.lua | 29 --- lua/pika/plugins/qol.lua | 263 ++++++++++++++++++++++++++ lua/pika/plugins/scissors.lua | 12 -- lua/pika/plugins/slimline.lua | 64 ------- lua/pika/plugins/ui.lua | 245 ++++++++++++++++++++++++ lua/pika/plugins/which-key.lua | 13 -- 15 files changed, 508 insertions(+), 433 deletions(-) delete mode 100644 lua/pika/plugins/autopairs.lua delete mode 100644 lua/pika/plugins/barbecue.lua delete mode 100644 lua/pika/plugins/bufferline.lua delete mode 100644 lua/pika/plugins/colorizer.lua delete mode 100644 lua/pika/plugins/comment-box.lua delete mode 100644 lua/pika/plugins/comment.lua delete mode 100644 lua/pika/plugins/flash.lua delete mode 100644 lua/pika/plugins/grug-far.lua delete mode 100644 lua/pika/plugins/indent-blankline.lua delete mode 100644 lua/pika/plugins/notify.lua create mode 100644 lua/pika/plugins/qol.lua delete mode 100644 lua/pika/plugins/scissors.lua delete mode 100644 lua/pika/plugins/slimline.lua create mode 100644 lua/pika/plugins/ui.lua delete mode 100644 lua/pika/plugins/which-key.lua diff --git a/lua/pika/plugins/autopairs.lua b/lua/pika/plugins/autopairs.lua deleted file mode 100644 index c9f5b9a..0000000 --- a/lua/pika/plugins/autopairs.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - "windwp/nvim-autopairs", - event = { "InsertEnter" }, - dependencies = { - "hrsh7th/nvim-cmp", - }, - config = function() - -- import nvim-autopairs - local autopairs = require("nvim-autopairs") - - -- configure autopairs - autopairs.setup({ - check_ts = true, -- enable treesitter - ts_config = { - lua = { "string" }, -- don't add pairs in lua string treesitter nodes - javascript = { "template_string" }, -- don't add pairs in javascript template_string treesitter nodes - java = false, -- don't check treesitter on java - }, - }) - - -- import nvim-autopairs completion functionality - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - - -- import nvim-cmp plugin (completions plugin) - local cmp = require("cmp") - - -- make autopairs and completion work together - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, -} diff --git a/lua/pika/plugins/barbecue.lua b/lua/pika/plugins/barbecue.lua deleted file mode 100644 index 86824d9..0000000 --- a/lua/pika/plugins/barbecue.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - "utilyre/barbecue.nvim", - name = "barbecue", - version = "*", - dependencies = { - "SmiteshP/nvim-navic", - "echasnovski/mini.icons", -- optional dependency - }, - opts = { - theme = { - -- this highlight is used to override other highlights - -- you can take advantage of its `bg` and set a background throughout your winbar - -- (e.g. basename will look like this: { fg = "#c0caf5", bold = true }) - normal = { fg = "#c0caf5" }, - - -- these highlights correspond to symbols table from config - ellipsis = { fg = "#737aa2" }, - separator = { fg = "#737aa2" }, - modified = { fg = "#737aa2" }, - - -- these highlights represent the _text_ of three main parts of barbecue - dirname = { fg = "#737aa2" }, - basename = { bold = true }, - context = {}, - - -- these highlights are used for context/navic icons - context_file = { fg = "#ac8fe4" }, - context_module = { fg = "#ac8fe4" }, - context_namespace = { fg = "#ac8fe4" }, - context_package = { fg = "#ac8fe4" }, - context_class = { fg = "#ac8fe4" }, - context_method = { fg = "#ac8fe4" }, - context_property = { fg = "#ac8fe4" }, - context_field = { fg = "#ac8fe4" }, - context_constructor = { fg = "#ac8fe4" }, - context_enum = { fg = "#ac8fe4" }, - context_interface = { fg = "#ac8fe4" }, - context_function = { fg = "#ac8fe4" }, - context_variable = { fg = "#ac8fe4" }, - context_constant = { fg = "#ac8fe4" }, - context_string = { fg = "#ac8fe4" }, - context_number = { fg = "#ac8fe4" }, - context_boolean = { fg = "#ac8fe4" }, - context_array = { fg = "#ac8fe4" }, - context_object = { fg = "#ac8fe4" }, - context_key = { fg = "#ac8fe4" }, - context_null = { fg = "#ac8fe4" }, - context_enum_member = { fg = "#ac8fe4" }, - context_struct = { fg = "#ac8fe4" }, - context_event = { fg = "#ac8fe4" }, - context_operator = { fg = "#ac8fe4" }, - context_type_parameter = { fg = "#ac8fe4" }, - }, - }, -} diff --git a/lua/pika/plugins/bufferline.lua b/lua/pika/plugins/bufferline.lua deleted file mode 100644 index 0a8c69a..0000000 --- a/lua/pika/plugins/bufferline.lua +++ /dev/null @@ -1,49 +0,0 @@ -return { - "akinsho/bufferline.nvim", - dependencies = { "echasnovski/mini.icons" }, - version = "*", - opts = { - options = { - diagnostics = "nvim_lsp", - diagnostics_update_on_event = true, -- use nvim's diagnostic handler - diagnostics_indicator = function(count, level) - local icon = level:match("error") and " " or " " - return " " .. icon .. count - end, - offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } }, - -- ─< style >─────────────────────────────────────────────────────────────────────────── - indicator = { - icon = "▎", -- this should be omitted if indicator style is not 'icon' - style = "icon", - }, - 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 = "󰬫", - themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default - 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, - reveal = { "close" }, - hide = { "nvim_lsp" }, - }, - -- You can set buffer_mode to "list" or "tabbed" based on your preference. - buffer_mode = "list", - color_icons = true, -- whether or not to add the filetype icon highlights - }, - }, - config = function(_, opts) - require("bufferline").setup(opts) - -- Remap the tab key for buffer navigation (you can adjust the keys as needed) - vim.keymap.set("n", "", "BufferLineCycleNext") - vim.keymap.set("n", "", "BufferLineCyclePrev") - end, -} diff --git a/lua/pika/plugins/colorizer.lua b/lua/pika/plugins/colorizer.lua deleted file mode 100644 index 0d3dac4..0000000 --- a/lua/pika/plugins/colorizer.lua +++ /dev/null @@ -1,72 +0,0 @@ -return { - -- { - -- 'norcalli/nvim-colorizer.lua', - -- opts = { - -- 'css', - -- 'html', - -- 'php', - -- 'bash', - -- 'fish', - -- 'lua', - -- 'toml', - -- html = { - -- mode = 'foreground', - -- }, - -- }, - -- }, - "brenoprata10/nvim-highlight-colors", - opts = { - ---Render style - ---@usage 'background'|'foreground'|'virtual' - render = "background", - - ---Set virtual symbol (requires render to be set to 'virtual') - virtual_symbol = "■", - - ---Set virtual symbol suffix (defaults to '') - virtual_symbol_prefix = "", - - ---Set virtual symbol suffix (defaults to ' ') - virtual_symbol_suffix = " ", - - ---Set virtual symbol position() - ---@usage 'inline'|'eol'|'eow' - ---inline mimics VS Code style - ---eol stands for `end of column` - Recommended to set `virtual_symbol_suffix = ''` when used. - ---eow stands for `end of word` - Recommended to set `virtual_symbol_prefix = ' ' and virtual_symbol_suffix = ''` when used. - virtual_symbol_position = "inline", - - ---Highlight hex colors, e.g. '#FFFFFF' - enable_hex = true, - - ---Highlight short hex colors e.g. '#fff' - enable_short_hex = true, - - ---Highlight rgb colors, e.g. 'rgb(0 0 0)' - enable_rgb = true, - - ---Highlight hsl colors, e.g. 'hsl(150deg 30% 40%)' - enable_hsl = true, - - ---Highlight CSS variables, e.g. 'var(--testing-color)' - enable_var_usage = true, - - ---Highlight named colors, e.g. 'green' - enable_named_colors = true, - - ---Highlight tailwind colors, e.g. 'bg-blue-500' - enable_tailwind = false, - - ---Set custom colors - ---Label must be properly escaped with '%' to adhere to `string.gmatch` - --- :help string.gmatch - custom_colors = { - { label = "%-%-theme%-primary%-color", color = "#0f1219" }, - { label = "%-%-theme%-secondary%-color", color = "#5a5d64" }, - }, - - -- Exclude filetypes or buftypes from highlighting e.g. 'exclude_buftypes = {'text'}' - exclude_filetypes = {}, - exclude_buftypes = {}, - }, -} diff --git a/lua/pika/plugins/comment-box.lua b/lua/pika/plugins/comment-box.lua deleted file mode 100644 index bba9c90..0000000 --- a/lua/pika/plugins/comment-box.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - "LudoPinelli/comment-box.nvim", - lazy = false, - opts = { - comment_style = "line", - doc_width = 90, -- width of the document - box_width = 75, -- width of the boxes - line_width = 120, -- width of the lines - }, - -- ─< Comment-Box mappings >──────────────────────────────────────────────────────────── - vim.keymap.set("n", "cd", "CBd", { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" }), - vim.keymap.set("v", "cd", "CBd", { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" }), - - vim.keymap.set("n", "cy", "CBy", { noremap = true, silent = true, desc = "[y]ank content of Commentbox" }), - vim.keymap.set("v", "cy", "CBy", { noremap = true, silent = true, desc = "[y]ank content of Commentbox" }), - - vim.keymap.set("n", "cb", "CBlabox1", { noremap = true, silent = true, desc = "[c]reate comment [b]ox" }), - vim.keymap.set("v", "cb", "CBlabox1", { noremap = true, silent = true, desc = "[c]reate comment [b]ox" }), - vim.keymap.set( - "n", - "cB", - "CBcabox1", - { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } - ), - - vim.keymap.set( - "v", - "cB", - "CBcabox1", - { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } - ), - vim.keymap.set("n", "cc", "CBllbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment" }), - vim.keymap.set("v", "cc", "CBllbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment" }), - vim.keymap.set("n", "cC", "CBclbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" }), - vim.keymap.set("v", "cC", "CBclbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" }), - - vim.keymap.set("n", "cl", "CBllline8", { noremap = true, silent = true, desc = "[c]reate comment [l]ine" }), - vim.keymap.set("n", "cL", "CBlcline8", { noremap = true, silent = true, desc = "[c]reate comment [L]ine" }), - -} diff --git a/lua/pika/plugins/comment.lua b/lua/pika/plugins/comment.lua deleted file mode 100644 index a0f254e..0000000 --- a/lua/pika/plugins/comment.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - "numToStr/Comment.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "JoosepAlviste/nvim-ts-context-commentstring", - }, - config = function() - -- import comment plugin safely - local comment = require("Comment") - - local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim") - - -- enable comment - comment.setup({ - -- for commenting tsx, jsx, svelte, html files - pre_hook = ts_context_commentstring.create_pre_hook(), - }) - end, -} diff --git a/lua/pika/plugins/flash.lua b/lua/pika/plugins/flash.lua deleted file mode 100644 index 626eac9..0000000 --- a/lua/pika/plugins/flash.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - "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" }, - }, -} diff --git a/lua/pika/plugins/grug-far.lua b/lua/pika/plugins/grug-far.lua deleted file mode 100644 index 3768072..0000000 --- a/lua/pika/plugins/grug-far.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - "MagicDuck/grug-far.nvim", - opts = { headerMaxWidth = 80 }, - cmd = "GrugFar", - keys = { - { - "sr", - function() - local grug = require("grug-far") - local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") - grug.grug_far({ - transient = true, - prefills = { - filesFilter = ext and ext ~= "" and "*." .. ext or nil, - }, - }) - end, - mode = { "n", "v" }, - desc = "Search and Replace", - }, - }, -} diff --git a/lua/pika/plugins/indent-blankline.lua b/lua/pika/plugins/indent-blankline.lua deleted file mode 100644 index 67f9f38..0000000 --- a/lua/pika/plugins/indent-blankline.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPre", "BufNewFile" }, - main = "ibl", - opts = { - indent = { - char = "┊", - tab_char = "┊", - -- char = "│", - -- tab_char = "│", - }, - }, -} diff --git a/lua/pika/plugins/notify.lua b/lua/pika/plugins/notify.lua deleted file mode 100644 index bcf486a..0000000 --- a/lua/pika/plugins/notify.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - "rcarriga/nvim-notify", - config = function() - require("notify").setup({ - stages = "slide", - background_colour = "FloatShadow", - max_width = 120, - timeout = 2750, - render = "wrapped-compact", - -- Minimum/Maximum width for notification windows - minimum_width = 30, - maximum_width = 120, - - -- Function called when a new window is opened, use for changing win settings/config - on_open = nil, - - -- Function called when a window is closed - on_close = nil, - icons = { - ERROR = "", -- alternate symbol  - WARN = "", - INFO = "", - DEBUG = "", - TRACE = "", - }, - }) - vim.notify = require("notify") - end, -} diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua new file mode 100644 index 0000000..c012d60 --- /dev/null +++ b/lua/pika/plugins/qol.lua @@ -0,0 +1,263 @@ +return { + -- ╭───────────╮ + -- │ autopairs │ + -- ╰───────────╯ + { + "windwp/nvim-autopairs", + event = { "InsertEnter" }, + dependencies = { + "hrsh7th/nvim-cmp", + }, + config = function() + -- import nvim-autopairs + local autopairs = require("nvim-autopairs") + + -- configure autopairs + autopairs.setup({ + check_ts = true, -- enable treesitter + ts_config = { + lua = { "string" }, -- don't add pairs in lua string treesitter nodes + javascript = { "template_string" }, -- don't add pairs in javascript template_string treesitter nodes + java = false, -- don't check treesitter on java + }, + }) + + -- import nvim-autopairs completion functionality + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + + -- import nvim-cmp plugin (completions plugin) + local cmp = require("cmp") + + -- make autopairs and completion work together + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, + + -- ╭─────────────────────────────────────╮ + -- │ ╭───────────────╮ │ + -- │ │ comment boxes │<- yes, those ones │ + -- │ ╰───────────────╯ │ + -- ╰─────────────────────────────────────╯ + { + "LudoPinelli/comment-box.nvim", + lazy = false, + opts = { + comment_style = "line", + doc_width = 90, -- width of the document + box_width = 75, -- width of the boxes + line_width = 120, -- width of the lines + }, + -- ───────────────────────────────< keymaps - commentboxes >─────────────────────────────── + vim.keymap.set( + "n", + "cd", + "CBd", + { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" } + ), + vim.keymap.set( + "v", + "cd", + "CBd", + { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" } + ), + + vim.keymap.set( + "n", + "cy", + "CBy", + { noremap = true, silent = true, desc = "[y]ank content of Commentbox" } + ), + vim.keymap.set( + "v", + "cy", + "CBy", + { noremap = true, silent = true, desc = "[y]ank content of Commentbox" } + ), + + vim.keymap.set( + "n", + "cb", + "CBlabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox" } + ), + vim.keymap.set( + "v", + "cb", + "CBlabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox" } + ), + vim.keymap.set( + "n", + "cB", + "CBcabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } + ), + + vim.keymap.set( + "v", + "cB", + "CBcabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } + ), + vim.keymap.set( + "n", + "cc", + "CBllbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment" } + ), + vim.keymap.set( + "v", + "cc", + "CBllbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment" } + ), + vim.keymap.set( + "n", + "cC", + "CBclbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" } + ), + vim.keymap.set( + "v", + "cC", + "CBclbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" } + ), + + vim.keymap.set( + "n", + "cl", + "CBllline8", + { noremap = true, silent = true, desc = "[c]reate comment [l]ine" } + ), + vim.keymap.set( + "n", + "cL", + "CBlcline8", + { noremap = true, silent = true, desc = "[c]reate comment [L]ine" } + ), + }, + + -- ╭───────────╮ + -- │ colorizer │ + -- ╰───────────╯ + { + "brenoprata10/nvim-highlight-colors", + opts = { + ---Render style + ---@usage 'background'|'foreground'|'virtual' + render = "background", + + ---Set virtual symbol (requires render to be set to 'virtual') + virtual_symbol = "■", + + ---Set virtual symbol suffix (defaults to '') + virtual_symbol_prefix = "", + + ---Set virtual symbol suffix (defaults to ' ') + virtual_symbol_suffix = " ", + + ---Set virtual symbol position() + ---@usage 'inline'|'eol'|'eow' + ---inline mimics VS Code style + ---eol stands for `end of column` - Recommended to set `virtual_symbol_suffix = ''` when used. + ---eow stands for `end of word` - Recommended to set `virtual_symbol_prefix = ' ' and virtual_symbol_suffix = ''` when used. + virtual_symbol_position = "inline", + + ---Highlight hex colors, e.g. '#FFFFFF' + enable_hex = true, + + ---Highlight short hex colors e.g. '#fff' + enable_short_hex = true, + + ---Highlight rgb colors, e.g. 'rgb(0 0 0)' + enable_rgb = true, + + ---Highlight hsl colors, e.g. 'hsl(150deg 30% 40%)' + enable_hsl = true, + + ---Highlight CSS variables, e.g. 'var(--testing-color)' + enable_var_usage = true, + + ---Highlight named colors, e.g. 'green' + enable_named_colors = true, + + ---Highlight tailwind colors, e.g. 'bg-blue-500' + enable_tailwind = false, + + ---Set custom colors + ---Label must be properly escaped with '%' to adhere to `string.gmatch` + --- :help string.gmatch + custom_colors = { + { label = "%-%-theme%-primary%-color", color = "#0f1219" }, + { label = "%-%-theme%-secondary%-color", color = "#5a5d64" }, + }, + + -- Exclude filetypes or buftypes from highlighting e.g. 'exclude_buftypes = {'text'}' + exclude_filetypes = {}, + exclude_buftypes = {}, + }, + }, + + -- ╭──────────────────────────────────────╮ + -- │ 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) │ + -- ╰──────────────────────────────╯ + { + "MagicDuck/grug-far.nvim", + opts = { headerMaxWidth = 80 }, + cmd = "GrugFar", + -- ────────────────────────────────────< keybindings >───────────────────────────────── + keys = { + { + "sr", + function() + local grug = require("grug-far") + local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") + grug.grug_far({ + transient = true, + prefills = { + filesFilter = ext and ext ~= "" and "*." .. ext or nil, + }, + }) + end, + mode = { "n", "v" }, + desc = "Search and Replace", + }, + }, + }, + -- ╭──────────╮ + -- │ snippets │ + -- ╰──────────╯ + { + { + "chrisgrieser/nvim-scissors", + lazy = false, + dependencies = { "nvim-telescope/telescope.nvim", "garymjr/nvim-snippets" }, + opts = { + snippetDir = "~/.config/nvim/snippets", -- <- i have this as a submodule in my neovim config to have a seperate repo https://git.k4li.de/dotfiles/nvim-snippets.git + }, + }, + -- ──────────────────────────< keybindings for snippets engine >─────────────────────── + vim.keymap.set("n", "sm", ":ScissorsEditSnippet"), + vim.keymap.set("v", "sa", ":ScissorsAddNewSnippet"), + }, +} diff --git a/lua/pika/plugins/scissors.lua b/lua/pika/plugins/scissors.lua deleted file mode 100644 index 83bb295..0000000 --- a/lua/pika/plugins/scissors.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - { - "chrisgrieser/nvim-scissors", - lazy = false, - dependencies = { "nvim-telescope/telescope.nvim", "garymjr/nvim-snippets" }, - opts = { - snippetDir = "~/.config/nvim/snippets", - }, - }, - vim.keymap.set("n", "sm", ":ScissorsEditSnippet"), - vim.keymap.set("v", "sa", ":ScissorsAddNewSnippet"), -} diff --git a/lua/pika/plugins/slimline.lua b/lua/pika/plugins/slimline.lua deleted file mode 100644 index 07a16b0..0000000 --- a/lua/pika/plugins/slimline.lua +++ /dev/null @@ -1,64 +0,0 @@ -return { - -- Calls `require('slimline').setup({})` - "sschleemilch/slimline.nvim", - opts = { - bold = true, -- makes primary parts and mode bold - 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 - components = { -- Choose components and their location - left = { - "mode", - -- "path", - -- "git", - }, - center = { - "path", - "git", - }, - right = { - "diagnostics", - "filetype_lsp", - "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 - last = false, -- hides the last separator - }, - left = "", -- left separator of components - right = "", -- right separator of components - }, - hl = { - modes = { - normal = "Type", -- highlight base of modes - insert = "Function", - pending = "Boolean", - visual = "Keyword", - command = "String", - }, - base = "Comment", -- highlight of everything in in between components - primary = "Normal", -- highlight of primary parts (e.g. filename) - secondary = "Comment", -- highlight of secondary parts (e.g. filepath) - }, - icons = { - diagnostics = { - ERROR = " ", - WARN = " ", - HINT = " ", - INFO = " ", - }, - git = { - branch = "", - }, - folder = " ", - lines = " ", - }, - }, -} diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua new file mode 100644 index 0000000..969fe37 --- /dev/null +++ b/lua/pika/plugins/ui.lua @@ -0,0 +1,245 @@ +return { + -- ╭───────────────────────────────────────╮ + -- │ bufferline - for mistakes and stuff.. │ + -- ╰───────────────────────────────────────╯ + { + "akinsho/bufferline.nvim", + dependencies = { "echasnovski/mini.icons" }, + version = "*", + opts = { + options = { + diagnostics = "nvim_lsp", + diagnostics_update_on_event = true, -- use nvim's diagnostic handler + diagnostics_indicator = function(count, level) + local icon = level:match("error") and " " or " " + return " " .. icon .. count + end, + offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } }, + -- ─< style >─────────────────────────────────────────────────────────────────────────── + indicator = { + icon = "▎", -- this should be omitted if indicator style is not 'icon' + style = "icon", + }, + 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 = "󰬫", + themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default + 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, + reveal = { "close" }, + hide = { "nvim_lsp" }, + }, + -- You can set buffer_mode to "list" or "tabbed" based on your preference. + buffer_mode = "list", + color_icons = true, -- whether or not to add the filetype icon highlights + }, + }, + config = function(_, opts) + require("bufferline").setup(opts) + -- Remap the tab key for buffer navigation (you can adjust the keys as needed) + vim.keymap.set("n", "", "BufferLineCycleNext") + vim.keymap.set("n", "", "BufferLineCyclePrev") + end, + }, + + -- ╭───────────────────────────────────────╮ + -- │ barbecue - for a nice breadcrump menu │ + -- ╰───────────────────────────────────────╯ + { + "utilyre/barbecue.nvim", + name = "barbecue", + version = "*", + dependencies = { + "SmiteshP/nvim-navic", + "echasnovski/mini.icons", -- optional dependency + }, + opts = { + theme = { + -- this highlight is used to override other highlights + -- you can take advantage of its `bg` and set a background throughout your winbar + -- (e.g. basename will look like this: { fg = "#c0caf5", bold = true }) + normal = { fg = "#c0caf5" }, + + -- these highlights correspond to symbols table from config + ellipsis = { fg = "#737aa2" }, + separator = { fg = "#737aa2" }, + modified = { fg = "#737aa2" }, + + -- these highlights represent the _text_ of three main parts of barbecue + dirname = { fg = "#737aa2" }, + basename = { bold = true }, + context = {}, + + -- these highlights are used for context/navic icons + context_file = { fg = "#ac8fe4" }, + context_module = { fg = "#ac8fe4" }, + context_namespace = { fg = "#ac8fe4" }, + context_package = { fg = "#ac8fe4" }, + context_class = { fg = "#ac8fe4" }, + context_method = { fg = "#ac8fe4" }, + context_property = { fg = "#ac8fe4" }, + context_field = { fg = "#ac8fe4" }, + context_constructor = { fg = "#ac8fe4" }, + context_enum = { fg = "#ac8fe4" }, + context_interface = { fg = "#ac8fe4" }, + context_function = { fg = "#ac8fe4" }, + context_variable = { fg = "#ac8fe4" }, + context_constant = { fg = "#ac8fe4" }, + context_string = { fg = "#ac8fe4" }, + context_number = { fg = "#ac8fe4" }, + context_boolean = { fg = "#ac8fe4" }, + context_array = { fg = "#ac8fe4" }, + context_object = { fg = "#ac8fe4" }, + context_key = { fg = "#ac8fe4" }, + context_null = { fg = "#ac8fe4" }, + context_enum_member = { fg = "#ac8fe4" }, + context_struct = { fg = "#ac8fe4" }, + context_event = { fg = "#ac8fe4" }, + context_operator = { fg = "#ac8fe4" }, + context_type_parameter = { fg = "#ac8fe4" }, + }, + }, + }, + -- ╭─────────────────────────────────╮ + -- │ indentlines - nice indent lines │ + -- ╰─────────────────────────────────╯ + { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPre", "BufNewFile" }, + main = "ibl", + opts = { + indent = { + char = "┊", + tab_char = "┊", + -- char = "│", + -- tab_char = "│", + }, + }, + }, + -- ╭────────────────────────────────────╮ + -- │ notify for excellent notifications │ + -- ╰────────────────────────────────────╯ + { + "rcarriga/nvim-notify", + config = function() + require("notify").setup({ + stages = "slide", + background_colour = "FloatShadow", + max_width = 120, + timeout = 2750, + render = "wrapped-compact", + -- Minimum/Maximum width for notification windows + minimum_width = 30, + maximum_width = 120, + + -- Function called when a new window is opened, use for changing win settings/config + on_open = nil, + + -- Function called when a window is closed + on_close = nil, + icons = { + ERROR = "", -- alternate symbol  + WARN = "", + INFO = "", + DEBUG = "", + TRACE = "", + }, + }) + vim.notify = require("notify") + end, + }, + -- ╭──────────────────────────────╮ + -- │ slimline - nice bar for nvim │ + -- ╰──────────────────────────────╯ + { + -- Calls `require('slimline').setup({})` + "sschleemilch/slimline.nvim", + opts = { + bold = true, -- makes primary parts and mode bold + 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 + components = { -- Choose components and their location + left = { + "mode", + -- "path", + -- "git", + }, + center = { + "path", + "git", + }, + right = { + "diagnostics", + "filetype_lsp", + "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 + last = false, -- hides the last separator + }, + left = "", -- left separator of components + right = "", -- right separator of components + }, + hl = { + modes = { + normal = "Type", -- highlight base of modes + insert = "Function", + pending = "Boolean", + visual = "Keyword", + command = "String", + }, + base = "Comment", -- highlight of everything in in between components + primary = "Normal", -- highlight of primary parts (e.g. filename) + secondary = "Comment", -- highlight of secondary parts (e.g. filepath) + }, + icons = { + diagnostics = { + ERROR = " ", + WARN = " ", + HINT = " ", + INFO = " ", + }, + git = { + branch = "", + }, + folder = " ", + lines = " ", + }, + }, + }, + + -- ╭────────────────────────────────────────╮ + -- │ which key - to know what to press next │ + -- ╰────────────────────────────────────────╯ + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 350 + end, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + }, +} diff --git a/lua/pika/plugins/which-key.lua b/lua/pika/plugins/which-key.lua deleted file mode 100644 index 809447f..0000000 --- a/lua/pika/plugins/which-key.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 350 - end, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, -} From 37c84420c111f92e45126ba0156dbe41ecf9c440 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 17 Mar 2025 15:14:06 +0100 Subject: [PATCH 03/36] restructure: removed some files, addet qol and ui for better distinguishability --- lua/pika/plugins/autopairs.lua | 30 -- lua/pika/plugins/barbecue.lua | 55 ---- lua/pika/plugins/bufferline.lua | 49 --- lua/pika/plugins/cmd-line.lua | 41 --- lua/pika/plugins/colorizer.lua | 72 ----- lua/pika/plugins/comment-box.lua | 40 --- lua/pika/plugins/comment.lua | 19 -- lua/pika/plugins/flash.lua | 15 - lua/pika/plugins/grug-far.lua | 22 -- lua/pika/plugins/indent-blankline.lua | 13 - lua/pika/plugins/{ => lsp}/nvim-cmp.lua | 0 .../nvim-treesitter-text-objects.lua | 0 lua/pika/plugins/{ => lsp}/treesitter.lua | 0 lua/pika/plugins/notify.lua | 29 -- lua/pika/plugins/qol.lua | 263 +++++++++++++++ lua/pika/plugins/scissors.lua | 12 - lua/pika/plugins/slimline.lua | 64 ---- lua/pika/plugins/surround.lua | 6 - lua/pika/plugins/ui.lua | 302 ++++++++++++++++++ lua/pika/plugins/which-key.lua | 13 - 20 files changed, 565 insertions(+), 480 deletions(-) delete mode 100644 lua/pika/plugins/autopairs.lua delete mode 100644 lua/pika/plugins/barbecue.lua delete mode 100644 lua/pika/plugins/bufferline.lua delete mode 100644 lua/pika/plugins/cmd-line.lua delete mode 100644 lua/pika/plugins/colorizer.lua delete mode 100644 lua/pika/plugins/comment-box.lua delete mode 100644 lua/pika/plugins/comment.lua delete mode 100644 lua/pika/plugins/flash.lua delete mode 100644 lua/pika/plugins/grug-far.lua delete mode 100644 lua/pika/plugins/indent-blankline.lua rename lua/pika/plugins/{ => lsp}/nvim-cmp.lua (100%) rename lua/pika/plugins/{ => lsp}/nvim-treesitter-text-objects.lua (100%) rename lua/pika/plugins/{ => lsp}/treesitter.lua (100%) delete mode 100644 lua/pika/plugins/notify.lua create mode 100644 lua/pika/plugins/qol.lua delete mode 100644 lua/pika/plugins/scissors.lua delete mode 100644 lua/pika/plugins/slimline.lua delete mode 100644 lua/pika/plugins/surround.lua create mode 100644 lua/pika/plugins/ui.lua delete mode 100644 lua/pika/plugins/which-key.lua diff --git a/lua/pika/plugins/autopairs.lua b/lua/pika/plugins/autopairs.lua deleted file mode 100644 index c9f5b9a..0000000 --- a/lua/pika/plugins/autopairs.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - "windwp/nvim-autopairs", - event = { "InsertEnter" }, - dependencies = { - "hrsh7th/nvim-cmp", - }, - config = function() - -- import nvim-autopairs - local autopairs = require("nvim-autopairs") - - -- configure autopairs - autopairs.setup({ - check_ts = true, -- enable treesitter - ts_config = { - lua = { "string" }, -- don't add pairs in lua string treesitter nodes - javascript = { "template_string" }, -- don't add pairs in javascript template_string treesitter nodes - java = false, -- don't check treesitter on java - }, - }) - - -- import nvim-autopairs completion functionality - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - - -- import nvim-cmp plugin (completions plugin) - local cmp = require("cmp") - - -- make autopairs and completion work together - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, -} diff --git a/lua/pika/plugins/barbecue.lua b/lua/pika/plugins/barbecue.lua deleted file mode 100644 index 86824d9..0000000 --- a/lua/pika/plugins/barbecue.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - "utilyre/barbecue.nvim", - name = "barbecue", - version = "*", - dependencies = { - "SmiteshP/nvim-navic", - "echasnovski/mini.icons", -- optional dependency - }, - opts = { - theme = { - -- this highlight is used to override other highlights - -- you can take advantage of its `bg` and set a background throughout your winbar - -- (e.g. basename will look like this: { fg = "#c0caf5", bold = true }) - normal = { fg = "#c0caf5" }, - - -- these highlights correspond to symbols table from config - ellipsis = { fg = "#737aa2" }, - separator = { fg = "#737aa2" }, - modified = { fg = "#737aa2" }, - - -- these highlights represent the _text_ of three main parts of barbecue - dirname = { fg = "#737aa2" }, - basename = { bold = true }, - context = {}, - - -- these highlights are used for context/navic icons - context_file = { fg = "#ac8fe4" }, - context_module = { fg = "#ac8fe4" }, - context_namespace = { fg = "#ac8fe4" }, - context_package = { fg = "#ac8fe4" }, - context_class = { fg = "#ac8fe4" }, - context_method = { fg = "#ac8fe4" }, - context_property = { fg = "#ac8fe4" }, - context_field = { fg = "#ac8fe4" }, - context_constructor = { fg = "#ac8fe4" }, - context_enum = { fg = "#ac8fe4" }, - context_interface = { fg = "#ac8fe4" }, - context_function = { fg = "#ac8fe4" }, - context_variable = { fg = "#ac8fe4" }, - context_constant = { fg = "#ac8fe4" }, - context_string = { fg = "#ac8fe4" }, - context_number = { fg = "#ac8fe4" }, - context_boolean = { fg = "#ac8fe4" }, - context_array = { fg = "#ac8fe4" }, - context_object = { fg = "#ac8fe4" }, - context_key = { fg = "#ac8fe4" }, - context_null = { fg = "#ac8fe4" }, - context_enum_member = { fg = "#ac8fe4" }, - context_struct = { fg = "#ac8fe4" }, - context_event = { fg = "#ac8fe4" }, - context_operator = { fg = "#ac8fe4" }, - context_type_parameter = { fg = "#ac8fe4" }, - }, - }, -} diff --git a/lua/pika/plugins/bufferline.lua b/lua/pika/plugins/bufferline.lua deleted file mode 100644 index 0a8c69a..0000000 --- a/lua/pika/plugins/bufferline.lua +++ /dev/null @@ -1,49 +0,0 @@ -return { - "akinsho/bufferline.nvim", - dependencies = { "echasnovski/mini.icons" }, - version = "*", - opts = { - options = { - diagnostics = "nvim_lsp", - diagnostics_update_on_event = true, -- use nvim's diagnostic handler - diagnostics_indicator = function(count, level) - local icon = level:match("error") and " " or " " - return " " .. icon .. count - end, - offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } }, - -- ─< style >─────────────────────────────────────────────────────────────────────────── - indicator = { - icon = "▎", -- this should be omitted if indicator style is not 'icon' - style = "icon", - }, - 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 = "󰬫", - themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default - 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, - reveal = { "close" }, - hide = { "nvim_lsp" }, - }, - -- You can set buffer_mode to "list" or "tabbed" based on your preference. - buffer_mode = "list", - color_icons = true, -- whether or not to add the filetype icon highlights - }, - }, - config = function(_, opts) - require("bufferline").setup(opts) - -- Remap the tab key for buffer navigation (you can adjust the keys as needed) - vim.keymap.set("n", "", "BufferLineCycleNext") - vim.keymap.set("n", "", "BufferLineCyclePrev") - end, -} diff --git a/lua/pika/plugins/cmd-line.lua b/lua/pika/plugins/cmd-line.lua deleted file mode 100644 index ea0e2f5..0000000 --- a/lua/pika/plugins/cmd-line.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - "VonHeikemen/fine-cmdline.nvim", - dependencies = { - { "MunifTanjim/nui.nvim" }, - }, - config = function() - require("fine-cmdline").setup({ - cmdline = { - enable_keymaps = true, - smart_history = true, - prompt = " ", - }, - popup = { - position = { - row = "10%", - col = "50%", - }, - size = { - width = "60%", - }, - border = { - style = "rounded", - }, - win_options = { - winhighlight = "Normal:Normal,FloatBorder:FloatBorder", - }, - }, - hooks = { - before_mount = function(input) - -- code - end, - after_mount = function(input) - -- code - end, - set_keymaps = function(imap, feedkeys) - -- code - end, - }, - }) - end, -} diff --git a/lua/pika/plugins/colorizer.lua b/lua/pika/plugins/colorizer.lua deleted file mode 100644 index 0d3dac4..0000000 --- a/lua/pika/plugins/colorizer.lua +++ /dev/null @@ -1,72 +0,0 @@ -return { - -- { - -- 'norcalli/nvim-colorizer.lua', - -- opts = { - -- 'css', - -- 'html', - -- 'php', - -- 'bash', - -- 'fish', - -- 'lua', - -- 'toml', - -- html = { - -- mode = 'foreground', - -- }, - -- }, - -- }, - "brenoprata10/nvim-highlight-colors", - opts = { - ---Render style - ---@usage 'background'|'foreground'|'virtual' - render = "background", - - ---Set virtual symbol (requires render to be set to 'virtual') - virtual_symbol = "■", - - ---Set virtual symbol suffix (defaults to '') - virtual_symbol_prefix = "", - - ---Set virtual symbol suffix (defaults to ' ') - virtual_symbol_suffix = " ", - - ---Set virtual symbol position() - ---@usage 'inline'|'eol'|'eow' - ---inline mimics VS Code style - ---eol stands for `end of column` - Recommended to set `virtual_symbol_suffix = ''` when used. - ---eow stands for `end of word` - Recommended to set `virtual_symbol_prefix = ' ' and virtual_symbol_suffix = ''` when used. - virtual_symbol_position = "inline", - - ---Highlight hex colors, e.g. '#FFFFFF' - enable_hex = true, - - ---Highlight short hex colors e.g. '#fff' - enable_short_hex = true, - - ---Highlight rgb colors, e.g. 'rgb(0 0 0)' - enable_rgb = true, - - ---Highlight hsl colors, e.g. 'hsl(150deg 30% 40%)' - enable_hsl = true, - - ---Highlight CSS variables, e.g. 'var(--testing-color)' - enable_var_usage = true, - - ---Highlight named colors, e.g. 'green' - enable_named_colors = true, - - ---Highlight tailwind colors, e.g. 'bg-blue-500' - enable_tailwind = false, - - ---Set custom colors - ---Label must be properly escaped with '%' to adhere to `string.gmatch` - --- :help string.gmatch - custom_colors = { - { label = "%-%-theme%-primary%-color", color = "#0f1219" }, - { label = "%-%-theme%-secondary%-color", color = "#5a5d64" }, - }, - - -- Exclude filetypes or buftypes from highlighting e.g. 'exclude_buftypes = {'text'}' - exclude_filetypes = {}, - exclude_buftypes = {}, - }, -} diff --git a/lua/pika/plugins/comment-box.lua b/lua/pika/plugins/comment-box.lua deleted file mode 100644 index bba9c90..0000000 --- a/lua/pika/plugins/comment-box.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - "LudoPinelli/comment-box.nvim", - lazy = false, - opts = { - comment_style = "line", - doc_width = 90, -- width of the document - box_width = 75, -- width of the boxes - line_width = 120, -- width of the lines - }, - -- ─< Comment-Box mappings >──────────────────────────────────────────────────────────── - vim.keymap.set("n", "cd", "CBd", { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" }), - vim.keymap.set("v", "cd", "CBd", { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" }), - - vim.keymap.set("n", "cy", "CBy", { noremap = true, silent = true, desc = "[y]ank content of Commentbox" }), - vim.keymap.set("v", "cy", "CBy", { noremap = true, silent = true, desc = "[y]ank content of Commentbox" }), - - vim.keymap.set("n", "cb", "CBlabox1", { noremap = true, silent = true, desc = "[c]reate comment [b]ox" }), - vim.keymap.set("v", "cb", "CBlabox1", { noremap = true, silent = true, desc = "[c]reate comment [b]ox" }), - vim.keymap.set( - "n", - "cB", - "CBcabox1", - { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } - ), - - vim.keymap.set( - "v", - "cB", - "CBcabox1", - { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } - ), - vim.keymap.set("n", "cc", "CBllbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment" }), - vim.keymap.set("v", "cc", "CBllbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment" }), - vim.keymap.set("n", "cC", "CBclbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" }), - vim.keymap.set("v", "cC", "CBclbox14", { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" }), - - vim.keymap.set("n", "cl", "CBllline8", { noremap = true, silent = true, desc = "[c]reate comment [l]ine" }), - vim.keymap.set("n", "cL", "CBlcline8", { noremap = true, silent = true, desc = "[c]reate comment [L]ine" }), - -} diff --git a/lua/pika/plugins/comment.lua b/lua/pika/plugins/comment.lua deleted file mode 100644 index a0f254e..0000000 --- a/lua/pika/plugins/comment.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - "numToStr/Comment.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "JoosepAlviste/nvim-ts-context-commentstring", - }, - config = function() - -- import comment plugin safely - local comment = require("Comment") - - local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim") - - -- enable comment - comment.setup({ - -- for commenting tsx, jsx, svelte, html files - pre_hook = ts_context_commentstring.create_pre_hook(), - }) - end, -} diff --git a/lua/pika/plugins/flash.lua b/lua/pika/plugins/flash.lua deleted file mode 100644 index 626eac9..0000000 --- a/lua/pika/plugins/flash.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - "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" }, - }, -} diff --git a/lua/pika/plugins/grug-far.lua b/lua/pika/plugins/grug-far.lua deleted file mode 100644 index 3768072..0000000 --- a/lua/pika/plugins/grug-far.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - "MagicDuck/grug-far.nvim", - opts = { headerMaxWidth = 80 }, - cmd = "GrugFar", - keys = { - { - "sr", - function() - local grug = require("grug-far") - local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") - grug.grug_far({ - transient = true, - prefills = { - filesFilter = ext and ext ~= "" and "*." .. ext or nil, - }, - }) - end, - mode = { "n", "v" }, - desc = "Search and Replace", - }, - }, -} diff --git a/lua/pika/plugins/indent-blankline.lua b/lua/pika/plugins/indent-blankline.lua deleted file mode 100644 index 67f9f38..0000000 --- a/lua/pika/plugins/indent-blankline.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPre", "BufNewFile" }, - main = "ibl", - opts = { - indent = { - char = "┊", - tab_char = "┊", - -- char = "│", - -- tab_char = "│", - }, - }, -} diff --git a/lua/pika/plugins/nvim-cmp.lua b/lua/pika/plugins/lsp/nvim-cmp.lua similarity index 100% rename from lua/pika/plugins/nvim-cmp.lua rename to lua/pika/plugins/lsp/nvim-cmp.lua diff --git a/lua/pika/plugins/nvim-treesitter-text-objects.lua b/lua/pika/plugins/lsp/nvim-treesitter-text-objects.lua similarity index 100% rename from lua/pika/plugins/nvim-treesitter-text-objects.lua rename to lua/pika/plugins/lsp/nvim-treesitter-text-objects.lua diff --git a/lua/pika/plugins/treesitter.lua b/lua/pika/plugins/lsp/treesitter.lua similarity index 100% rename from lua/pika/plugins/treesitter.lua rename to lua/pika/plugins/lsp/treesitter.lua diff --git a/lua/pika/plugins/notify.lua b/lua/pika/plugins/notify.lua deleted file mode 100644 index bcf486a..0000000 --- a/lua/pika/plugins/notify.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - "rcarriga/nvim-notify", - config = function() - require("notify").setup({ - stages = "slide", - background_colour = "FloatShadow", - max_width = 120, - timeout = 2750, - render = "wrapped-compact", - -- Minimum/Maximum width for notification windows - minimum_width = 30, - maximum_width = 120, - - -- Function called when a new window is opened, use for changing win settings/config - on_open = nil, - - -- Function called when a window is closed - on_close = nil, - icons = { - ERROR = "", -- alternate symbol  - WARN = "", - INFO = "", - DEBUG = "", - TRACE = "", - }, - }) - vim.notify = require("notify") - end, -} diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua new file mode 100644 index 0000000..c012d60 --- /dev/null +++ b/lua/pika/plugins/qol.lua @@ -0,0 +1,263 @@ +return { + -- ╭───────────╮ + -- │ autopairs │ + -- ╰───────────╯ + { + "windwp/nvim-autopairs", + event = { "InsertEnter" }, + dependencies = { + "hrsh7th/nvim-cmp", + }, + config = function() + -- import nvim-autopairs + local autopairs = require("nvim-autopairs") + + -- configure autopairs + autopairs.setup({ + check_ts = true, -- enable treesitter + ts_config = { + lua = { "string" }, -- don't add pairs in lua string treesitter nodes + javascript = { "template_string" }, -- don't add pairs in javascript template_string treesitter nodes + java = false, -- don't check treesitter on java + }, + }) + + -- import nvim-autopairs completion functionality + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + + -- import nvim-cmp plugin (completions plugin) + local cmp = require("cmp") + + -- make autopairs and completion work together + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, + + -- ╭─────────────────────────────────────╮ + -- │ ╭───────────────╮ │ + -- │ │ comment boxes │<- yes, those ones │ + -- │ ╰───────────────╯ │ + -- ╰─────────────────────────────────────╯ + { + "LudoPinelli/comment-box.nvim", + lazy = false, + opts = { + comment_style = "line", + doc_width = 90, -- width of the document + box_width = 75, -- width of the boxes + line_width = 120, -- width of the lines + }, + -- ───────────────────────────────< keymaps - commentboxes >─────────────────────────────── + vim.keymap.set( + "n", + "cd", + "CBd", + { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" } + ), + vim.keymap.set( + "v", + "cd", + "CBd", + { noremap = true, silent = true, desc = "[c]ommentbox [d]elete" } + ), + + vim.keymap.set( + "n", + "cy", + "CBy", + { noremap = true, silent = true, desc = "[y]ank content of Commentbox" } + ), + vim.keymap.set( + "v", + "cy", + "CBy", + { noremap = true, silent = true, desc = "[y]ank content of Commentbox" } + ), + + vim.keymap.set( + "n", + "cb", + "CBlabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox" } + ), + vim.keymap.set( + "v", + "cb", + "CBlabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox" } + ), + vim.keymap.set( + "n", + "cB", + "CBcabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } + ), + + vim.keymap.set( + "v", + "cB", + "CBcabox1", + { noremap = true, silent = true, desc = "[c]reate comment [b]ox (centered)" } + ), + vim.keymap.set( + "n", + "cc", + "CBllbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment" } + ), + vim.keymap.set( + "v", + "cc", + "CBllbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment" } + ), + vim.keymap.set( + "n", + "cC", + "CBclbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" } + ), + vim.keymap.set( + "v", + "cC", + "CBclbox14", + { noremap = true, silent = true, desc = "[c]reate [c]omment (C)entered" } + ), + + vim.keymap.set( + "n", + "cl", + "CBllline8", + { noremap = true, silent = true, desc = "[c]reate comment [l]ine" } + ), + vim.keymap.set( + "n", + "cL", + "CBlcline8", + { noremap = true, silent = true, desc = "[c]reate comment [L]ine" } + ), + }, + + -- ╭───────────╮ + -- │ colorizer │ + -- ╰───────────╯ + { + "brenoprata10/nvim-highlight-colors", + opts = { + ---Render style + ---@usage 'background'|'foreground'|'virtual' + render = "background", + + ---Set virtual symbol (requires render to be set to 'virtual') + virtual_symbol = "■", + + ---Set virtual symbol suffix (defaults to '') + virtual_symbol_prefix = "", + + ---Set virtual symbol suffix (defaults to ' ') + virtual_symbol_suffix = " ", + + ---Set virtual symbol position() + ---@usage 'inline'|'eol'|'eow' + ---inline mimics VS Code style + ---eol stands for `end of column` - Recommended to set `virtual_symbol_suffix = ''` when used. + ---eow stands for `end of word` - Recommended to set `virtual_symbol_prefix = ' ' and virtual_symbol_suffix = ''` when used. + virtual_symbol_position = "inline", + + ---Highlight hex colors, e.g. '#FFFFFF' + enable_hex = true, + + ---Highlight short hex colors e.g. '#fff' + enable_short_hex = true, + + ---Highlight rgb colors, e.g. 'rgb(0 0 0)' + enable_rgb = true, + + ---Highlight hsl colors, e.g. 'hsl(150deg 30% 40%)' + enable_hsl = true, + + ---Highlight CSS variables, e.g. 'var(--testing-color)' + enable_var_usage = true, + + ---Highlight named colors, e.g. 'green' + enable_named_colors = true, + + ---Highlight tailwind colors, e.g. 'bg-blue-500' + enable_tailwind = false, + + ---Set custom colors + ---Label must be properly escaped with '%' to adhere to `string.gmatch` + --- :help string.gmatch + custom_colors = { + { label = "%-%-theme%-primary%-color", color = "#0f1219" }, + { label = "%-%-theme%-secondary%-color", color = "#5a5d64" }, + }, + + -- Exclude filetypes or buftypes from highlighting e.g. 'exclude_buftypes = {'text'}' + exclude_filetypes = {}, + exclude_buftypes = {}, + }, + }, + + -- ╭──────────────────────────────────────╮ + -- │ 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) │ + -- ╰──────────────────────────────╯ + { + "MagicDuck/grug-far.nvim", + opts = { headerMaxWidth = 80 }, + cmd = "GrugFar", + -- ────────────────────────────────────< keybindings >───────────────────────────────── + keys = { + { + "sr", + function() + local grug = require("grug-far") + local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") + grug.grug_far({ + transient = true, + prefills = { + filesFilter = ext and ext ~= "" and "*." .. ext or nil, + }, + }) + end, + mode = { "n", "v" }, + desc = "Search and Replace", + }, + }, + }, + -- ╭──────────╮ + -- │ snippets │ + -- ╰──────────╯ + { + { + "chrisgrieser/nvim-scissors", + lazy = false, + dependencies = { "nvim-telescope/telescope.nvim", "garymjr/nvim-snippets" }, + opts = { + snippetDir = "~/.config/nvim/snippets", -- <- i have this as a submodule in my neovim config to have a seperate repo https://git.k4li.de/dotfiles/nvim-snippets.git + }, + }, + -- ──────────────────────────< keybindings for snippets engine >─────────────────────── + vim.keymap.set("n", "sm", ":ScissorsEditSnippet"), + vim.keymap.set("v", "sa", ":ScissorsAddNewSnippet"), + }, +} diff --git a/lua/pika/plugins/scissors.lua b/lua/pika/plugins/scissors.lua deleted file mode 100644 index 83bb295..0000000 --- a/lua/pika/plugins/scissors.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - { - "chrisgrieser/nvim-scissors", - lazy = false, - dependencies = { "nvim-telescope/telescope.nvim", "garymjr/nvim-snippets" }, - opts = { - snippetDir = "~/.config/nvim/snippets", - }, - }, - vim.keymap.set("n", "sm", ":ScissorsEditSnippet"), - vim.keymap.set("v", "sa", ":ScissorsAddNewSnippet"), -} diff --git a/lua/pika/plugins/slimline.lua b/lua/pika/plugins/slimline.lua deleted file mode 100644 index 07a16b0..0000000 --- a/lua/pika/plugins/slimline.lua +++ /dev/null @@ -1,64 +0,0 @@ -return { - -- Calls `require('slimline').setup({})` - "sschleemilch/slimline.nvim", - opts = { - bold = true, -- makes primary parts and mode bold - 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 - components = { -- Choose components and their location - left = { - "mode", - -- "path", - -- "git", - }, - center = { - "path", - "git", - }, - right = { - "diagnostics", - "filetype_lsp", - "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 - last = false, -- hides the last separator - }, - left = "", -- left separator of components - right = "", -- right separator of components - }, - hl = { - modes = { - normal = "Type", -- highlight base of modes - insert = "Function", - pending = "Boolean", - visual = "Keyword", - command = "String", - }, - base = "Comment", -- highlight of everything in in between components - primary = "Normal", -- highlight of primary parts (e.g. filename) - secondary = "Comment", -- highlight of secondary parts (e.g. filepath) - }, - icons = { - diagnostics = { - ERROR = " ", - WARN = " ", - HINT = " ", - INFO = " ", - }, - git = { - branch = "", - }, - folder = " ", - lines = " ", - }, - }, -} diff --git a/lua/pika/plugins/surround.lua b/lua/pika/plugins/surround.lua deleted file mode 100644 index 77f5073..0000000 --- a/lua/pika/plugins/surround.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "kylechui/nvim-surround", - event = { "BufReadPre", "BufNewFile" }, - version = "*", -- Use for stability; omit to use `main` branch for the latest features - config = true, -} diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua new file mode 100644 index 0000000..6215f69 --- /dev/null +++ b/lua/pika/plugins/ui.lua @@ -0,0 +1,302 @@ +return { + -- ╭───────────────────────────────────────╮ + -- │ bufferline - for mistakes and stuff.. │ + -- ╰───────────────────────────────────────╯ + { + "akinsho/bufferline.nvim", + dependencies = { "echasnovski/mini.icons" }, + version = "*", + opts = { + options = { + diagnostics = "nvim_lsp", + diagnostics_update_on_event = true, -- use nvim's diagnostic handler + diagnostics_indicator = function(count, level) + local icon = level:match("error") and " " or " " + return " " .. icon .. count + end, + offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } }, + -- ─< style >─────────────────────────────────────────────────────────────────────────── + indicator = { + icon = "▎", -- this should be omitted if indicator style is not 'icon' + style = "icon", + }, + 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 = "󰬫", + themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default + 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, + reveal = { "close" }, + hide = { "nvim_lsp" }, + }, + -- You can set buffer_mode to "list" or "tabbed" based on your preference. + buffer_mode = "list", + color_icons = true, -- whether or not to add the filetype icon highlights + }, + }, + config = function(_, opts) + require("bufferline").setup(opts) + -- Remap the tab key for buffer navigation (you can adjust the keys as needed) + vim.keymap.set("n", "", "BufferLineCycleNext") + vim.keymap.set("n", "", "BufferLineCyclePrev") + end, + }, + + -- ╭───────────────────────────────────╮ + -- │ cmdline - for nice command inputs │ + -- ╰───────────────────────────────────╯ + { + "VonHeikemen/fine-cmdline.nvim", + dependencies = { + { "MunifTanjim/nui.nvim" }, + }, + config = function() + require("fine-cmdline").setup({ + cmdline = { + enable_keymaps = true, + smart_history = true, + prompt = " ", + }, + popup = { + position = { + row = "10%", + col = "50%", + }, + size = { + width = "60%", + }, + border = { + style = "rounded", + }, + win_options = { + winhighlight = "Normal:Normal,FloatBorder:FloatBorder", + }, + }, + hooks = { + before_mount = function(input) + -- code + end, + after_mount = function(input) + -- code + end, + set_keymaps = function(imap, feedkeys) + -- code + end, + }, + }) + end, + }, + + -- ╭───────────────────────────────────────╮ + -- │ barbecue - for a nice breadcrump menu │ + -- ╰───────────────────────────────────────╯ + { + "utilyre/barbecue.nvim", + name = "barbecue", + version = "*", + dependencies = { + "SmiteshP/nvim-navic", + "echasnovski/mini.icons", -- optional dependency + }, + opts = { + theme = { + -- this highlight is used to override other highlights + -- you can take advantage of its `bg` and set a background throughout your winbar + -- (e.g. basename will look like this: { fg = "#c0caf5", bold = true }) + normal = { fg = "#c0caf5" }, + + -- these highlights correspond to symbols table from config + ellipsis = { fg = "#737aa2" }, + separator = { fg = "#737aa2" }, + modified = { fg = "#737aa2" }, + + -- these highlights represent the _text_ of three main parts of barbecue + dirname = { fg = "#737aa2" }, + basename = { bold = true }, + context = {}, + + -- these highlights are used for context/navic icons + context_file = { fg = "#ac8fe4" }, + context_module = { fg = "#ac8fe4" }, + context_namespace = { fg = "#ac8fe4" }, + context_package = { fg = "#ac8fe4" }, + context_class = { fg = "#ac8fe4" }, + context_method = { fg = "#ac8fe4" }, + context_property = { fg = "#ac8fe4" }, + context_field = { fg = "#ac8fe4" }, + context_constructor = { fg = "#ac8fe4" }, + context_enum = { fg = "#ac8fe4" }, + context_interface = { fg = "#ac8fe4" }, + context_function = { fg = "#ac8fe4" }, + context_variable = { fg = "#ac8fe4" }, + context_constant = { fg = "#ac8fe4" }, + context_string = { fg = "#ac8fe4" }, + context_number = { fg = "#ac8fe4" }, + context_boolean = { fg = "#ac8fe4" }, + context_array = { fg = "#ac8fe4" }, + context_object = { fg = "#ac8fe4" }, + context_key = { fg = "#ac8fe4" }, + context_null = { fg = "#ac8fe4" }, + context_enum_member = { fg = "#ac8fe4" }, + context_struct = { fg = "#ac8fe4" }, + context_event = { fg = "#ac8fe4" }, + context_operator = { fg = "#ac8fe4" }, + context_type_parameter = { fg = "#ac8fe4" }, + }, + }, + }, + -- ╭─────────────────────────────────╮ + -- │ indentlines - nice indent lines │ + -- ╰─────────────────────────────────╯ + { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPre", "BufNewFile" }, + main = "ibl", + opts = { + indent = { + char = "┊", + tab_char = "┊", + -- char = "│", + -- tab_char = "│", + }, + }, + }, + + -- ╭──────────────────╮ + -- │ markdown plugins │ + -- ╰──────────────────╯ + { + "MeanderingProgrammer/render-markdown.nvim", + opts = {}, + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite + dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" }, -- if you use standalone mini plugins + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + }, + + -- ╭────────────────────────────────────╮ + -- │ notify for excellent notifications │ + -- ╰────────────────────────────────────╯ + { + "rcarriga/nvim-notify", + config = function() + require("notify").setup({ + stages = "slide", + background_colour = "FloatShadow", + max_width = 120, + timeout = 2750, + render = "wrapped-compact", + -- Minimum/Maximum width for notification windows + minimum_width = 30, + maximum_width = 120, + + -- Function called when a new window is opened, use for changing win settings/config + on_open = nil, + + -- Function called when a window is closed + on_close = nil, + icons = { + ERROR = "", -- alternate symbol  + WARN = "", + INFO = "", + DEBUG = "", + TRACE = "", + }, + }) + vim.notify = require("notify") + end, + }, + -- ╭──────────────────────────────╮ + -- │ slimline - nice bar for nvim │ + -- ╰──────────────────────────────╯ + { + -- Calls `require('slimline').setup({})` + "sschleemilch/slimline.nvim", + opts = { + bold = true, -- makes primary parts and mode bold + 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 + components = { -- Choose components and their location + left = { + "mode", + -- "path", + -- "git", + }, + center = { + "path", + "git", + }, + right = { + "diagnostics", + "filetype_lsp", + "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 + last = false, -- hides the last separator + }, + left = "", -- left separator of components + right = "", -- right separator of components + }, + hl = { + modes = { + normal = "Type", -- highlight base of modes + insert = "Function", + pending = "Boolean", + visual = "Keyword", + command = "String", + }, + base = "Comment", -- highlight of everything in in between components + primary = "Normal", -- highlight of primary parts (e.g. filename) + secondary = "Comment", -- highlight of secondary parts (e.g. filepath) + }, + icons = { + diagnostics = { + ERROR = " ", + WARN = " ", + HINT = " ", + INFO = " ", + }, + git = { + branch = "", + }, + folder = " ", + lines = " ", + }, + }, + }, + + -- ╭────────────────────────────────────────╮ + -- │ which key - to know what to press next │ + -- ╰────────────────────────────────────────╯ + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 350 + end, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + }, +} diff --git a/lua/pika/plugins/which-key.lua b/lua/pika/plugins/which-key.lua deleted file mode 100644 index 809447f..0000000 --- a/lua/pika/plugins/which-key.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 350 - end, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, -} From 51a6f4f2497528820855c7ef3f8830e0438b2078 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 17 Mar 2025 17:43:31 +0100 Subject: [PATCH 04/36] add: addet keymap to insert command output directly --- lua/pika/core/keymaps.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index 633eb1c..0a54da3 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -61,3 +61,22 @@ map("n", "R", [[:%s/\<\>//gI]]) -- window management map("n", "sv", "v", { desc = "Split window vertically" }) -- split window vertically map("n", "sh", "s", { desc = "Split window horizontally" }) -- split window horizontally + +vim.keymap.set({ "n", "v" }, "tt", function() + -- Frage den Shell-Command ab + vim.ui.input({ prompt = "Shell Command: " }, function(cmd) + if cmd == nil or cmd == "" then + return + end + + local handle = io.popen(cmd) + local result = handle:read("*a") + handle:close() + + local lines = vim.split(result, "\n", { trimempty = true }) + + -- Einfügen an Cursor-Position + local row, col = unpack(vim.api.nvim_win_get_cursor(0)) + vim.api.nvim_buf_set_lines(0, row, row, false, lines) + end) +end, { desc = "Insert Shell Output at Cursor" }) From c163136c6f047804e8455285ae61bf90dc7f687e Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 17 Mar 2025 18:16:22 +0100 Subject: [PATCH 05/36] . --- lua/pika/core/keymaps.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index 0a54da3..e24df43 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -62,20 +62,24 @@ map("n", "R", [[:%s/\<\>//gI]]) map("n", "sv", "v", { desc = "Split window vertically" }) -- split window vertically map("n", "sh", "s", { desc = "Split window horizontally" }) -- split window horizontally -vim.keymap.set({ "n", "v" }, "tt", function() +vim.keymap.set({ "n", "i" }, "tt", function() -- Frage den Shell-Command ab vim.ui.input({ prompt = "Shell Command: " }, function(cmd) if cmd == nil or cmd == "" then return end - local handle = io.popen(cmd) - local result = handle:read("*a") - handle:close() + local result = vim.fn.system(cmd) + local exit_code = vim.v.shell_error + + if exit_code ~= 0 then + vim.notify("Shell Error:\n" .. result, vim.log.levels.ERROR, { title = "Shell Command Failed" }) + return + end local lines = vim.split(result, "\n", { trimempty = true }) - -- Einfügen an Cursor-Position + -- Insert at cursor position local row, col = unpack(vim.api.nvim_win_get_cursor(0)) vim.api.nvim_buf_set_lines(0, row, row, false, lines) end) From 2d8f9c127b9573271e4c043f8156a3c31194e422 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 17 Mar 2025 18:54:25 +0100 Subject: [PATCH 06/36] fix: addet keymaps for cmdline directly into the plugin file --- lua/pika/core/keymaps.lua | 4 ---- lua/pika/plugins/ui.lua | 24 +++++++++++++----------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index e24df43..6f205cd 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -16,10 +16,6 @@ map("n", "", "nohlsearch") map("n", "", "gcc", { desc = "comment toggle", remap = true }) map("v", "", "gc", { desc = "comment toggle", remap = true }) --- ─< cmd line >──────────────────────────────────────────────────────────────────────── -vim.api.nvim_set_keymap("n", ":", "FineCmdline", { noremap = true }) -map("n", "T", "FineCmdline") - -- ─< Terminal >──────────────────────────────────────────────────────────────────────── map("t", "", "", { desc = "terminal escape terminal mode" }) diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua index 6215f69..797645d 100644 --- a/lua/pika/plugins/ui.lua +++ b/lua/pika/plugins/ui.lua @@ -82,19 +82,21 @@ return { winhighlight = "Normal:Normal,FloatBorder:FloatBorder", }, }, - hooks = { - before_mount = function(input) - -- code - end, - after_mount = function(input) - -- code - end, - set_keymaps = function(imap, feedkeys) - -- code - end, - }, + -- hooks = { + -- before_mount = function(input) + -- -- code + -- end, + -- after_mount = function(input) + -- -- code + -- end, + -- set_keymaps = function(imap, feedkeys) + -- -- code + -- end, + -- }, }) end, + vim.api.nvim_set_keymap("n", ":", "FineCmdline", { noremap = true }), + vim.keymap.set("n", "T", "FineCmdline"), }, -- ╭───────────────────────────────────────╮ From d803c6ad5342f2609f01527b1d0e3efed9b4553d Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 17 Mar 2025 18:57:09 +0100 Subject: [PATCH 07/36] fix: addet keymaps for cmdline directly into the plugin file --- lua/pika/core/keymaps.lua | 4 ---- lua/pika/plugins/ui.lua | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index 633eb1c..57203c8 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -16,10 +16,6 @@ map("n", "", "nohlsearch") map("n", "", "gcc", { desc = "comment toggle", remap = true }) map("v", "", "gc", { desc = "comment toggle", remap = true }) --- ─< cmd line >──────────────────────────────────────────────────────────────────────── -vim.api.nvim_set_keymap("n", ":", "FineCmdline", { noremap = true }) -map("n", "T", "FineCmdline") - -- ─< Terminal >──────────────────────────────────────────────────────────────────────── map("t", "", "", { desc = "terminal escape terminal mode" }) diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua index 969fe37..be74965 100644 --- a/lua/pika/plugins/ui.lua +++ b/lua/pika/plugins/ui.lua @@ -51,6 +51,41 @@ return { vim.keymap.set("n", "", "BufferLineCyclePrev") end, }, + -- ╭───────────────────────────────────╮ + -- │ cmdline - for nice command inputs │ + -- ╰───────────────────────────────────╯ + { + "VonHeikemen/fine-cmdline.nvim", + dependencies = { + { "MunifTanjim/nui.nvim" }, + }, + config = function() + require("fine-cmdline").setup({ + cmdline = { + enable_keymaps = true, + smart_history = true, + prompt = " ", + }, + popup = { + position = { + row = "10%", + col = "50%", + }, + size = { + width = "60%", + }, + border = { + style = "rounded", + }, + win_options = { + winhighlight = "Normal:Normal,FloatBorder:FloatBorder", + }, + }, + }) + end, + vim.api.nvim_set_keymap("n", ":", "FineCmdline", { noremap = true }), + vim.keymap.set("n", "T", "FineCmdline"), + }, -- ╭───────────────────────────────────────╮ -- │ barbecue - for a nice breadcrump menu │ From 5bebc11dcbd60e145fac25b0fc828f3bc2cdb3c3 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 20 Mar 2025 18:37:24 +0100 Subject: [PATCH 08/36] fix: gitsigns line --- lua/pika/plugins/git.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pika/plugins/git.lua b/lua/pika/plugins/git.lua index ace065d..b6cfc5c 100644 --- a/lua/pika/plugins/git.lua +++ b/lua/pika/plugins/git.lua @@ -174,7 +174,7 @@ return { signs_staged_enable = true, signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` numhl = true, -- Toggle with `:Gitsigns toggle_numhl` - linehl = true, -- Toggle with `:Gitsigns toggle_linehl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` watch_gitdir = { follow_files = true, From 6822a716853ba9a8d2345a3583000ca378b22653 Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 22 Mar 2025 10:57:30 +0100 Subject: [PATCH 09/36] fix: when using cursor or vscode, use only keymap settings, else use everything --- init.lua | 81 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/init.lua b/init.lua index 68f2a4d..13aae1b 100644 --- a/init.lua +++ b/init.lua @@ -1,44 +1,53 @@ -require("pika.core") -require("pika.lazy") +if vim.g.vscode then + require("pika.core") +else + require("pika.core") + require("pika.lazy") --- ─< Call the function to set the desired colorscheme >──────────────────────────────── --- ╭──────────────────────────────────────────────────────╮ --- │ themes are under ./lua/pika/plugins/colorschemes.lua │ --- ╰──────────────────────────────────────────────────────╯ + -- ─< Call the function to set the desired colorscheme >──────────────────────────────── + -- ╭──────────────────────────────────────────────────────╮ + -- │ themes are under ./lua/pika/plugins/colorschemes.lua │ + -- ╰──────────────────────────────────────────────────────╯ -vim.cmd.colorscheme("oldschool") + vim.cmd.colorscheme("oldschool") --- Keybind for saving clipboard screenshot and inserting a Markdown link -vim.api.nvim_set_keymap("n", "ps", ":lua SaveScreenshotAndInsertLink()", { noremap = true, silent = true }) + -- Keybind for saving clipboard screenshot and inserting a Markdown link + vim.api.nvim_set_keymap( + "n", + "ps", + ":lua SaveScreenshotAndInsertLink()", + { noremap = true, silent = true } + ) -function SaveScreenshotAndInsertLink() - -- Prompt for Hugo base directory if needed + function SaveScreenshotAndInsertLink() + -- Prompt for Hugo base directory if needed - -- Define the Hugo base directory and screenshot subfolder path - local base_dir - local current_file_dir = vim.fn.expand("%:p:h") + -- Define the Hugo base directory and screenshot subfolder path + local base_dir + local current_file_dir = vim.fn.expand("%:p:h") - -- Detect base dir by looking for the Hugo structure, or prompt if not found - if current_file_dir:match("/content/") then - base_dir = current_file_dir:match("(.*)/content/") - else - -- Prompt for Hugo base directory if automatic detection fails - base_dir = vim.fn.input("Enter base directory of your Hugo site: ", "", "file") + -- Detect base dir by looking for the Hugo structure, or prompt if not found + if current_file_dir:match("/content/") then + base_dir = current_file_dir:match("(.*)/content/") + else + -- Prompt for Hugo base directory if automatic detection fails + base_dir = vim.fn.input("Enter base directory of your Hugo site: ", "", "file") + end + + local img_folder = base_dir .. "/static/images/screenshots/" + vim.fn.mkdir(img_folder, "p") -- Ensure the directory exists + + -- Define the image name and full path + local img_name = os.date("%Y-%m-%d_%H-%M-%S") .. ".png" + local full_path = img_folder .. img_name + + -- Save clipboard image as binary PNG file using wl-paste + os.execute("wl-paste --type image/png > " .. full_path) + + -- Insert markdown image link at cursor position + local img_markdown = "![](/images/screenshots/" .. img_name .. ")\n" + vim.api.nvim_put({ img_markdown }, "c", true, true) + + print("Screenshot saved and link added: " .. full_path) end - - local img_folder = base_dir .. "/static/images/screenshots/" - vim.fn.mkdir(img_folder, "p") -- Ensure the directory exists - - -- Define the image name and full path - local img_name = os.date("%Y-%m-%d_%H-%M-%S") .. ".png" - local full_path = img_folder .. img_name - - -- Save clipboard image as binary PNG file using wl-paste - os.execute("wl-paste --type image/png > " .. full_path) - - -- Insert markdown image link at cursor position - local img_markdown = "![](/images/screenshots/" .. img_name .. ")\n" - vim.api.nvim_put({ img_markdown }, "c", true, true) - - print("Screenshot saved and link added: " .. full_path) end From cc73f3754df54d2138cc14df12571158432474f0 Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 23 Mar 2025 13:02:12 +0100 Subject: [PATCH 10/36] made it not transparent --- lua/pika/plugins/colorschemes.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua index d977b29..d18bdd8 100644 --- a/lua/pika/plugins/colorschemes.lua +++ b/lua/pika/plugins/colorschemes.lua @@ -49,7 +49,7 @@ return { name = "cyberdream", lazy = false, opts = { - transparent = true, + transparent = false, hide_fillchars = true, terminal_colors = true, }, From b2214571048854dbed7f8660cfbce77470c96689 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 24 Mar 2025 15:41:29 +0100 Subject: [PATCH 11/36] feat: inline insert if only one line --- lua/pika/core/keymaps.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index 6f205cd..69fc905 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -77,6 +77,13 @@ vim.keymap.set({ "n", "i" }, "tt", function() -- Insert at cursor position local row, col = unpack(vim.api.nvim_win_get_cursor(0)) - vim.api.nvim_buf_set_lines(0, row, row, false, lines) + if #lines == 1 then + -- Insert inline if the result is a single line + local current_line = vim.api.nvim_get_current_line() + local new_line = current_line:sub(1, col) .. lines[1] .. current_line:sub(col + 1) + vim.api.nvim_set_current_line(new_line) + else + vim.api.nvim_buf_set_lines(0, row, row, false, lines) + end end) end, { desc = "Insert Shell Output at Cursor" }) From 96b01584c5c31bbb08e731125e1f8b7462a4b358 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 27 Mar 2025 10:09:00 +0100 Subject: [PATCH 12/36] change: changed from nvimcmp to blinkcmp in one file with lsp configs (have two files for either blink or nvim-cmp) --- lua/pika/plugins/lsp/blink-cmp.lua | 440 ++++++++++++++++++ lua/pika/plugins/lsp/lspconfig.lua | 132 ------ .../lsp/{nvim-cmp.lua => nvim-cmp.lua.bak} | 132 ++++++ 3 files changed, 572 insertions(+), 132 deletions(-) create mode 100644 lua/pika/plugins/lsp/blink-cmp.lua delete mode 100644 lua/pika/plugins/lsp/lspconfig.lua rename lua/pika/plugins/lsp/{nvim-cmp.lua => nvim-cmp.lua.bak} (51%) diff --git a/lua/pika/plugins/lsp/blink-cmp.lua b/lua/pika/plugins/lsp/blink-cmp.lua new file mode 100644 index 0000000..a0e3b74 --- /dev/null +++ b/lua/pika/plugins/lsp/blink-cmp.lua @@ -0,0 +1,440 @@ +return { + -- ╭───────────╮ + -- │ blink.cmp │ + -- ╰───────────╯ + { + "saghen/blink.cmp", + -- optional: provides snippets for the snippet source + dependencies = { "rafamadriz/friendly-snippets" }, + + -- use a release tag to download pre-built binaries + version = "1.*", + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + keymap = { + -- set to 'none' to disable the 'default' preset + preset = "super-tab", + + [""] = { "select_prev", "fallback" }, + [""] = { "select_next", "fallback" }, + [""] = { "hide", "fallback" }, + + -- disable a keymap from the preset + [""] = {}, + [""] = {}, + [""] = {}, + + -- show with a list of providers + -- [""] = { + -- function(cmp) + -- cmp.show({ providers = { "snippets" } }) + -- end, + -- }, + + -- control whether the next command will be run when using a function + -- [""] = { + -- function(cmp) + -- if some_condition then + -- return + -- end -- runs the next command + -- return true -- doesn't run the next command + -- end, + -- "select_next", + -- }, + }, + + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = "mono", + + highlight_ns = vim.api.nvim_create_namespace("blink_cmp"), + -- Sets the fallback highlight groups to nvim-cmp's highlight groups + -- Useful for when your theme doesn't support blink.cmp + -- Will be removed in a future release + + use_nvim_cmp_as_default = true, + }, + + -- (Default) Only show the documentation popup when manually triggered + completion = { + documentation = { + auto_show = false, + auto_show_delay_ms = 230, + update_delay_ms = 50, + treesitter_highlighting = false, + draw = function(opts) + opts.default_implementation() + end, + window = { + min_width = 16, + max_width = 80, + max_height = 24, + border = "padded", -- Defaults to `vim.o.winborder` on nvim 0.11+ or 'padded' when not defined/<=0.10 + winblend = 0, + winhighlight = "Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,EndOfBuffer:BlinkCmpDoc", + -- Note that the gutter will be disabled when border ~= 'none' + scrollbar = true, + }, + }, + ghost_text = { + enabled = true, + show_with_selection = true, + show_without_selection = true, + show_with_menu = true, + show_without_menu = true, + }, + + -- ─────────────────────────────────< mini-icons config >────────────────────────────── + menu = { + draw = { + columns = { { "kind_icon" }, { "label", gap = 1 } }, + components = { + label = { + text = function(ctx) + return require("colorful-menu").blink_components_text(ctx) + end, + highlight = function(ctx) + return require("colorful-menu").blink_components_highlight(ctx) + end, + }, + kind_icon = { + text = function(ctx) + local kind_icon, _, _ = require("mini.icons").get("lsp", ctx.kind) + return kind_icon + end, + -- (optional) use highlights from mini.icons + highlight = function(ctx) + local _, hl, _ = require("mini.icons").get("lsp", ctx.kind) + return hl + end, + }, + + -- kind = { + -- -- (optional) use highlights from mini.icons + -- highlight = function(ctx) + -- local _, hl, _ = require("mini.icons").get("lsp", ctx.kind) + -- return hl + -- end, + -- }, + }, + }, + }, + }, + + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + default = { "lsp", "path", "snippets", "buffer" }, + }, + + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, + -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` + -- + -- See the fuzzy documentation for more information + fuzzy = { implementation = "prefer_rust" }, + }, + opts_extend = { "sources.default" }, + }, + + -- ─────────────────────────────────< colorful menu.nvim >───────────────────────────────── + { + "xzbdmw/colorful-menu.nvim", + opts = { + { + ls = { + lua_ls = { + -- Maybe you want to dim arguments a bit. + arguments_hl = "@comment", + }, + gopls = { + -- By default, we render variable/function's type in the right most side, + -- to make them not to crowd together with the original label. + + -- when true: + -- foo *Foo + -- ast "go/ast" + + -- when false: + -- foo *Foo + -- ast "go/ast" + align_type_to_right = true, + -- When true, label for field and variable will format like "foo: Foo" + -- instead of go's original syntax "foo Foo". If align_type_to_right is + -- true, this option has no effect. + add_colon_before_type = false, + -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + preserve_type_when_truncate = true, + }, + -- for lsp_config or typescript-tools + ts_ls = { + -- false means do not include any extra info, + -- see https://github.com/xzbdmw/colorful-menu.nvim/issues/42 + extra_info_hl = "@comment", + }, + vtsls = { + -- false means do not include any extra info, + -- see https://github.com/xzbdmw/colorful-menu.nvim/issues/42 + extra_info_hl = "@comment", + }, + ["rust-analyzer"] = { + -- Such as (as Iterator), (use std::io). + extra_info_hl = "@comment", + -- Similar to the same setting of gopls. + align_type_to_right = true, + -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + preserve_type_when_truncate = true, + }, + clangd = { + -- Such as "From ". + extra_info_hl = "@comment", + -- Similar to the same setting of gopls. + align_type_to_right = true, + -- the hl group of leading dot of "•std::filesystem::permissions(..)" + import_dot_hl = "@comment", + -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + preserve_type_when_truncate = true, + }, + zls = { + -- Similar to the same setting of gopls. + align_type_to_right = true, + }, + roslyn = { + extra_info_hl = "@comment", + }, + dartls = { + extra_info_hl = "@comment", + }, + -- The same applies to pyright/pylance + basedpyright = { + -- It is usually import path such as "os" + extra_info_hl = "@comment", + }, + -- If true, try to highlight "not supported" languages. + fallback = true, + -- this will be applied to label description for unsupport languages + fallback_extra_info_hl = "@comment", + }, + -- If the built-in logic fails to find a suitable highlight group for a label, + -- this highlight is applied to the label. + fallback_highlight = "@variable", + -- If provided, the plugin truncates the final displayed text to + -- this width (measured in display cells). Any highlights that extend + -- beyond the truncation point are ignored. When set to a float + -- between 0 and 1, it'll be treated as percentage of the width of + -- the window: math.floor(max_width * vim.api.nvim_win_get_width(0)) + -- Default 60. + max_width = 60, + }, + }, + -- config = function() + -- -- You don't need to set these options. + -- require("colorful-menu").setup({ + -- ls = { + -- lua_ls = { + -- -- Maybe you want to dim arguments a bit. + -- arguments_hl = "@comment", + -- }, + -- gopls = { + -- -- By default, we render variable/function's type in the right most side, + -- -- to make them not to crowd together with the original label. + -- + -- -- when true: + -- -- foo *Foo + -- -- ast "go/ast" + -- + -- -- when false: + -- -- foo *Foo + -- -- ast "go/ast" + -- align_type_to_right = true, + -- -- When true, label for field and variable will format like "foo: Foo" + -- -- instead of go's original syntax "foo Foo". If align_type_to_right is + -- -- true, this option has no effect. + -- add_colon_before_type = false, + -- -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + -- preserve_type_when_truncate = true, + -- }, + -- -- for lsp_config or typescript-tools + -- ts_ls = { + -- -- false means do not include any extra info, + -- -- see https://github.com/xzbdmw/colorful-menu.nvim/issues/42 + -- extra_info_hl = "@comment", + -- }, + -- vtsls = { + -- -- false means do not include any extra info, + -- -- see https://github.com/xzbdmw/colorful-menu.nvim/issues/42 + -- extra_info_hl = "@comment", + -- }, + -- ["rust-analyzer"] = { + -- -- Such as (as Iterator), (use std::io). + -- extra_info_hl = "@comment", + -- -- Similar to the same setting of gopls. + -- align_type_to_right = true, + -- -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + -- preserve_type_when_truncate = true, + -- }, + -- clangd = { + -- -- Such as "From ". + -- extra_info_hl = "@comment", + -- -- Similar to the same setting of gopls. + -- align_type_to_right = true, + -- -- the hl group of leading dot of "•std::filesystem::permissions(..)" + -- import_dot_hl = "@comment", + -- -- See https://github.com/xzbdmw/colorful-menu.nvim/pull/36 + -- preserve_type_when_truncate = true, + -- }, + -- zls = { + -- -- Similar to the same setting of gopls. + -- align_type_to_right = true, + -- }, + -- roslyn = { + -- extra_info_hl = "@comment", + -- }, + -- dartls = { + -- extra_info_hl = "@comment", + -- }, + -- -- The same applies to pyright/pylance + -- basedpyright = { + -- -- It is usually import path such as "os" + -- extra_info_hl = "@comment", + -- }, + -- -- If true, try to highlight "not supported" languages. + -- fallback = true, + -- -- this will be applied to label description for unsupport languages + -- fallback_extra_info_hl = "@comment", + -- }, + -- -- If the built-in logic fails to find a suitable highlight group for a label, + -- -- this highlight is applied to the label. + -- fallback_highlight = "@variable", + -- -- If provided, the plugin truncates the final displayed text to + -- -- this width (measured in display cells). Any highlights that extend + -- -- beyond the truncation point are ignored. When set to a float + -- -- between 0 and 1, it'll be treated as percentage of the width of + -- -- the window: math.floor(max_width * vim.api.nvim_win_get_width(0)) + -- -- Default 60. + -- max_width = 60, + -- }) + -- end, + }, + -- ╭───────────╮ + -- │ lspconfig │ + -- ╰───────────╯ + { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { "saghen/blink.cmp" }, + { "antosha417/nvim-lsp-file-operations", config = true }, + { "folke/neodev.nvim", opts = {} }, + }, + + config = function() + local lspconfig = require("lspconfig") + local capabilities = require("blink.cmp").get_lsp_capabilities() + local mason_lspconfig = require("mason-lspconfig") + + -- Change the Diagnostic symbols in the sign column (gutter) + -- (not in youtube nvim video) + local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + + mason_lspconfig.setup_handlers({ + function(server_name) + lspconfig[server_name].setup({ + capabilities = capabilities, + }) + end, + ["svelte"] = function() + lspconfig["svelte"].setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd("BufWritePost", { + pattern = { "*.js", "*.ts" }, + callback = function(ctx) + client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match }) + end, + }) + end, + }) + end, + ["graphql"] = function() + lspconfig["graphql"].setup({ + capabilities = capabilities, + filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" }, + }) + end, + ["emmet_ls"] = function() + lspconfig["emmet_ls"].setup({ + capabilities = capabilities, + filetypes = { + "html", + "typescriptreact", + "javascriptreact", + "css", + "sass", + "scss", + "less", + "svelte", + }, + }) + end, + ["lua_ls"] = function() + lspconfig["lua_ls"].setup({ + capabilities = capabilities, + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + }) + end, + ["cssls"] = function() + lspconfig["cssls"].setup({ + capabilities = capabilities, + filetypes = { "css", "scss" }, + }) + end, + ["intelephense"] = function() + lspconfig["intelephense"].setup({ + capabilities = capabilities, + filetypes = { "php", "blade.php" }, + }) + end, + -- ["tsserver"] = function() + -- -- Replace tsserver with typescript-language-server + -- lspconfig["typescript-language-server"].setup({ + -- capabilities = capabilities, + -- filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" }, + -- }) + -- end, + }) + end, + }, +} diff --git a/lua/pika/plugins/lsp/lspconfig.lua b/lua/pika/plugins/lsp/lspconfig.lua deleted file mode 100644 index 4b68229..0000000 --- a/lua/pika/plugins/lsp/lspconfig.lua +++ /dev/null @@ -1,132 +0,0 @@ -return { - "neovim/nvim-lspconfig", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - { - "hrsh7th/nvim-cmp", - dependencies = { "hrsh7th/cmp-nvim-lsp", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip" }, - }, - { "antosha417/nvim-lsp-file-operations", config = true }, - { "folke/neodev.nvim", opts = {} }, - }, - - config = function() - local lspconfig = require("lspconfig") - local mason_lspconfig = require("mason-lspconfig") - local cmp_nvim_lsp = require("cmp_nvim_lsp") - local keymap = vim.keymap - - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("UserLspConfig", {}), - callback = function(ev) - -- Buffer local mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - local opts = { buffer = ev.buf, silent = true } - - opts.desc = "See available code actions" - keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection - - opts.desc = "Smart rename" - keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename - - opts.desc = "Show buffer diagnostics" - keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file - - opts.desc = "Show line diagnostics" - keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line - - opts.desc = "Show documentation for what is under cursor" - keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor - - opts.desc = "Restart LSP" - keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary - end, - }) - -- used to enable autocompletion (assign to every lsp server config) - local capabilities = cmp_nvim_lsp.default_capabilities() - - -- Change the Diagnostic symbols in the sign column (gutter) - -- (not in youtube nvim video) - local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) - end - - mason_lspconfig.setup_handlers({ - function(server_name) - lspconfig[server_name].setup({ - capabilities = capabilities, - }) - end, - ["svelte"] = function() - lspconfig["svelte"].setup({ - capabilities = capabilities, - on_attach = function(client, bufnr) - vim.api.nvim_create_autocmd("BufWritePost", { - pattern = { "*.js", "*.ts" }, - callback = function(ctx) - client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match }) - end, - }) - end, - }) - end, - ["graphql"] = function() - lspconfig["graphql"].setup({ - capabilities = capabilities, - filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" }, - }) - end, - ["emmet_ls"] = function() - lspconfig["emmet_ls"].setup({ - capabilities = capabilities, - filetypes = { - "html", - "typescriptreact", - "javascriptreact", - "css", - "sass", - "scss", - "less", - "svelte", - }, - }) - end, - ["lua_ls"] = function() - lspconfig["lua_ls"].setup({ - capabilities = capabilities, - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - completion = { - callSnippet = "Replace", - }, - }, - }, - }) - end, - ["cssls"] = function() - lspconfig["cssls"].setup({ - capabilities = capabilities, - filetypes = { "css", "scss" }, - }) - end, - ["intelephense"] = function() - lspconfig["intelephense"].setup({ - capabilities = capabilities, - filetypes = { "php", "blade.php" }, - }) - end, - -- ["tsserver"] = function() - -- -- Replace tsserver with typescript-language-server - -- lspconfig["typescript-language-server"].setup({ - -- capabilities = capabilities, - -- filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" }, - -- }) - -- end, - }) - end, -} diff --git a/lua/pika/plugins/lsp/nvim-cmp.lua b/lua/pika/plugins/lsp/nvim-cmp.lua.bak similarity index 51% rename from lua/pika/plugins/lsp/nvim-cmp.lua rename to lua/pika/plugins/lsp/nvim-cmp.lua.bak index 704a168..6b3c862 100644 --- a/lua/pika/plugins/lsp/nvim-cmp.lua +++ b/lua/pika/plugins/lsp/nvim-cmp.lua.bak @@ -136,4 +136,136 @@ return { -- }) -- end, -- }, + { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-nvim-lsp", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip" }, + }, + { "antosha417/nvim-lsp-file-operations", config = true }, + { "folke/neodev.nvim", opts = {} }, + }, + + config = function() + local lspconfig = require("lspconfig") + local mason_lspconfig = require("mason-lspconfig") + local cmp_nvim_lsp = require("cmp_nvim_lsp") + local keymap = vim.keymap + + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf, silent = true } + + opts.desc = "See available code actions" + keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection + + opts.desc = "Smart rename" + keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename + + opts.desc = "Show buffer diagnostics" + keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file + + opts.desc = "Show line diagnostics" + keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line + + opts.desc = "Show documentation for what is under cursor" + keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor + + opts.desc = "Restart LSP" + keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary + end, + }) + -- used to enable autocompletion (assign to every lsp server config) + local capabilities = cmp_nvim_lsp.default_capabilities() + + -- Change the Diagnostic symbols in the sign column (gutter) + -- (not in youtube nvim video) + local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + + mason_lspconfig.setup_handlers({ + function(server_name) + lspconfig[server_name].setup({ + capabilities = capabilities, + }) + end, + ["svelte"] = function() + lspconfig["svelte"].setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd("BufWritePost", { + pattern = { "*.js", "*.ts" }, + callback = function(ctx) + client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match }) + end, + }) + end, + }) + end, + ["graphql"] = function() + lspconfig["graphql"].setup({ + capabilities = capabilities, + filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" }, + }) + end, + ["emmet_ls"] = function() + lspconfig["emmet_ls"].setup({ + capabilities = capabilities, + filetypes = { + "html", + "typescriptreact", + "javascriptreact", + "css", + "sass", + "scss", + "less", + "svelte", + }, + }) + end, + ["lua_ls"] = function() + lspconfig["lua_ls"].setup({ + capabilities = capabilities, + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + completion = { + callSnippet = "Replace", + }, + }, + }, + }) + end, + ["cssls"] = function() + lspconfig["cssls"].setup({ + capabilities = capabilities, + filetypes = { "css", "scss" }, + }) + end, + ["intelephense"] = function() + lspconfig["intelephense"].setup({ + capabilities = capabilities, + filetypes = { "php", "blade.php" }, + }) + end, + -- ["tsserver"] = function() + -- -- Replace tsserver with typescript-language-server + -- lspconfig["typescript-language-server"].setup({ + -- capabilities = capabilities, + -- filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" }, + -- }) + -- end, + }) + end, + }, } From 87e484ef9f82dc95ef019094bad219c0c9c433cc Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 27 Mar 2025 10:56:27 +0100 Subject: [PATCH 13/36] wip --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 13aae1b..0fc3d1c 100644 --- a/init.lua +++ b/init.lua @@ -9,7 +9,7 @@ else -- │ themes are under ./lua/pika/plugins/colorschemes.lua │ -- ╰──────────────────────────────────────────────────────╯ - vim.cmd.colorscheme("oldschool") + vim.cmd.colorscheme("eldritch") -- Keybind for saving clipboard screenshot and inserting a Markdown link vim.api.nvim_set_keymap( From b42f54d0c560ed03847d72b2a90ef7e5679829c4 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 27 Mar 2025 11:23:56 +0100 Subject: [PATCH 14/36] some blink changes --- lua/pika/plugins/lsp/blink-cmp.lua | 155 +++++++++++++++++++++++++++-- 1 file changed, 149 insertions(+), 6 deletions(-) diff --git a/lua/pika/plugins/lsp/blink-cmp.lua b/lua/pika/plugins/lsp/blink-cmp.lua index a0e3b74..0660cd0 100644 --- a/lua/pika/plugins/lsp/blink-cmp.lua +++ b/lua/pika/plugins/lsp/blink-cmp.lua @@ -10,7 +10,7 @@ return { -- use a release tag to download pre-built binaries version = "1.*", -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust - -- build = 'cargo build --release', + -- build = "cargo build --release", -- If you use nix, you can build from source using latest nightly rust with: -- build = 'nix run .#build-plugin', @@ -76,6 +76,72 @@ return { -- (Default) Only show the documentation popup when manually triggered completion = { + keyword = { range = "full" }, + trigger = { + -- When true, will prefetch the completion items when entering insert mode + prefetch_on_insert = false, + + -- When false, will not show the completion window automatically when in a snippet + show_in_snippet = true, + + -- When true, will show the completion window after typing any of alphanumerics, `-` or `_` + show_on_keyword = true, + + -- When true, will show the completion window after typing a trigger character + show_on_trigger_character = true, + + -- LSPs can indicate when to show the completion window via trigger characters + -- however, some LSPs (i.e. tsserver) return characters that would essentially + -- always show the window. We block these by default. + show_on_blocked_trigger_characters = { " ", "\n", "\t" }, + -- You can also block per filetype with a function: + -- show_on_blocked_trigger_characters = function(ctx) + -- if vim.bo.filetype == "markdown" then + -- return { " ", "\n", "\t", ".", "/", "(", "[" } + -- end + -- return { " ", "\n", "\t" } + -- end, + + -- When both this and show_on_trigger_character are true, will show the completion window + -- when the cursor comes after a trigger character after accepting an item + show_on_accept_on_trigger_character = true, + + -- When both this and show_on_trigger_character are true, will show the completion window + -- when the cursor comes after a trigger character when entering insert mode + show_on_insert_on_trigger_character = true, + + -- List of trigger characters (on top of `show_on_blocked_trigger_characters`) that won't trigger + -- the completion window when the cursor comes after a trigger character when + -- entering insert mode/accepting an item + show_on_x_blocked_trigger_characters = { "'", '"', "(" }, + -- or a function, similar to show_on_blocked_trigger_character + }, + list = { + -- Maximum number of items to display + max_items = 128, + + selection = { + -- When `true`, will automatically select the first item in the completion list + preselect = true, + -- preselect = function(ctx) return vim.bo.filetype ~= 'markdown' end, + + -- When `true`, inserts the completion item automatically when selecting it + -- You may want to bind a key to the `cancel` command (default ) when using this option, + -- which will both undo the selection and hide the completion menu + auto_insert = true, + -- auto_insert = function(ctx) return vim.bo.filetype ~= 'markdown' end + }, + + cycle = { + -- When `true`, calling `select_next` at the _bottom_ of the completion list + -- will select the _first_ completion item. + from_bottom = true, + -- When `true`, calling `select_prev` at the _top_ of the completion list + -- will select the _last_ completion item. + from_top = true, + }, + }, + documentation = { auto_show = false, auto_show_delay_ms = 230, @@ -98,15 +164,40 @@ return { ghost_text = { enabled = true, show_with_selection = true, - show_without_selection = true, + show_without_selection = false, show_with_menu = true, - show_without_menu = true, + show_without_menu = false, }, - -- ─────────────────────────────────< mini-icons config >────────────────────────────── menu = { + enabled = true, + min_width = 16, + max_height = 10, + border = nil, -- Defaults to `vim.o.winborder` on nvim 0.11+ + winblend = 0, + winhighlight = "Normal:BlinkCmpMenu,FloatBorder:BlinkCmpMenuBorder,CursorLine:BlinkCmpMenuSelection,Search:None", + -- Keep the cursor X lines away from the top/bottom of the window + scrolloff = 2, + -- Note that the gutter will be disabled when border ~= 'none' + scrollbar = true, + -- Which directions to show the window, + -- falling back to the next direction when there's not enough space + direction_priority = { "s", "n" }, + + -- Whether to automatically show the window when new completion items are available + auto_show = true, + draw = { - columns = { { "kind_icon" }, { "label", gap = 1 } }, + -- Aligns the keyword you've typed to a component in the menu + align_to = "label", -- or 'none' to disable, or 'cursor' to align to the cursor + -- Left and right padding, optionally { left, right } for different padding on each side + padding = 1, + -- Gap between columns + gap = 2, + -- Use treesitter to highlight the label text for the given list of sources + -- treesitter = {}, + treesitter = { "lsp" }, + columns = { { "kind_icon" }, { "label", "label_description", gap = 1 } }, components = { label = { text = function(ctx) @@ -135,6 +226,30 @@ return { -- return hl -- end, -- }, + + label_description = { + width = { max = 30 }, + text = function(ctx) + return ctx.label_description + end, + highlight = "BlinkCmpLabelDescription", + }, + + source_name = { + width = { max = 30 }, + text = function(ctx) + return ctx.source_name + end, + highlight = "BlinkCmpSource", + }, + + source_id = { + width = { max = 30 }, + text = function(ctx) + return ctx.source_id + end, + highlight = "BlinkCmpSource", + }, }, }, }, @@ -146,12 +261,40 @@ return { default = { "lsp", "path", "snippets", "buffer" }, }, + -- snippets = { preset = "default" | "luasnip" }, + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` -- -- See the fuzzy documentation for more information - fuzzy = { implementation = "prefer_rust" }, + fuzzy = { + implementation = "prefer_rust", + + -- Frecency tracks the most recently/frequently used items and boosts the score of the item + -- Note, this does not apply when using the Lua implementation. + use_frecency = true, + + -- Proximity bonus boosts the score of items matching nearby words + -- Note, this does not apply when using the Lua implementation. + use_proximity = true, + + -- UNSAFE!! When enabled, disables the lock and fsync when writing to the frecency database. This should only be used on unsupported platforms (i.e. alpine termux) + -- Note, this does not apply when using the Lua implementation. + use_unsafe_no_lock = false, + sorts = { + -- (optionally) always prioritize exact matches + -- 'exact', + + -- pass a function for custom behavior + -- function(item_a, item_b) + -- return item_a.score > item_b.score + -- end, + + "score", + "sort_text", + }, + }, }, opts_extend = { "sources.default" }, }, From c4441f11ea4a7b1dfbed480c35b34a8a2cb0747c Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 27 Mar 2025 12:27:44 +0100 Subject: [PATCH 15/36] cmp actions --- lua/pika/plugins/lsp/blink-cmp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pika/plugins/lsp/blink-cmp.lua b/lua/pika/plugins/lsp/blink-cmp.lua index 0660cd0..e871cdd 100644 --- a/lua/pika/plugins/lsp/blink-cmp.lua +++ b/lua/pika/plugins/lsp/blink-cmp.lua @@ -66,7 +66,7 @@ return { -- Adjusts spacing to ensure icons are aligned nerd_font_variant = "mono", - highlight_ns = vim.api.nvim_create_namespace("blink_cmp"), + -- highlight_ns = vim.api.nvim_create_namespace("nvim-cmp"), -- Sets the fallback highlight groups to nvim-cmp's highlight groups -- Useful for when your theme doesn't support blink.cmp -- Will be removed in a future release From 8b92b4140c87f54cf04a8256f62c1d087e865094 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 27 Mar 2025 17:23:57 +0100 Subject: [PATCH 16/36] add: astroluma colorscheme --- lua/pika/plugins/colorschemes.lua | 73 ++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua index d18bdd8..7411b9a 100644 --- a/lua/pika/plugins/colorschemes.lua +++ b/lua/pika/plugins/colorschemes.lua @@ -14,6 +14,77 @@ return { { "pauchiner/pastelnight.nvim" }, { "ptdewey/darkearth-nvim" }, { "marko-cerovac/material.nvim" }, + { + "AstroNvim/astrotheme", + opts = { + { + palette = "astrodark", -- String of the default palette to use when calling `:colorscheme astrotheme` + background = { -- :h background, palettes to use when using the core vim background colors + light = "astrolight", + dark = "astrodark", + }, + + style = { + transparent = false, -- Bool value, toggles transparency. + inactive = true, -- Bool value, toggles inactive window color. + float = true, -- Bool value, toggles floating windows background colors. + neotree = true, -- Bool value, toggles neo-trees background color. + border = true, -- Bool value, toggles borders. + title_invert = true, -- Bool value, swaps text and background colors. + italic_comments = true, -- Bool value, toggles italic comments. + simple_syntax_colors = true, -- Bool value, simplifies the amounts of colors used for syntax highlighting. + }, + + termguicolors = true, -- Bool value, toggles if termguicolors are set by AstroTheme. + + terminal_color = true, -- Bool value, toggles if terminal_colors are set by AstroTheme. + + plugin_default = "auto", -- Sets how all plugins will be loaded + -- "auto": Uses lazy / packer enabled plugins to load highlights. + -- true: Enables all plugins highlights. + -- false: Disables all plugins. + + plugins = { -- Allows for individual plugin overrides using plugin name and value from above. + ["bufferline.nvim"] = false, + }, + + palettes = { + global = { -- Globally accessible palettes, theme palettes take priority. + my_grey = "#ebebeb", + my_color = "#ffffff", + }, + astrodark = { -- Extend or modify astrodarks palette colors + ui = { + red = "#800010", -- Overrides astrodarks red UI color + accent = "#CC83E3", -- Changes the accent color of astrodark. + }, + syntax = { + cyan = "#800010", -- Overrides astrodarks cyan syntax color + comments = "#CC83E3", -- Overrides astrodarks comment color. + }, + my_color = "#000000", -- Overrides global.my_color + }, + }, + + highlights = { + global = { -- Add or modify hl groups globally, theme specific hl groups take priority. + modify_hl_groups = function(hl, c) + hl.PluginColor4 = { fg = c.my_grey, bg = c.none } + end, + ["@String"] = { fg = "#ff00ff", bg = "NONE" }, + }, + astrodark = { + -- first parameter is the highlight table and the second parameter is the color palette table + modify_hl_groups = function(hl, c) -- modify_hl_groups function allows you to modify hl groups, + hl.Comment.fg = c.my_color + hl.Comment.italic = true + end, + ["@String"] = { fg = "#ff00ff", bg = "NONE" }, + }, + }, + }, + }, + }, -- { -- "ferdinandrau/lavish.nvim", -- opts = { @@ -34,7 +105,7 @@ return { styles = { -- Style to be applied to different syntax groups -- Value is any valid attr-list value for `:help nvim_set_hl` - comments = { italic = true }, + comments = { italic = false }, keywords = { italic = true }, functions = { bold = true }, variables = { bold = true }, From 3f4c4206c6bdce1651f82e65733765a8f10825c2 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 27 Mar 2025 23:43:29 +0100 Subject: [PATCH 17/36] add: astroluma colorscheme --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 0fc3d1c..1b15708 100644 --- a/init.lua +++ b/init.lua @@ -9,7 +9,7 @@ else -- │ themes are under ./lua/pika/plugins/colorschemes.lua │ -- ╰──────────────────────────────────────────────────────╯ - vim.cmd.colorscheme("eldritch") + vim.cmd.colorscheme("astrodark") -- Keybind for saving clipboard screenshot and inserting a Markdown link vim.api.nvim_set_keymap( From a0dfeda2884a55e6a9f034d7bf2fb980f68530e5 Mon Sep 17 00:00:00 2001 From: pika Date: Tue, 1 Apr 2025 21:37:13 +0200 Subject: [PATCH 18/36] =?UTF-8?q?=EF=80=99=20update:=20submodules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets b/snippets index e7f703e..7eaeb1e 160000 --- a/snippets +++ b/snippets @@ -1 +1 @@ -Subproject commit e7f703ecb74d00eeea817b0b677c8715bdc23521 +Subproject commit 7eaeb1e40883a0478d50fd01cc91083f4b079f0e From 0b4f56979799903a85bf78d6ac6c1644e3ffd8b6 Mon Sep 17 00:00:00 2001 From: piecka Date: Wed, 2 Apr 2025 16:27:42 +0200 Subject: [PATCH 19/36] addet functions.sh to source from when in terminal input mode --- functions.sh | 3 ++ lua/pika/core/keymaps.lua | 73 +++++++++++++++++++++++++-------------- 2 files changed, 51 insertions(+), 25 deletions(-) create mode 100644 functions.sh diff --git a/functions.sh b/functions.sh new file mode 100644 index 0000000..26455bf --- /dev/null +++ b/functions.sh @@ -0,0 +1,3 @@ +get_ip() { + ip a | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d/ -f1 | head -n 1 +} diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index 69fc905..f753647 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -58,32 +58,55 @@ map("n", "R", [[:%s/\<\>//gI]]) map("n", "sv", "v", { desc = "Split window vertically" }) -- split window vertically map("n", "sh", "s", { desc = "Split window horizontally" }) -- split window horizontally -vim.keymap.set({ "n", "i" }, "tt", function() - -- Frage den Shell-Command ab - vim.ui.input({ prompt = "Shell Command: " }, function(cmd) - if cmd == nil or cmd == "" then - return - end +-- ─< Set path to your shell functions file (update this to your actual path) >───────── +local shell_script_path = vim.fs.joinpath(vim.fn.stdpath("config") .. "/functions.sh") - local result = vim.fn.system(cmd) - local exit_code = vim.v.shell_error +-- ─< Add this before the keymap definition to check for file existence >─────────────── +if vim.uv.fs_stat(shell_script_path) then -- Check if file exists + -- inserts shell commands (sources ~/.config/nvim/functions.sh to source predefined functions) + vim.keymap.set({ "n", "i" }, "tt", function() + vim.ui.input({ prompt = "Shell Command: " }, function(input_cmd) + if not input_cmd or input_cmd == "" then + return + end - if exit_code ~= 0 then - vim.notify("Shell Error:\n" .. result, vim.log.levels.ERROR, { title = "Shell Command Failed" }) - return - end + -- Construct the command to source your functions and execute + local full_cmd = string.format( + "source %s && %s", -- Uses POSIX-compliant '&&' to fail if source fails + vim.fn.shellescape(shell_script_path), + input_cmd + ) - local lines = vim.split(result, "\n", { trimempty = true }) + -- Execute in bash to ensure function availability + local result = vim.fn.system({ "bash", "--norc", "--noprofile", "-c", full_cmd }) + local exit_code = vim.v.shell_error - -- Insert at cursor position - local row, col = unpack(vim.api.nvim_win_get_cursor(0)) - if #lines == 1 then - -- Insert inline if the result is a single line - local current_line = vim.api.nvim_get_current_line() - local new_line = current_line:sub(1, col) .. lines[1] .. current_line:sub(col + 1) - vim.api.nvim_set_current_line(new_line) - else - vim.api.nvim_buf_set_lines(0, row, row, false, lines) - end - end) -end, { desc = "Insert Shell Output at Cursor" }) + -- Handle errors + if exit_code ~= 0 then + vim.notify( + "Error (" .. exit_code .. "):\n" .. result, + vim.log.levels.ERROR, + { title = "Command Failed" } + ) + return + end + + -- Process output + local lines = vim.split(result:gsub("\n$", ""), "\n") + + -- Insert at cursor position + local row, col = unpack(vim.api.nvim_win_get_cursor(0)) + if #lines == 1 then + vim.api.nvim_set_current_line( + vim.api.nvim_get_current_line():sub(1, col) + .. lines[1] + .. vim.api.nvim_get_current_line():sub(col + 1) + ) + else + vim.api.nvim_buf_set_lines(0, row, row, false, lines) + end + end) + end, { desc = "Insert Shell Output (with functions)" }) +else + vim.notify("Shell functions file not found: " .. shell_script_path, vim.log.levels.WARN) +end From 20bc140a7638170e57abbceeabdd2ca44f36e846 Mon Sep 17 00:00:00 2001 From: pika Date: Wed, 2 Apr 2025 17:49:15 +0200 Subject: [PATCH 20/36] addet folkes todo comments for really nice comments - thanks folke --- init.lua | 2 +- lua/pika/plugins/colorschemes.lua | 12 +++------ lua/pika/plugins/explorer.lua | 38 +++++++++++++------------- lua/pika/plugins/qol.lua | 17 ++++++++++++ lua/pika/plugins/telescope.lua | 44 +++++++++++++------------------ 5 files changed, 60 insertions(+), 53 deletions(-) diff --git a/init.lua b/init.lua index 1b15708..cbd3f1a 100644 --- a/init.lua +++ b/init.lua @@ -9,7 +9,7 @@ else -- │ themes are under ./lua/pika/plugins/colorschemes.lua │ -- ╰──────────────────────────────────────────────────────╯ - vim.cmd.colorscheme("astrodark") + vim.cmd.colorscheme("rose-pine-moon") -- Keybind for saving clipboard screenshot and inserting a Markdown link vim.api.nvim_set_keymap( diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua index 7411b9a..1cac46b 100644 --- a/lua/pika/plugins/colorschemes.lua +++ b/lua/pika/plugins/colorschemes.lua @@ -1,19 +1,15 @@ return { - { "folke/tokyonight.nvim" }, - { "fynnfluegge/monet.nvim", name = "monet" }, - { "L-Colombo/oldschool.nvim", config = "true" }, + -- { "folke/tokyonight.nvim" }, -- { "catppuccin/nvim", name = "catppuccin" }, -- { "EdenEast/nightfox.nvim" }, -- { "DanWlker/primeppuccin", name = "primeppuccin" }, - -- { "rose-pine/neovim", name = "rose-pine" }, + { "fynnfluegge/monet.nvim", name = "monet" }, + { "L-Colombo/oldschool.nvim", config = "true" }, + { "rose-pine/neovim", name = "rose-pine" }, { "AlexvZyl/nordic.nvim" }, { "eldritch-theme/eldritch.nvim" }, - -- { "sainnhe/sonokai" }, { "samharju/synthweave.nvim" }, - { "sainnhe/gruvbox-material" }, - { "pauchiner/pastelnight.nvim" }, { "ptdewey/darkearth-nvim" }, - { "marko-cerovac/material.nvim" }, { "AstroNvim/astrotheme", opts = { diff --git a/lua/pika/plugins/explorer.lua b/lua/pika/plugins/explorer.lua index 6791427..25d33c4 100644 --- a/lua/pika/plugins/explorer.lua +++ b/lua/pika/plugins/explorer.lua @@ -1,20 +1,20 @@ return { -- ─< neotree - fallback >──────────────────────────────────────────────────────────────────────── - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information - }, - vim.keymap.set("n", "e", ":Neotree toggle"), - vim.keymap.set("n", "Ee", ":Neotree left"), - vim.keymap.set("n", "Ef", ":Neotree float"), - vim.keymap.set("n", "Eg", ":Neotree git_status float"), - vim.keymap.set("n", "Eb", ":Neotree buffers position=top"), - }, + -- { + -- "nvim-neo-tree/neo-tree.nvim", + -- branch = "v3.x", + -- dependencies = { + -- "nvim-lua/plenary.nvim", + -- "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + -- "MunifTanjim/nui.nvim", + -- -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + -- }, + -- vim.keymap.set("n", "e", ":Neotree toggle"), + -- vim.keymap.set("n", "Ee", ":Neotree left"), + -- vim.keymap.set("n", "Ef", ":Neotree float"), + -- vim.keymap.set("n", "Eg", ":Neotree git_status float"), + -- vim.keymap.set("n", "Eb", ":Neotree buffers position=top"), + -- }, ---@type LazySpec { @@ -29,16 +29,16 @@ return { -- }, { -- Open in the current working directory - "Lf", + "tLf", "Yazi cwd", - desc = "Open the file manager in nvim's working directory", + desc = "Terminal - Open yazi in nvim's working directory", }, { -- NOTE: this requires a version of yazi that includes -- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18 - "lf", + "tlf", "Yazi toggle", - desc = "Resume the last yazi session", + desc = "Terminal - Resume the last yazi session", }, }, ---@type YaziConfig diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua index c012d60..2e39595 100644 --- a/lua/pika/plugins/qol.lua +++ b/lua/pika/plugins/qol.lua @@ -138,6 +138,23 @@ return { ), }, + -- ─< INFO: Those comments are really great! >────────────────────────────────────────── + -- ─────────────────────< NOTE: And they can be pretty satisfying... >───────────────────── + -- ╭──────────────────────────────────────╮ + -- │ WARN: Also they can change in color! │ + -- ╰──────────────────────────────────────╯ + { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + keywords = { + NOTE = { icon = " ", color = "hint" }, + INFO = { icon = " ", color = "info" }, + WARNING = { icon = " ", color = "warning", alt = { "WARN" } }, + }, + }, + }, + -- ╭───────────╮ -- │ colorizer │ -- ╰───────────╯ diff --git a/lua/pika/plugins/telescope.lua b/lua/pika/plugins/telescope.lua index 0656a2b..c6c80d1 100644 --- a/lua/pika/plugins/telescope.lua +++ b/lua/pika/plugins/telescope.lua @@ -25,38 +25,32 @@ return { telescope.load_extension("fzf") - -- set keymaps + -- ─< set keymaps >───────────────────────────────────────────────────────────────────── local map = vim.keymap.set -- for conciseness - - -- Telescope mappings - map("n", "sf", "Telescope find_files", { noremap = true, silent = true, desc = "Find Files" }) - map("n", "sw", "Telescope live_grep", { noremap = true, silent = true, desc = "Search Word" }) - map("n", "", "Telescope buffers", { noremap = true, silent = true, desc = "Buffers" }) local builtin = require("telescope.builtin") - - map("n", "sn", function() - builtin.find_files({ cwd = vim.fn.stdpath("config") }) - end, { desc = "[S]earch [N]eovim files" }) - map("n", "ff", builtin.find_files, { desc = "[S]earch [F]iles" }) - map("n", "sh", builtin.help_tags, { desc = "[S]earch [H]elp" }) - map("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) - map("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) - map("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) - -- map("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) - map("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - map("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) - map("n", "sR", function() - require("telescope.builtin").oldfiles() - end) + -- ─────────────────────────────────< Telescope mappings >───────────────────────────────── map("n", "T", "Telescope colorscheme") - map("n", "q", vim.cmd.q) + + map("n", "ff", "Telescope find_files", { noremap = true, silent = true, desc = "Find Files" }) + -- map("n", "ff", builtin.find_files, { desc = "Find Files" }) + map("n", "fw", "Telescope live_grep", { noremap = true, silent = true, desc = "Find Word" }) + -- map("n", "fw", builtin.live_grep, { desc = "Find word" }) + -- map("n", "fb", "Telescope buffers", { noremap = true, silent = true, desc = "Find Buffers" }) + map("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) + map("n", "fn", function() + builtin.find_files({ cwd = vim.fn.stdpath("config") }) + end, { desc = "Find Neovim files" }) + map("n", "fh", builtin.help_tags, { desc = "Find Help" }) + map("n", "fk", builtin.keymaps, { desc = "Find Keymaps" }) + map("n", "fd", builtin.diagnostics, { desc = "Find Diagnostics" }) + map("n", "fo", builtin.oldfiles, { desc = "Find old/Recent Files" }) -- Additional custom mappings map("n", "/", function() builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown()) - end, { desc = "[/] Fuzzily search in current buffer" }) - map("n", "s/", function() + end, { desc = "Search in current buffer" }) + map("n", "f/", function() builtin.live_grep({ grep_open_files = true, prompt_title = "Live Grep in Open Files" }) - end, { desc = "[S]earch [/] in Open Files" }) + end, { desc = "Search in Open Files" }) end, } From 977f0ef3ede2802f279d7323627b3f20e4532bba Mon Sep 17 00:00:00 2001 From: pika Date: Wed, 2 Apr 2025 17:54:56 +0200 Subject: [PATCH 21/36] addet proper file disable without renaming --- lua/pika/plugins/lsp/blink-cmp.lua | 4 ++++ lua/pika/plugins/lsp/{nvim-cmp.lua.bak => nvim-cmp.lua} | 6 ++++++ 2 files changed, 10 insertions(+) rename lua/pika/plugins/lsp/{nvim-cmp.lua.bak => nvim-cmp.lua} (98%) diff --git a/lua/pika/plugins/lsp/blink-cmp.lua b/lua/pika/plugins/lsp/blink-cmp.lua index e871cdd..be08b5e 100644 --- a/lua/pika/plugins/lsp/blink-cmp.lua +++ b/lua/pika/plugins/lsp/blink-cmp.lua @@ -1,3 +1,7 @@ +-- if true then return {} end +-- WARNING: If this line is true, then the plugin will NOT get sourced! +-- NOTE: Has to be commented out if blink should be used + return { -- ╭───────────╮ -- │ blink.cmp │ diff --git a/lua/pika/plugins/lsp/nvim-cmp.lua.bak b/lua/pika/plugins/lsp/nvim-cmp.lua similarity index 98% rename from lua/pika/plugins/lsp/nvim-cmp.lua.bak rename to lua/pika/plugins/lsp/nvim-cmp.lua index 6b3c862..0149837 100644 --- a/lua/pika/plugins/lsp/nvim-cmp.lua.bak +++ b/lua/pika/plugins/lsp/nvim-cmp.lua @@ -1,3 +1,9 @@ +if true then + return {} +end +-- WARNING: If this line is true, then the plugin will NOT get sourced! +-- NOTE: Has to be commented out if blink should be used + return { { "hrsh7th/nvim-cmp", From ffbdf9e4bb35cf4d183261f3018e47d25861c2a2 Mon Sep 17 00:00:00 2001 From: pika Date: Wed, 2 Apr 2025 18:04:58 +0200 Subject: [PATCH 22/36] addet terminal as a custom file --- lua/pika/core/custom/terminalcmd.lua | 52 +++++++++++++++++++++++++++ lua/pika/core/init.lua | 1 + lua/pika/core/keymaps.lua | 53 ---------------------------- 3 files changed, 53 insertions(+), 53 deletions(-) create mode 100644 lua/pika/core/custom/terminalcmd.lua diff --git a/lua/pika/core/custom/terminalcmd.lua b/lua/pika/core/custom/terminalcmd.lua new file mode 100644 index 0000000..7d07e55 --- /dev/null +++ b/lua/pika/core/custom/terminalcmd.lua @@ -0,0 +1,52 @@ +-- ─< Set path to your shell functions file (update this to your actual path) >───────── +local shell_script_path = vim.fs.joinpath(vim.fn.stdpath("config") .. "/functions.sh") + +-- ─< Add this before the keymap definition to check for file existence >─────────────── +if vim.uv.fs_stat(shell_script_path) then -- Check if file exists + -- inserts shell commands (sources ~/.config/nvim/functions.sh to source predefined functions) + vim.keymap.set({ "n", "i" }, "tt", function() + vim.ui.input({ prompt = "Shell Command: " }, function(input_cmd) + if not input_cmd or input_cmd == "" then + return + end + + -- Construct the command to source your functions and execute + local full_cmd = string.format( + "source %s && %s", -- Uses POSIX-compliant '&&' to fail if source fails + vim.fn.shellescape(shell_script_path), + input_cmd + ) + + -- Execute in bash to ensure function availability + local result = vim.fn.system({ "bash", "--norc", "--noprofile", "-c", full_cmd }) + local exit_code = vim.v.shell_error + + -- Handle errors + if exit_code ~= 0 then + vim.notify( + "Error (" .. exit_code .. "):\n" .. result, + vim.log.levels.ERROR, + { title = "Command Failed" } + ) + return + end + + -- Process output + local lines = vim.split(result:gsub("\n$", ""), "\n") + + -- Insert at cursor position + local row, col = unpack(vim.api.nvim_win_get_cursor(0)) + if #lines == 1 then + vim.api.nvim_set_current_line( + vim.api.nvim_get_current_line():sub(1, col) + .. lines[1] + .. vim.api.nvim_get_current_line():sub(col + 1) + ) + else + vim.api.nvim_buf_set_lines(0, row, row, false, lines) + end + end) + end, { desc = "Insert Shell Output (with functions)" }) +else + vim.notify("Shell functions file not found: " .. shell_script_path, vim.log.levels.WARN) +end diff --git a/lua/pika/core/init.lua b/lua/pika/core/init.lua index 3ab7175..4e41d6e 100644 --- a/lua/pika/core/init.lua +++ b/lua/pika/core/init.lua @@ -1,2 +1,3 @@ require("pika.core.options") require("pika.core.keymaps") +require("pika.core.custom.terminalcmd") diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index f753647..57203c8 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -57,56 +57,3 @@ map("n", "R", [[:%s/\<\>//gI]]) -- window management map("n", "sv", "v", { desc = "Split window vertically" }) -- split window vertically map("n", "sh", "s", { desc = "Split window horizontally" }) -- split window horizontally - --- ─< Set path to your shell functions file (update this to your actual path) >───────── -local shell_script_path = vim.fs.joinpath(vim.fn.stdpath("config") .. "/functions.sh") - --- ─< Add this before the keymap definition to check for file existence >─────────────── -if vim.uv.fs_stat(shell_script_path) then -- Check if file exists - -- inserts shell commands (sources ~/.config/nvim/functions.sh to source predefined functions) - vim.keymap.set({ "n", "i" }, "tt", function() - vim.ui.input({ prompt = "Shell Command: " }, function(input_cmd) - if not input_cmd or input_cmd == "" then - return - end - - -- Construct the command to source your functions and execute - local full_cmd = string.format( - "source %s && %s", -- Uses POSIX-compliant '&&' to fail if source fails - vim.fn.shellescape(shell_script_path), - input_cmd - ) - - -- Execute in bash to ensure function availability - local result = vim.fn.system({ "bash", "--norc", "--noprofile", "-c", full_cmd }) - local exit_code = vim.v.shell_error - - -- Handle errors - if exit_code ~= 0 then - vim.notify( - "Error (" .. exit_code .. "):\n" .. result, - vim.log.levels.ERROR, - { title = "Command Failed" } - ) - return - end - - -- Process output - local lines = vim.split(result:gsub("\n$", ""), "\n") - - -- Insert at cursor position - local row, col = unpack(vim.api.nvim_win_get_cursor(0)) - if #lines == 1 then - vim.api.nvim_set_current_line( - vim.api.nvim_get_current_line():sub(1, col) - .. lines[1] - .. vim.api.nvim_get_current_line():sub(col + 1) - ) - else - vim.api.nvim_buf_set_lines(0, row, row, false, lines) - end - end) - end, { desc = "Insert Shell Output (with functions)" }) -else - vim.notify("Shell functions file not found: " .. shell_script_path, vim.log.levels.WARN) -end From bef9661e9c512b5acb1f6c874dcc3877f2b18398 Mon Sep 17 00:00:00 2001 From: pika Date: Fri, 4 Apr 2025 18:52:12 +0200 Subject: [PATCH 23/36] changed to nvim-cmp and addet yet another ai plugin --- lua/pika/plugins/{avante-ai.lua => ai.lua} | 10 ++++++++++ lua/pika/plugins/lsp/blink-cmp.lua | 2 +- lua/pika/plugins/lsp/nvim-cmp.lua | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) rename lua/pika/plugins/{avante-ai.lua => ai.lua} (92%) diff --git a/lua/pika/plugins/avante-ai.lua b/lua/pika/plugins/ai.lua similarity index 92% rename from lua/pika/plugins/avante-ai.lua rename to lua/pika/plugins/ai.lua index 682a95f..acc498e 100644 --- a/lua/pika/plugins/avante-ai.lua +++ b/lua/pika/plugins/ai.lua @@ -1,4 +1,5 @@ return { +{ "yetone/avante.nvim", event = "VeryLazy", version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes. @@ -56,4 +57,13 @@ return { ft = { "markdown", "Avante" }, }, }, +}, +{ + "olimorris/codecompanion.nvim", + config = true, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + }, +}, } diff --git a/lua/pika/plugins/lsp/blink-cmp.lua b/lua/pika/plugins/lsp/blink-cmp.lua index be08b5e..a7f5ea4 100644 --- a/lua/pika/plugins/lsp/blink-cmp.lua +++ b/lua/pika/plugins/lsp/blink-cmp.lua @@ -1,4 +1,4 @@ --- if true then return {} end +if true then return {} end -- WARNING: If this line is true, then the plugin will NOT get sourced! -- NOTE: Has to be commented out if blink should be used diff --git a/lua/pika/plugins/lsp/nvim-cmp.lua b/lua/pika/plugins/lsp/nvim-cmp.lua index 0149837..c8f0e5d 100644 --- a/lua/pika/plugins/lsp/nvim-cmp.lua +++ b/lua/pika/plugins/lsp/nvim-cmp.lua @@ -1,6 +1,6 @@ -if true then - return {} -end +-- if true then +-- return {} +-- end -- WARNING: If this line is true, then the plugin will NOT get sourced! -- NOTE: Has to be commented out if blink should be used From 25790de5b42df3608ce0347f5fb7cc0182506a47 Mon Sep 17 00:00:00 2001 From: pika Date: Fri, 4 Apr 2025 21:52:00 +0200 Subject: [PATCH 24/36] addet ai again --- .gitignore | 1 + lua/pika/plugins/ai.lua | 112 ++++++++++++++--------------- lua/pika/plugins/lsp/blink-cmp.lua | 5 +- lua/pika/plugins/lsp/nvim-cmp.lua | 6 +- 4 files changed, 60 insertions(+), 64 deletions(-) diff --git a/.gitignore b/.gitignore index 55d79fe..eed252c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ lazy-lock.json cd-project.nvim.json +custom/ diff --git a/lua/pika/plugins/ai.lua b/lua/pika/plugins/ai.lua index acc498e..1864ce1 100644 --- a/lua/pika/plugins/ai.lua +++ b/lua/pika/plugins/ai.lua @@ -1,69 +1,61 @@ return { -{ - "yetone/avante.nvim", - event = "VeryLazy", - version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes. - opts = { - -- add any opts here - -- for example - provider = "openai", - openai = { - endpoint = "https://api.openai.com/v1", - model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) - timeout = 30000, -- timeout in milliseconds - temperature = 0, -- adjust if needed - max_tokens = 4096, - -- reasoning_effort = "high" -- only supported for reasoning models (o1, etc.) + { + "yetone/avante.nvim", + event = "VeryLazy", + version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes. + opts = { + -- add any opts here + -- for example + provider = "openai", + openai = { + endpoint = "https://api.openai.com/v1", + model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) + timeout = 30000, -- timeout in milliseconds + temperature = 0, -- adjust if needed + max_tokens = 4096, + -- reasoning_effort = "high" -- only supported for reasoning models (o1, etc.) + }, }, - }, - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - build = "make", - -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows - dependencies = { - "nvim-treesitter/nvim-treesitter", - "stevearc/dressing.nvim", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - "echasnovski/mini.pick", -- for file_selector provider mini.pick - "nvim-telescope/telescope.nvim", -- for file_selector provider telescope - "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - "ibhagwan/fzf-lua", -- for file_selector provider fzf - "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - "zbirenbaum/copilot.lua", -- for providers='copilot' - { - -- support for image pasting - "HakonHarnes/img-clip.nvim", - event = "VeryLazy", - opts = { - -- recommended settings - default = { - embed_image_as_base64 = false, - prompt_for_file_name = false, - drag_and_drop = { - insert_mode = true, + -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` + build = "make", + -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows + dependencies = { + "nvim-treesitter/nvim-treesitter", + "stevearc/dressing.nvim", + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + --- The below dependencies are optional, + "echasnovski/mini.pick", -- for file_selector provider mini.pick + "nvim-telescope/telescope.nvim", -- for file_selector provider telescope + "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions + "ibhagwan/fzf-lua", -- for file_selector provider fzf + "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + "zbirenbaum/copilot.lua", -- for providers='copilot' + { + -- support for image pasting + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + -- required for Windows users + use_absolute_path = true, }, - -- required for Windows users - use_absolute_path = true, }, }, - }, - { - -- Make sure to set this up properly if you have lazy=true - "MeanderingProgrammer/render-markdown.nvim", - opts = { - file_types = { "markdown", "Avante" }, + { + -- Make sure to set this up properly if you have lazy=true + "MeanderingProgrammer/render-markdown.nvim", + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, }, - ft = { "markdown", "Avante" }, }, }, -}, -{ - "olimorris/codecompanion.nvim", - config = true, - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, -}, } diff --git a/lua/pika/plugins/lsp/blink-cmp.lua b/lua/pika/plugins/lsp/blink-cmp.lua index a7f5ea4..1603997 100644 --- a/lua/pika/plugins/lsp/blink-cmp.lua +++ b/lua/pika/plugins/lsp/blink-cmp.lua @@ -1,4 +1,6 @@ -if true then return {} end +-- if true then +-- return {} +-- end -- WARNING: If this line is true, then the plugin will NOT get sourced! -- NOTE: Has to be commented out if blink should be used @@ -33,6 +35,7 @@ return { -- C-k: Toggle signature help (if signature.enabled = true) -- -- See :h blink-cmp-config-keymap for defining your own keymap + cmdline = { sources = { "cmdline" } }, keymap = { -- set to 'none' to disable the 'default' preset preset = "super-tab", diff --git a/lua/pika/plugins/lsp/nvim-cmp.lua b/lua/pika/plugins/lsp/nvim-cmp.lua index c8f0e5d..0149837 100644 --- a/lua/pika/plugins/lsp/nvim-cmp.lua +++ b/lua/pika/plugins/lsp/nvim-cmp.lua @@ -1,6 +1,6 @@ --- if true then --- return {} --- end +if true then + return {} +end -- WARNING: If this line is true, then the plugin will NOT get sourced! -- NOTE: Has to be commented out if blink should be used From 89322b376a48b4b6d2c89e68f3b692f399a2d439 Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 5 Apr 2025 00:19:19 +0200 Subject: [PATCH 25/36] wip --- lua/pika/core/keymaps.lua | 18 ++++++++++++++++-- lua/pika/plugins/custom.lua | 7 +++++++ lua/pika/plugins/ui.lua | 1 + 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 lua/pika/plugins/custom.lua diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index 57203c8..1ecd19c 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -51,9 +51,23 @@ map("n", "q", vim.cmd.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 +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 + +-- ──────────────────────────────< rename word under cursor >────────────────────────────── +-- map("n", "R", [[:%s/\<\>//gI]]) +-- ──────────────────────< Enhanced word renaming in current buffer >────────────────────── +-- -- Minimal working version +vim.keymap.set({ "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/plugins/custom.lua b/lua/pika/plugins/custom.lua new file mode 100644 index 0000000..2f2d350 --- /dev/null +++ b/lua/pika/plugins/custom.lua @@ -0,0 +1,7 @@ +return { + dir = "~/.config/nvim/lua/pika/plugins/custom/terminals.nvim", + opts = { + visible_lines = 3, + }, + vim.keymap.set("n", "td", ""), +} diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua index 797645d..5236ba4 100644 --- a/lua/pika/plugins/ui.lua +++ b/lua/pika/plugins/ui.lua @@ -171,6 +171,7 @@ return { -- char = "│", -- tab_char = "│", }, + scope = { enabled = true }, }, }, From 741556792bd684f00112fa5b546278f1e282ce28 Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 5 Apr 2025 10:51:29 +0200 Subject: [PATCH 26/36] some plugin changes and visual optimisations --- lua/pika/core/keymaps.lua | 29 ++++++++++++-------- lua/pika/core/options.lua | 5 ++-- lua/pika/lazy.lua | 41 ++++++++++++++-------------- lua/pika/plugins/dashboard.lua | 14 +++++----- lua/pika/plugins/lsp/mason.lua | 6 ++++ lua/pika/plugins/mini.lua | 36 ++++++++++++++++++++++-- lua/pika/plugins/qol.lua | 39 +++++++++++++------------- lua/pika/plugins/ui.lua | 50 +++++++++++++++++++++++++--------- 8 files changed, 143 insertions(+), 77 deletions(-) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index 1ecd19c..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,22 +48,27 @@ 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) -- Visual mode: Indent selected lines -map("v", "", ">gv", { desc = "Indent and keep selection" }) -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 renaming in current buffer >────────────────────── --- -- Minimal working version -vim.keymap.set({ "n", "x" }, "R", function() +-- ───────────────< 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 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/lazy.lua b/lua/pika/lazy.lua index d56a156..dae8236 100644 --- a/lua/pika/lazy.lua +++ b/lua/pika/lazy.lua @@ -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 }, }) diff --git a/lua/pika/plugins/dashboard.lua b/lua/pika/plugins/dashboard.lua index 1646807..96e3de6 100644 --- a/lua/pika/plugins/dashboard.lua +++ b/lua/pika/plugins/dashboard.lua @@ -116,13 +116,13 @@ return { "folke/persistence.nvim", event = "BufReadPre", opts = {}, - -- stylua: ignore - keys = { - { "qs", function() require("persistence").load() end, desc = "Restore Session" }, - { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, - { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, - { "db", ":Dashboard", desc = "Dashboard"} - }, + -- stylua: ignore + keys = { + -- { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + -- { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, + -- { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, + { "db", ":Dashboard", desc = "Dashboard"} + }, }, }, } diff --git a/lua/pika/plugins/lsp/mason.lua b/lua/pika/plugins/lsp/mason.lua index d5fcf86..1fec2fe 100644 --- a/lua/pika/plugins/lsp/mason.lua +++ b/lua/pika/plugins/lsp/mason.lua @@ -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", diff --git a/lua/pika/plugins/mini.lua b/lua/pika/plugins/mini.lua index e3bca6d..59d6091 100644 --- a/lua/pika/plugins/mini.lua +++ b/lua/pika/plugins/mini.lua @@ -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 = "", + right = "", + down = "", + up = "", + + line_left = "", + line_right = "", + line_down = "", + line_up = "", + -- 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 = { diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua index 2e39595..558aad0 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,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" }, - { "", 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" }, + -- { "", 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 5236ba4..385326d 100644 --- a/lua/pika/plugins/ui.lua +++ b/lua/pika/plugins/ui.lua @@ -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", "tn", "Telescope notify", { 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 From aa324a3cc035fd3de8d82eb771b0d7ab59383c40 Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 5 Apr 2025 12:15:07 +0200 Subject: [PATCH 27/36] nvim todo changes --- lua/pika/plugins/qol.lua | 6 +++--- lua/pika/plugins/ui.lua | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua index 558aad0..86c0096 100644 --- a/lua/pika/plugins/qol.lua +++ b/lua/pika/plugins/qol.lua @@ -149,9 +149,9 @@ return { opts = { keywords = { NOTE = { icon = " ", color = "hint", alt = { "TIP" } }, - INFO = { icon = " ", color = "info", alt = { "INFORMATION" } }, - ERROR = { icon = " ", color = "error", alt = { "ERR" } }, - WARNING = { icon = " ", color = "warning", alt = { "WARN" } }, + INFO = { icon = " ", color = "info", alt = { "INFORMATION", "IMPORTANT" } }, + ERROR = { icon = " ", color = "error", alt = { "ERR", "CAUTIOIN" } }, + WARNING = { icon = " ", color = "warning", alt = { "WARN", "WHY" } }, }, }, }, diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua index 385326d..2013457 100644 --- a/lua/pika/plugins/ui.lua +++ b/lua/pika/plugins/ui.lua @@ -219,6 +219,7 @@ return { end, vim.keymap.set("n", "tn", "Telescope notify", { desc = "Telescope show Notifications" }), }, + -- ╭──────────────────────────────╮ -- │ slimline - nice bar for nvim │ -- ╰──────────────────────────────╯ From acc5c649f39642e00e8579d7dfe068b3671e8a9c Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 5 Apr 2025 13:33:39 +0200 Subject: [PATCH 28/36] changes for the config --- init.lua | 40 ----- lua/pika/core/init.lua | 2 + lua/pika/core/options.lua | 5 +- lua/pika/plugins/git.lua | 306 +++++++++++++++++++------------------- 4 files changed, 162 insertions(+), 191 deletions(-) diff --git a/init.lua b/init.lua index cbd3f1a..b057c40 100644 --- a/init.lua +++ b/init.lua @@ -10,44 +10,4 @@ else -- ╰──────────────────────────────────────────────────────╯ vim.cmd.colorscheme("rose-pine-moon") - - -- Keybind for saving clipboard screenshot and inserting a Markdown link - vim.api.nvim_set_keymap( - "n", - "ps", - ":lua SaveScreenshotAndInsertLink()", - { noremap = true, silent = true } - ) - - function SaveScreenshotAndInsertLink() - -- Prompt for Hugo base directory if needed - - -- Define the Hugo base directory and screenshot subfolder path - local base_dir - local current_file_dir = vim.fn.expand("%:p:h") - - -- Detect base dir by looking for the Hugo structure, or prompt if not found - if current_file_dir:match("/content/") then - base_dir = current_file_dir:match("(.*)/content/") - else - -- Prompt for Hugo base directory if automatic detection fails - base_dir = vim.fn.input("Enter base directory of your Hugo site: ", "", "file") - end - - local img_folder = base_dir .. "/static/images/screenshots/" - vim.fn.mkdir(img_folder, "p") -- Ensure the directory exists - - -- Define the image name and full path - local img_name = os.date("%Y-%m-%d_%H-%M-%S") .. ".png" - local full_path = img_folder .. img_name - - -- Save clipboard image as binary PNG file using wl-paste - os.execute("wl-paste --type image/png > " .. full_path) - - -- Insert markdown image link at cursor position - local img_markdown = "![](/images/screenshots/" .. img_name .. ")\n" - vim.api.nvim_put({ img_markdown }, "c", true, true) - - print("Screenshot saved and link added: " .. full_path) - end end diff --git a/lua/pika/core/init.lua b/lua/pika/core/init.lua index 4e41d6e..f020bcd 100644 --- a/lua/pika/core/init.lua +++ b/lua/pika/core/init.lua @@ -1,3 +1,5 @@ require("pika.core.options") require("pika.core.keymaps") +require("pika.core.custom") require("pika.core.custom.terminalcmd") +require("pika.core.custom.hugopaste") diff --git a/lua/pika/core/options.lua b/lua/pika/core/options.lua index 47fe86c..3d78ec5 100644 --- a/lua/pika/core/options.lua +++ b/lua/pika/core/options.lua @@ -54,7 +54,10 @@ o.swapfile = false -- Disable the tilde on empty lines -- enable slimline bubble chain ( )----( ) -o.fillchars = { eob = " ", stl = "─" } +o.fillchars = { + eob = " ", + -- stl = "─", +} -- SudaRead automatic if file is inaccessible vim.g.suda_smart_edit = 1 diff --git a/lua/pika/plugins/git.lua b/lua/pika/plugins/git.lua index b6cfc5c..33c4271 100644 --- a/lua/pika/plugins/git.lua +++ b/lua/pika/plugins/git.lua @@ -1,156 +1,162 @@ return { { - "tanvirtin/vgit.nvim", - dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" }, - -- Lazy loading on 'VimEnter' event is necessary. - event = "VimEnter", - config = function() - require("vgit").setup( - -- keymaps = { - -- ["n "] = { - -- function() - -- require("vgit").hunk_up() - -- end, - -- desc = "VGit Hunk Up", - -- }, - -- ["n "] = { - -- function() - -- require("vgit").hunk_down() - -- end, - -- desc = "VGit Hunk Down", - -- }, - -- ["n gs"] = { - -- function() - -- require("vgit").buffer_hunk_stage() - -- end, - -- desc = "VGit Stage Hunk", - -- }, - -- ["n gr"] = { - -- function() - -- require("vgit").buffer_hunk_reset() - -- end, - -- desc = "VGit Reset Hunk", - -- }, - -- ["n gp"] = { - -- function() - -- require("vgit").buffer_hunk_preview() - -- end, - -- desc = "VGit Preview Hunk", - -- }, - -- ["n gb"] = { - -- function() - -- require("vgit").buffer_blame_preview() - -- end, - -- desc = "VGit Blame Preview", - -- }, - -- ["n gf"] = { - -- function() - -- require("vgit").buffer_diff_preview() - -- end, - -- desc = "VGit Diff Preview", - -- }, - -- ["n gh"] = { - -- function() - -- require("vgit").buffer_history_preview() - -- end, - -- desc = "VGit History Preview", - -- }, - -- ["n gu"] = { - -- function() - -- require("vgit").buffer_reset() - -- end, - -- desc = "VGit Reset Buffer", - -- }, - -- ["n gcm"] = { - -- function() - -- require("vgit").project_commit_preview() - -- end, - -- desc = "VGit Commit Preview", - -- }, - -- ["n gcc"] = { - -- function() - -- require("vgit").project_commits_preview() - -- end, - -- desc = "VGit Commits Preview", - -- }, - -- ["n gcl"] = { - -- function() - -- require("vgit").project_logs_preview() - -- end, - -- desc = "VGit Logs Preview", - -- }, - -- ["n gd"] = { - -- function() - -- require("vgit").project_diff_preview() - -- end, - -- desc = "VGit Project Diff", - -- }, - -- ["n gx"] = { - -- function() - -- require("vgit").toggle_diff_preference() - -- end, - -- desc = "VGit Toggle Diff Preference", - -- }, - -- }, - ) - end, - - vim.keymap.set("n", "", function() - require("vgit").hunk_up() - end, { desc = "VGit Hunk Up" }), - - vim.keymap.set("n", "", function() - require("vgit").hunk_down() - end, { desc = "VGit Hunk Down" }), - - vim.keymap.set("n", "gs", function() - require("vgit").buffer_hunk_stage() - end, { desc = "VGit Stage Hunk" }), - - vim.keymap.set("n", "gr", function() - require("vgit").buffer_hunk_reset() - end, { desc = "VGit Reset Hunk" }), - - vim.keymap.set("n", "gp", function() - require("vgit").buffer_hunk_preview() - end, { desc = "VGit Preview Hunk" }), - - vim.keymap.set("n", "gb", function() - require("vgit").buffer_blame_preview() - end, { desc = "VGit Blame Preview" }), - - vim.keymap.set("n", "gf", function() - require("vgit").buffer_diff_preview() - end, { desc = "VGit Diff Preview" }), - - vim.keymap.set("n", "gh", function() - require("vgit").buffer_history_preview() - end, { desc = "VGit History Preview" }), - - vim.keymap.set("n", "gu", function() - require("vgit").buffer_reset() - end, { desc = "VGit Reset Buffer" }), - - vim.keymap.set("n", "gcm", function() - require("vgit").project_commit_preview() - end, { desc = "VGit Commit Preview" }), - - vim.keymap.set("n", "gcc", function() - require("vgit").project_commits_preview() - end, { desc = "VGit Commits Preview" }), - - vim.keymap.set("n", "gcl", function() - require("vgit").project_logs_preview() - end, { desc = "VGit Logs Preview" }), - - vim.keymap.set("n", "gd", function() - require("vgit").project_diff_preview() - end, { desc = "VGit Project Diff" }), - - vim.keymap.set("n", "gx", function() - require("vgit").toggle_diff_preference() - end, { desc = "VGit Toggle Diff Preference" }), + "sindrets/diffview.nvim", + opts = {}, + vim.keymap.set("n", "gd", "DiffviewOpen", { desc = "Git DiffviewOpen" }), + vim.keymap.set("n", "gc", "DiffviewClose", { desc = "Git DiffviewClose" }), }, + -- { + -- "tanvirtin/vgit.nvim", + -- dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" }, + -- -- Lazy loading on 'VimEnter' event is necessary. + -- event = "VimEnter", + -- config = function() + -- require("vgit").setup( + -- -- keymaps = { + -- -- ["n "] = { + -- -- function() + -- -- require("vgit").hunk_up() + -- -- end, + -- -- desc = "VGit Hunk Up", + -- -- }, + -- -- ["n "] = { + -- -- function() + -- -- require("vgit").hunk_down() + -- -- end, + -- -- desc = "VGit Hunk Down", + -- -- }, + -- -- ["n gs"] = { + -- -- function() + -- -- require("vgit").buffer_hunk_stage() + -- -- end, + -- -- desc = "VGit Stage Hunk", + -- -- }, + -- -- ["n gr"] = { + -- -- function() + -- -- require("vgit").buffer_hunk_reset() + -- -- end, + -- -- desc = "VGit Reset Hunk", + -- -- }, + -- -- ["n gp"] = { + -- -- function() + -- -- require("vgit").buffer_hunk_preview() + -- -- end, + -- -- desc = "VGit Preview Hunk", + -- -- }, + -- -- ["n gb"] = { + -- -- function() + -- -- require("vgit").buffer_blame_preview() + -- -- end, + -- -- desc = "VGit Blame Preview", + -- -- }, + -- -- ["n gf"] = { + -- -- function() + -- -- require("vgit").buffer_diff_preview() + -- -- end, + -- -- desc = "VGit Diff Preview", + -- -- }, + -- -- ["n gh"] = { + -- -- function() + -- -- require("vgit").buffer_history_preview() + -- -- end, + -- -- desc = "VGit History Preview", + -- -- }, + -- -- ["n gu"] = { + -- -- function() + -- -- require("vgit").buffer_reset() + -- -- end, + -- -- desc = "VGit Reset Buffer", + -- -- }, + -- -- ["n gcm"] = { + -- -- function() + -- -- require("vgit").project_commit_preview() + -- -- end, + -- -- desc = "VGit Commit Preview", + -- -- }, + -- -- ["n gcc"] = { + -- -- function() + -- -- require("vgit").project_commits_preview() + -- -- end, + -- -- desc = "VGit Commits Preview", + -- -- }, + -- -- ["n gcl"] = { + -- -- function() + -- -- require("vgit").project_logs_preview() + -- -- end, + -- -- desc = "VGit Logs Preview", + -- -- }, + -- -- ["n gd"] = { + -- -- function() + -- -- require("vgit").project_diff_preview() + -- -- end, + -- -- desc = "VGit Project Diff", + -- -- }, + -- -- ["n gx"] = { + -- -- function() + -- -- require("vgit").toggle_diff_preference() + -- -- end, + -- -- desc = "VGit Toggle Diff Preference", + -- -- }, + -- -- }, + -- ) + -- end, + -- + -- vim.keymap.set("n", "", function() + -- require("vgit").hunk_up() + -- end, { desc = "VGit Hunk Up" }), + -- + -- vim.keymap.set("n", "", function() + -- require("vgit").hunk_down() + -- end, { desc = "VGit Hunk Down" }), + -- + -- vim.keymap.set("n", "gs", function() + -- require("vgit").buffer_hunk_stage() + -- end, { desc = "VGit Stage Hunk" }), + -- + -- vim.keymap.set("n", "gr", function() + -- require("vgit").buffer_hunk_reset() + -- end, { desc = "VGit Reset Hunk" }), + -- + -- vim.keymap.set("n", "gp", function() + -- require("vgit").buffer_hunk_preview() + -- end, { desc = "VGit Preview Hunk" }), + -- + -- vim.keymap.set("n", "gb", function() + -- require("vgit").buffer_blame_preview() + -- end, { desc = "VGit Blame Preview" }), + -- + -- vim.keymap.set("n", "gf", function() + -- require("vgit").buffer_diff_preview() + -- end, { desc = "VGit Diff Preview" }), + -- + -- vim.keymap.set("n", "gh", function() + -- require("vgit").buffer_history_preview() + -- end, { desc = "VGit History Preview" }), + -- + -- vim.keymap.set("n", "gu", function() + -- require("vgit").buffer_reset() + -- end, { desc = "VGit Reset Buffer" }), + -- + -- vim.keymap.set("n", "gcm", function() + -- require("vgit").project_commit_preview() + -- end, { desc = "VGit Commit Preview" }), + -- + -- vim.keymap.set("n", "gcc", function() + -- require("vgit").project_commits_preview() + -- end, { desc = "VGit Commits Preview" }), + -- + -- vim.keymap.set("n", "gcl", function() + -- require("vgit").project_logs_preview() + -- end, { desc = "VGit Logs Preview" }), + -- + -- vim.keymap.set("n", "gd", function() + -- require("vgit").project_diff_preview() + -- end, { desc = "VGit Project Diff" }), + -- + -- vim.keymap.set("n", "gx", function() + -- require("vgit").toggle_diff_preference() + -- end, { desc = "VGit Toggle Diff Preference" }), + -- }, { "lewis6991/gitsigns.nvim", From 3af369e397c6ad1259a29f685c547d3ce9960675 Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 5 Apr 2025 18:50:52 +0200 Subject: [PATCH 29/36] addet lualine becouse slimline has compatability issues --- lua/pika/plugins/ui.lua | 210 +++++++++++++++++++++++----------------- 1 file changed, 123 insertions(+), 87 deletions(-) diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua index 2013457..81adb22 100644 --- a/lua/pika/plugins/ui.lua +++ b/lua/pika/plugins/ui.lua @@ -220,96 +220,132 @@ return { vim.keymap.set("n", "tn", "Telescope notify", { desc = "Telescope show Notifications" }), }, + -- ╭────────────────────────────────╮ + -- │ lualine - another bar for nvim │ + -- ╰────────────────────────────────╯ + { + "nvim-lualine/lualine.nvim", + opts = { + options = { + theme = bubbles_theme, + component_separators = "", + section_separators = { left = "", right = "" }, + }, + sections = { + lualine_a = { { "mode", separator = { left = "" }, right_padding = 4 } }, + lualine_b = { "filename", "branch" }, + lualine_c = { + "%=", + "cwd", + }, + lualine_x = {}, + lualine_y = { "filetype", "progress" }, + lualine_z = { + { "location", separator = { right = "" }, left_padding = 4 }, + }, + }, + inactive_sections = { + lualine_a = { "filename" }, + lualine_b = {}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = { "location" }, + }, + tabline = {}, + extensions = {}, + }, + }, + -- ╭──────────────────────────────╮ -- │ slimline - nice bar for nvim │ -- ╰──────────────────────────────╯ - { - -- Calls `require('slimline').setup({})` - "sschleemilch/slimline.nvim", - opts = { - bold = true, -- makes primary parts and mode bold - 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", - }, - center = { - "path", - "git", - }, - right = { - "diagnostics", - "filetype_lsp", - "progress", - }, - }, - sep = { - hide = { - first = false, -- hides the first separator - last = false, -- hides the last separator - }, - left = "", -- left separator of components - right = "", -- right separator of components - }, - hl = { - modes = { - normal = "Type", -- highlight base of modes - insert = "Function", - pending = "Boolean", - visual = "Keyword", - command = "String", - }, - base = "Comment", -- highlight of everything in in between components - primary = "Normal", -- highlight of primary parts (e.g. filename) - secondary = "Comment", -- highlight of secondary parts (e.g. filepath) - }, - icons = { - diagnostics = { - ERROR = " ", - WARN = " ", - HINT = " ", - INFO = " ", - }, - git = { - branch = "", - }, - folder = " ", - lines = " ", - }, - }, - }, + -- { + -- "sschleemilch/slimline.nvim", + -- opts = { + -- bold = true, -- makes primary parts and mode bold + -- 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", + -- }, + -- center = { + -- "path", + -- "git", + -- }, + -- right = { + -- "diagnostics", + -- "filetype_lsp", + -- "progress", + -- }, + -- }, + -- sep = { + -- hide = { + -- first = false, -- hides the first separator + -- last = false, -- hides the last separator + -- }, + -- left = "", -- left separator of components + -- right = "", -- right separator of components + -- }, + -- hl = { + -- modes = { + -- normal = "Type", -- highlight base of modes + -- insert = "Function", + -- pending = "Boolean", + -- visual = "Keyword", + -- command = "String", + -- }, + -- base = "Comment", -- highlight of everything in in between components + -- primary = "Normal", -- highlight of primary parts (e.g. filename) + -- secondary = "Comment", -- highlight of secondary parts (e.g. filepath) + -- }, + -- icons = { + -- diagnostics = { + -- ERROR = " ", + -- WARN = " ", + -- HINT = " ", + -- INFO = " ", + -- }, + -- git = { + -- branch = "", + -- }, + -- folder = " ", + -- lines = " ", + -- }, + -- }, + -- }, -- ╭────────────────────────────────────────╮ -- │ which key - to know what to press next │ From d5652f6685d7938ab6eaeed166b19a62991f9fc8 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 7 Apr 2025 12:48:18 +0200 Subject: [PATCH 30/36] typo and changed grep text for w(ord) --- lua/pika/plugins/dashboard.lua | 2 +- lua/pika/plugins/qol.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/pika/plugins/dashboard.lua b/lua/pika/plugins/dashboard.lua index 96e3de6..51c7f37 100644 --- a/lua/pika/plugins/dashboard.lua +++ b/lua/pika/plugins/dashboard.lua @@ -55,7 +55,7 @@ return { end, desc = " Find Text", icon = " ", - key = "g", + key = "w", }, { action = function() diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua index 86c0096..95d2da7 100644 --- a/lua/pika/plugins/qol.lua +++ b/lua/pika/plugins/qol.lua @@ -150,7 +150,7 @@ return { keywords = { NOTE = { icon = " ", color = "hint", alt = { "TIP" } }, INFO = { icon = " ", color = "info", alt = { "INFORMATION", "IMPORTANT" } }, - ERROR = { icon = " ", color = "error", alt = { "ERR", "CAUTIOIN" } }, + ERROR = { icon = " ", color = "error", alt = { "ERR", "CAUTION" } }, WARNING = { icon = " ", color = "warning", alt = { "WARN", "WHY" } }, }, }, From 2e23a2116f78a9d47259e46f01a9a20c3913f467 Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 7 Apr 2025 12:48:51 +0200 Subject: [PATCH 31/36] removed neodev becouse of deprication? --- lua/pika/plugins/lsp/blink-cmp.lua | 2 +- lua/pika/plugins/lsp/nvim-cmp.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/pika/plugins/lsp/blink-cmp.lua b/lua/pika/plugins/lsp/blink-cmp.lua index 1603997..495ac0f 100644 --- a/lua/pika/plugins/lsp/blink-cmp.lua +++ b/lua/pika/plugins/lsp/blink-cmp.lua @@ -494,7 +494,7 @@ return { dependencies = { { "saghen/blink.cmp" }, { "antosha417/nvim-lsp-file-operations", config = true }, - { "folke/neodev.nvim", opts = {} }, + -- { "folke/neodev.nvim", opts = {} }, }, config = function() diff --git a/lua/pika/plugins/lsp/nvim-cmp.lua b/lua/pika/plugins/lsp/nvim-cmp.lua index 0149837..26a7868 100644 --- a/lua/pika/plugins/lsp/nvim-cmp.lua +++ b/lua/pika/plugins/lsp/nvim-cmp.lua @@ -151,7 +151,7 @@ return { dependencies = { "hrsh7th/cmp-nvim-lsp", "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip" }, }, { "antosha417/nvim-lsp-file-operations", config = true }, - { "folke/neodev.nvim", opts = {} }, + -- { "folke/neodev.nvim", opts = {} }, }, config = function() From 67d22af38e6a5bfc51df238d092eba2b85d79cbf Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 10 Apr 2025 10:15:43 +0200 Subject: [PATCH 32/36] addet quotes to the dashboard --- lua/pika/plugins/dashboard.lua | 40 ++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/lua/pika/plugins/dashboard.lua b/lua/pika/plugins/dashboard.lua index 51c7f37..d1298eb 100644 --- a/lua/pika/plugins/dashboard.lua +++ b/lua/pika/plugins/dashboard.lua @@ -1,4 +1,12 @@ return { + { + "RileyGabrielson/inspire.nvim", + config = function() + require("inspire").setup({ + mode = "random", + }) + end, + }, { "nvimdev/dashboard-nvim", lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. @@ -22,7 +30,14 @@ return { ██████ █████████████████████ ████ █████ █████ ████ ██████ ]] - logo = string.rep("\n", 8) .. logo .. "\n\n" + local inspire = require("inspire") + local quote = inspire.get_quote() + local centered_quote_lines = inspire.center_text(quote.text, quote.author, 52, 8, 52) + + -- Convert the table of lines to a single string with newlines + local centered_quote_str = table.concat(centered_quote_lines, "\n") + + logo = string.rep("\n", 8) .. logo .. "\n\n" .. centered_quote_str .. "\n\n" local opts = { theme = "doom", @@ -113,16 +128,19 @@ return { return opts end, dependencies = { - "folke/persistence.nvim", - event = "BufReadPre", - opts = {}, - -- stylua: ignore - keys = { - -- { "qs", function() require("persistence").load() end, desc = "Restore Session" }, - -- { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, - -- { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, - { "db", ":Dashboard", desc = "Dashboard"} - }, + { + "folke/persistence.nvim", + event = "BufReadPre", + opts = {}, + -- stylua: ignore + keys = { + -- { "qs", function() require("persistence").load() end, desc = "Restore Session" }, + -- { "ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" }, + -- { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, + { "db", ":Dashboard", desc = "Dashboard"}, + { "dq", function() require("inspire").show_quote() end, desc = "Show Inspire Quote"}, + }, + }, }, }, } From 49cd9c66bed42caccbd933068d76229a54e45589 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 10 Apr 2025 10:21:56 +0200 Subject: [PATCH 33/36] addet icons to the dashboard --- lua/pika/plugins/dashboard.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lua/pika/plugins/dashboard.lua b/lua/pika/plugins/dashboard.lua index d1298eb..fc09786 100644 --- a/lua/pika/plugins/dashboard.lua +++ b/lua/pika/plugins/dashboard.lua @@ -52,16 +52,21 @@ return { require("telescope.builtin").find_files() end, desc = " Find File", - icon = " ", + icon = " ", key = "f", }, - { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, + { + action = "ene | startinsert", + desc = " New File", + icon = " ", + key = "n", + }, { action = function() require("telescope.builtin").oldfiles() end, desc = " Recent Files", - icon = " ", + icon = " ", key = "r", }, { @@ -69,7 +74,7 @@ return { require("telescope.builtin").live_grep() end, desc = " Find Text", - icon = " ", + icon = "󱄽 ", key = "w", }, { @@ -77,13 +82,13 @@ return { require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") }) end, desc = " Search Neovim files", - icon = " ", + icon = " ", key = "c", }, { action = 'lua require("persistence").load()', desc = " Restore Session", - icon = " ", + icon = " ", key = "s", }, -- { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, @@ -93,7 +98,7 @@ return { vim.api.nvim_input("qa") end, desc = " Quit", - icon = " ", + icon = "󰅘 ", key = "q", }, }, From f62470d43c8a44508abb28ffbcbf308fdaa429b8 Mon Sep 17 00:00:00 2001 From: piecka Date: Thu, 10 Apr 2025 11:08:13 +0200 Subject: [PATCH 34/36] addet some goodies --- lua/pika/core/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/pika/core/keymaps.lua b/lua/pika/core/keymaps.lua index c48cd1b..1c7fcde 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -53,7 +53,7 @@ map("n", "s", vim.cmd.w) map("n", "", vim.cmd.w) -- Visual mode: Indent selected lines --- INFO: got removed becouse of the mini-move plugin +-- INFO: got removed because of the mini-move plugin -- map("v", "", ">gv", { desc = "Indent and keep selection" }) -- map("v", "", " Date: Thu, 10 Apr 2025 11:19:28 +0200 Subject: [PATCH 35/36] addet custom configs --- .gitignore | 2 +- lua/pika/core/custom/hugopaste.lua | 34 +++++++++++++++++++++ lua/pika/core/custom/init.lua | 13 +++++++++ lua/pika/plugins/colorschemes.lua | 47 +++++++++++++++--------------- 4 files changed, 71 insertions(+), 25 deletions(-) create mode 100644 lua/pika/core/custom/hugopaste.lua create mode 100644 lua/pika/core/custom/init.lua diff --git a/.gitignore b/.gitignore index eed252c..9b945f4 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,4 @@ lazy-lock.json cd-project.nvim.json -custom/ +# custom/ diff --git a/lua/pika/core/custom/hugopaste.lua b/lua/pika/core/custom/hugopaste.lua new file mode 100644 index 0000000..02b21b7 --- /dev/null +++ b/lua/pika/core/custom/hugopaste.lua @@ -0,0 +1,34 @@ +function SaveScreenshotAndInsertLink() + -- Prompt for Hugo base directory if needed + + -- Define the Hugo base directory and screenshot subfolder path + local base_dir + local current_file_dir = vim.fn.expand("%:p:h") + + -- Detect base dir by looking for the Hugo structure, or prompt if not found + if current_file_dir:match("/content/") then + base_dir = current_file_dir:match("(.*)/content/") + else + -- Prompt for Hugo base directory if automatic detection fails + base_dir = vim.fn.input("Enter base directory of your Hugo site: ", "", "file") + end + + local img_folder = base_dir .. "/static/images/screenshots/" + vim.fn.mkdir(img_folder, "p") -- Ensure the directory exists + + -- Define the image name and full path + local img_name = os.date("%Y-%m-%d_%H-%M-%S") .. ".png" + local full_path = img_folder .. img_name + + -- Save clipboard image as binary PNG file using wl-paste + os.execute("wl-paste --type image/png > " .. full_path) + + -- Insert markdown image link at cursor position + local img_markdown = "![](/images/screenshots/" .. img_name .. ")\n" + vim.api.nvim_put({ img_markdown }, "c", true, true) + + print("Screenshot saved and link added: " .. full_path) +end + +-- Keybind for saving clipboard screenshot and inserting a Markdown link +vim.api.nvim_set_keymap("n", "ps", ":lua SaveScreenshotAndInsertLink()", { noremap = true, silent = true }) diff --git a/lua/pika/core/custom/init.lua b/lua/pika/core/custom/init.lua new file mode 100644 index 0000000..215237a --- /dev/null +++ b/lua/pika/core/custom/init.lua @@ -0,0 +1,13 @@ +vim.api.nvim_create_autocmd("TermOpen", { + group = vim.api.nvim_create_augroup("custom-term-open", { clear = true }), + callback = function() + vim.opt.number = false + vim.opt.relativenumber = false + end, +}) + +vim.keymap.set("n", "ts", function() + vim.cmd.new() + vim.cmd.term() + vim.api.nvim_win_set_height(0, 15) +end) diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua index 1cac46b..f71e803 100644 --- a/lua/pika/plugins/colorschemes.lua +++ b/lua/pika/plugins/colorschemes.lua @@ -1,10 +1,9 @@ return { -- { "folke/tokyonight.nvim" }, - -- { "catppuccin/nvim", name = "catppuccin" }, - -- { "EdenEast/nightfox.nvim" }, - -- { "DanWlker/primeppuccin", name = "primeppuccin" }, + { "catppuccin/nvim", name = "catppuccin" }, + { "EdenEast/nightfox.nvim" }, { "fynnfluegge/monet.nvim", name = "monet" }, - { "L-Colombo/oldschool.nvim", config = "true" }, + { "L-Colombo/oldschool.nvim", config = true }, { "rose-pine/neovim", name = "rose-pine" }, { "AlexvZyl/nordic.nvim" }, { "eldritch-theme/eldritch.nvim" }, @@ -91,26 +90,26 @@ return { -- }, -- }, -- }, - { - "neko-night/nvim", - lazy = false, - -- priority = 1000, - opts = { - transparent = false, -- Enable this to disable setting the background color - terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim - styles = { - -- Style to be applied to different syntax groups - -- Value is any valid attr-list value for `:help nvim_set_hl` - comments = { italic = false }, - keywords = { italic = true }, - functions = { bold = true }, - variables = { bold = true }, - -- Background styles. Can be "dark", "transparent" or "normal" - sidebars = "dark", -- style for sidebars, see below - floats = "dark", -- style for floating windows - }, - }, - }, + -- { + -- "neko-night/nvim", + -- lazy = false, + -- -- priority = 1000, + -- opts = { + -- transparent = false, -- Enable this to disable setting the background color + -- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim + -- styles = { + -- -- Style to be applied to different syntax groups + -- -- Value is any valid attr-list value for `:help nvim_set_hl` + -- comments = { italic = false }, + -- keywords = { italic = true }, + -- functions = { bold = true }, + -- variables = { bold = true }, + -- -- Background styles. Can be "dark", "transparent" or "normal" + -- sidebars = "dark", -- style for sidebars, see below + -- floats = "dark", -- style for floating windows + -- }, + -- }, + -- }, { "scottmckendry/cyberdream.nvim", name = "cyberdream", From c795da7aef3c9308abbdeab536db59797bb00d51 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 10 Apr 2025 11:20:59 +0200 Subject: [PATCH 36/36] made custom.lua not source anymore --- lua/pika/plugins/{custom.lua => custom.lua.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lua/pika/plugins/{custom.lua => custom.lua.bak} (100%) diff --git a/lua/pika/plugins/custom.lua b/lua/pika/plugins/custom.lua.bak similarity index 100% rename from lua/pika/plugins/custom.lua rename to lua/pika/plugins/custom.lua.bak