diff --git a/.gitignore b/.gitignore index 9b945f4..55d79fe 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,3 @@ lazy-lock.json cd-project.nvim.json -# custom/ diff --git a/functions.sh b/functions.sh deleted file mode 100644 index 26455bf..0000000 --- a/functions.sh +++ /dev/null @@ -1,3 +0,0 @@ -get_ip() { - ip a | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}' | cut -d/ -f1 | head -n 1 -} diff --git a/init.lua b/init.lua index b057c40..a4a2ea5 100644 --- a/init.lua +++ b/init.lua @@ -1,13 +1,9 @@ -if vim.g.vscode then - require("pika.core") -else - require("pika.core") - require("pika.lazy") +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("rose-pine-moon") -end +vim.cmd.colorscheme("oldschool") diff --git a/lua/pika/core/custom/hugopaste.lua b/lua/pika/core/custom/hugopaste.lua deleted file mode 100644 index 02b21b7..0000000 --- a/lua/pika/core/custom/hugopaste.lua +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index 215237a..0000000 --- a/lua/pika/core/custom/init.lua +++ /dev/null @@ -1,13 +0,0 @@ -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/core/custom/terminalcmd.lua b/lua/pika/core/custom/terminalcmd.lua deleted file mode 100644 index 7d07e55..0000000 --- a/lua/pika/core/custom/terminalcmd.lua +++ /dev/null @@ -1,52 +0,0 @@ --- ─< 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 f020bcd..3ab7175 100644 --- a/lua/pika/core/init.lua +++ b/lua/pika/core/init.lua @@ -1,5 +1,2 @@ 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/keymaps.lua b/lua/pika/core/keymaps.lua index 1c7fcde..57203c8 100644 --- a/lua/pika/core/keymaps.lua +++ b/lua/pika/core/keymaps.lua @@ -1,7 +1,5 @@ --- INFO: Maps leader to 'space' vim.g.mapleader = " " --- TIP: Unmap keymaps -- ─< lua/keymaps.lua >───────────────────────────────────────────────────────────────── local nomap = vim.keymap.set nomap("i", "", "") @@ -10,16 +8,17 @@ 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" }) @@ -29,9 +28,10 @@ map("i", "", "", { desc = "move down" }) map("i", "", "", { desc = "move up" }) map("n", ";", ":", { desc = "CMD enter command mode" }) - --- CTRL-C for escape -map({ "i", "n", "v" }, "", "") +map("i", "jk", "") +map("i", "", "") +map("n", "", "") +map("v", "", "") map("n", "x", "bd!") @@ -48,31 +48,12 @@ 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 --- INFO: got removed because of the mini-move plugin --- map("v", "", ">gv", { desc = "Indent and keep selection" }) --- map("v", "", "─────────────────────────────────────────────────────────── +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 - --- ─< Terminal >──────────────────────────────────────────────────────────────────────── --- NOTE: This is only for terminal mode -map("t", "", "", { desc = "terminal escape terminal mode" }) - --- ──────────────────────────────< rename word under cursor >────────────────────────────── --- map("n", "R", [[:%s/\<\>//gI]]) --- ───────────────< Enhanced word under cursor renaming in current buffer >──────────── -map({ "n", "x" }, "R", function() - local text = vim.fn.mode() == "n" and vim.fn.expand("") or vim.fn.trim(vim.fn.getreg('"')) - vim.ui.input({ prompt = "Replace: ", default = text }, function(input) - if input and input ~= text then - vim.cmd(("keeppatterns %%s/%s/%s/g"):format(vim.pesc(text), vim.pesc(input))) - end - end) -end, { desc = "Rename in buffer" }) diff --git a/lua/pika/core/options.lua b/lua/pika/core/options.lua index 3d78ec5..fa3fc11 100644 --- a/lua/pika/core/options.lua +++ b/lua/pika/core/options.lua @@ -53,11 +53,7 @@ o.laststatus = 3 o.swapfile = false -- Disable the tilde on empty lines --- enable slimline bubble chain ( )----( ) -o.fillchars = { - eob = " ", - -- stl = "─", -} +o.fillchars = { eob = " " } -- SudaRead automatic if file is inaccessible vim.g.suda_smart_edit = 1 @@ -81,7 +77,7 @@ vim.cmd([[ if vim.g.neovide then -- vim.g.neovide_transparency = 0.35 - vim.g.neovide_opacity = 1 + vim.g.neovide_transparency = 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 dae8236..d56a156 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,13 +23,14 @@ 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. - ui = { backdrop = 100 }, - -- 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. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "nord" } }, + -- automatically check for plugin updates + checker = { enabled = true }, }) diff --git a/lua/pika/plugins/ai.lua b/lua/pika/plugins/ai.lua deleted file mode 100644 index 1864ce1..0000000 --- a/lua/pika/plugins/ai.lua +++ /dev/null @@ -1,61 +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/colorschemes.lua b/lua/pika/plugins/colorschemes.lua index f71e803..750d932 100644 --- a/lua/pika/plugins/colorschemes.lua +++ b/lua/pika/plugins/colorschemes.lua @@ -1,123 +1,34 @@ return { - -- { "folke/tokyonight.nvim" }, - { "catppuccin/nvim", name = "catppuccin" }, - { "EdenEast/nightfox.nvim" }, + { "folke/tokyonight.nvim" }, { "fynnfluegge/monet.nvim", name = "monet" }, - { "L-Colombo/oldschool.nvim", config = true }, - { "rose-pine/neovim", name = "rose-pine" }, + { "L-Colombo/oldschool.nvim", config = "true" }, + -- { "catppuccin/nvim", name = "catppuccin" }, + -- { "EdenEast/nightfox.nvim" }, + -- { "DanWlker/primeppuccin", name = "primeppuccin" }, + -- { "rose-pine/neovim", name = "rose-pine" }, { "AlexvZyl/nordic.nvim" }, { "eldritch-theme/eldritch.nvim" }, + -- { "sainnhe/sonokai" }, { "samharju/synthweave.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 = { - -- style = { - -- italic_comments = false, - -- italic_strings = false, - -- transparent = false, - -- }, - -- }, - -- }, - -- { - -- "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", + "neko-night/nvim", lazy = false, + -- priority = 1000, opts = { - transparent = false, - hide_fillchars = true, - terminal_colors = true, + 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 = true }, + 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 + }, }, }, { diff --git a/lua/pika/plugins/custom.lua.bak b/lua/pika/plugins/custom.lua.bak deleted file mode 100644 index 2f2d350..0000000 --- a/lua/pika/plugins/custom.lua.bak +++ /dev/null @@ -1,7 +0,0 @@ -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/dashboard.lua b/lua/pika/plugins/dashboard.lua index fc09786..1646807 100644 --- a/lua/pika/plugins/dashboard.lua +++ b/lua/pika/plugins/dashboard.lua @@ -1,12 +1,4 @@ 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. @@ -30,14 +22,7 @@ return { ██████ █████████████████████ ████ █████ █████ ████ ██████ ]] - 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" + logo = string.rep("\n", 8) .. logo .. "\n\n" local opts = { theme = "doom", @@ -52,21 +37,16 @@ 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", }, { @@ -74,21 +54,21 @@ return { require("telescope.builtin").live_grep() end, desc = " Find Text", - icon = "󱄽 ", - key = "w", + icon = " ", + key = "g", }, { action = function() 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" }, @@ -98,7 +78,7 @@ return { vim.api.nvim_input("qa") end, desc = " Quit", - icon = "󰅘 ", + icon = " ", key = "q", }, }, @@ -133,19 +113,16 @@ 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"}, - { "dq", function() require("inspire").show_quote() end, desc = "Show Inspire Quote"}, - }, - }, + "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"} + }, }, }, } diff --git a/lua/pika/plugins/explorer.lua b/lua/pika/plugins/explorer.lua index 25d33c4..6791427 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 - "tLf", + "Lf", "Yazi cwd", - desc = "Terminal - Open yazi in nvim's working directory", + desc = "Open the file manager 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 - "tlf", + "lf", "Yazi toggle", - desc = "Terminal - Resume the last yazi session", + desc = "Resume the last yazi session", }, }, ---@type YaziConfig diff --git a/lua/pika/plugins/git.lua b/lua/pika/plugins/git.lua index 33c4271..ace065d 100644 --- a/lua/pika/plugins/git.lua +++ b/lua/pika/plugins/git.lua @@ -1,162 +1,156 @@ return { { - "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" }), }, - -- { - -- "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", @@ -180,7 +174,7 @@ return { signs_staged_enable = true, signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` numhl = true, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + linehl = true, -- Toggle with `:Gitsigns toggle_linehl` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` watch_gitdir = { follow_files = true, diff --git a/lua/pika/plugins/lsp/blink-cmp.lua b/lua/pika/plugins/lsp/blink-cmp.lua deleted file mode 100644 index 495ac0f..0000000 --- a/lua/pika/plugins/lsp/blink-cmp.lua +++ /dev/null @@ -1,590 +0,0 @@ --- 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 │ - -- ╰───────────╯ - { - "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 - cmdline = { sources = { "cmdline" } }, - 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("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 - - use_nvim_cmp_as_default = true, - }, - - -- (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, - 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 = false, - show_with_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 = { - -- 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) - 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, - -- }, - - 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", - }, - }, - }, - }, - }, - - -- 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" }, - }, - - -- 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", - - -- 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" }, - }, - - -- ─────────────────────────────────< 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 new file mode 100644 index 0000000..4b68229 --- /dev/null +++ b/lua/pika/plugins/lsp/lspconfig.lua @@ -0,0 +1,132 @@ +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/mason.lua b/lua/pika/plugins/lsp/mason.lua index 1fec2fe..d5fcf86 100644 --- a/lua/pika/plugins/lsp/mason.lua +++ b/lua/pika/plugins/lsp/mason.lua @@ -4,9 +4,6 @@ return { "williamboman/mason-lspconfig.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim", }, - -- opts = { - -- - -- } config = function() -- import mason local mason = require("mason") @@ -49,9 +46,6 @@ 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 59d6091..e3bca6d 100644 --- a/lua/pika/plugins/mini.lua +++ b/lua/pika/plugins/mini.lua @@ -1,52 +1,22 @@ return { - -- INFO: -- mini-ai for a and i selections or other --> vin" for visual in next "" { "echasnovski/mini.ai", - version = "*", + version = "false", opts = {}, }, - -- TIP: -- ─< mini-surround for surrounding words or lines with "" or () or '' etc.. >────────── { "echasnovski/mini.surround", - version = "*", + version = "false", 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 = "*", + version = "false", opts = {}, lazy = true, specs = { diff --git a/lua/pika/plugins/lsp/nvim-cmp.lua b/lua/pika/plugins/nvim-cmp.lua similarity index 50% rename from lua/pika/plugins/lsp/nvim-cmp.lua rename to lua/pika/plugins/nvim-cmp.lua index 26a7868..704a168 100644 --- a/lua/pika/plugins/lsp/nvim-cmp.lua +++ b/lua/pika/plugins/nvim-cmp.lua @@ -1,9 +1,3 @@ -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", @@ -142,136 +136,4 @@ 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, - }, } diff --git a/lua/pika/plugins/lsp/nvim-treesitter-text-objects.lua b/lua/pika/plugins/nvim-treesitter-text-objects.lua similarity index 100% rename from lua/pika/plugins/lsp/nvim-treesitter-text-objects.lua rename to lua/pika/plugins/nvim-treesitter-text-objects.lua diff --git a/lua/pika/plugins/qol.lua b/lua/pika/plugins/qol.lua index 95d2da7..c012d60 100644 --- a/lua/pika/plugins/qol.lua +++ b/lua/pika/plugins/qol.lua @@ -138,24 +138,6 @@ return { ), }, - -- ─< ERROR: 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", alt = { "TIP" } }, - INFO = { icon = " ", color = "info", alt = { "INFORMATION", "IMPORTANT" } }, - ERROR = { icon = " ", color = "error", alt = { "ERR", "CAUTION" } }, - WARNING = { icon = " ", color = "warning", alt = { "WARN", "WHY" } }, - }, - }, - }, - -- ╭───────────╮ -- │ colorizer │ -- ╰───────────╯ @@ -201,7 +183,7 @@ return { enable_named_colors = true, ---Highlight tailwind colors, e.g. 'bg-blue-500' - enable_tailwind = true, + enable_tailwind = false, ---Set custom colors ---Label must be properly escaped with '%' to adhere to `string.gmatch` @@ -220,21 +202,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/surround.lua b/lua/pika/plugins/surround.lua new file mode 100644 index 0000000..77f5073 --- /dev/null +++ b/lua/pika/plugins/surround.lua @@ -0,0 +1,6 @@ +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/telescope.lua b/lua/pika/plugins/telescope.lua index c6c80d1..0656a2b 100644 --- a/lua/pika/plugins/telescope.lua +++ b/lua/pika/plugins/telescope.lua @@ -25,32 +25,38 @@ return { telescope.load_extension("fzf") - -- ─< set keymaps >───────────────────────────────────────────────────────────────────── + -- set keymaps local map = vim.keymap.set -- for conciseness - local builtin = require("telescope.builtin") - -- ─────────────────────────────────< Telescope mappings >───────────────────────────────── - map("n", "T", "Telescope colorscheme") - 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() + -- 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 = "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" }) + 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) + map("n", "T", "Telescope colorscheme") + map("n", "q", vim.cmd.q) -- Additional custom mappings map("n", "/", function() builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown()) - end, { desc = "Search in current buffer" }) - map("n", "f/", function() + end, { desc = "[/] Fuzzily search in current buffer" }) + map("n", "s/", function() builtin.live_grep({ grep_open_files = true, prompt_title = "Live Grep in Open Files" }) - end, { desc = "Search in Open Files" }) + end, { desc = "[S]earch [/] in Open Files" }) end, } diff --git a/lua/pika/plugins/lsp/treesitter.lua b/lua/pika/plugins/treesitter.lua similarity index 100% rename from lua/pika/plugins/lsp/treesitter.lua rename to lua/pika/plugins/treesitter.lua diff --git a/lua/pika/plugins/ui.lua b/lua/pika/plugins/ui.lua index 81adb22..be74965 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 = 30, + delay = 80, reveal = { "close" }, hide = { "nvim_lsp" }, }, @@ -51,7 +51,6 @@ return { vim.keymap.set("n", "", "BufferLineCyclePrev") end, }, - -- ╭───────────────────────────────────╮ -- │ cmdline - for nice command inputs │ -- ╰───────────────────────────────────╯ @@ -82,17 +81,6 @@ 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, - -- }, }) end, vim.api.nvim_set_keymap("n", ":", "FineCmdline", { noremap = true }), @@ -171,21 +159,8 @@ return { -- char = "│", -- tab_char = "│", }, - scope = { enabled = true }, }, }, - - -- ╭──────────────────╮ - -- │ 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 │ -- ╰────────────────────────────────────╯ @@ -217,135 +192,74 @@ return { }) vim.notify = require("notify") end, - 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 │ -- ╰──────────────────────────────╯ - -- { - -- "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 = " ", - -- }, - -- }, - -- }, + { + -- 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 │ @@ -354,8 +268,8 @@ return { "folke/which-key.nvim", event = "VeryLazy", init = function() - vim.o.timeout = false - vim.o.timeoutlen = 0 + vim.o.timeout = true + vim.o.timeoutlen = 350 end, opts = { -- your configuration comes here diff --git a/snippets b/snippets index 7eaeb1e..e7f703e 160000 --- a/snippets +++ b/snippets @@ -1 +1 @@ -Subproject commit 7eaeb1e40883a0478d50fd01cc91083f4b079f0e +Subproject commit e7f703ecb74d00eeea817b0b677c8715bdc23521