From a82f0372bebcf27b9303c8dc79df03ee30beddc7 Mon Sep 17 00:00:00 2001 From: Harish Karumuthil Date: Sat, 20 Jun 2026 16:21:55 +0530 Subject: [PATCH] Create Lazyvim configs from Lunarvim configs --- .../Apps/neovim-distros/LazyVim/nvim/init.lua | 40 +++++ .../LazyVim/nvim/lazy-lock.json | 53 +++++++ .../neovim-distros/LazyVim/nvim/lazyvim.json | 10 ++ .../LazyVim/nvim/lua/config/autocmds.lua | 101 ++++++++++++ .../LazyVim/nvim/lua/config/keymaps.lua | 97 ++++++++++++ .../LazyVim/nvim/lua/config/lazy.lua | 36 +++++ .../LazyVim/nvim/lua/config/options.lua | 12 ++ .../LazyVim/nvim/lua/plugins/1-snacks.lua | 28 ++++ .../LazyVim/nvim/lua/plugins/2-dap.lua | 58 +++++++ .../LazyVim/nvim/lua/plugins/3-lualine.lua | 18 +++ .../LazyVim/nvim/lua/plugins/4-plugins.lua | 148 ++++++++++++++++++ .../LazyVim/nvim/lua/plugins/5-luasnip.lua | 23 +++ home/.local/Apps/neovim-distros/lzvim.sh | 4 + 13 files changed, 628 insertions(+) create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/init.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lazy-lock.json create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lazyvim.json create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/autocmds.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/keymaps.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/lazy.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/options.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/1-snacks.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/2-dap.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/3-lualine.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/4-plugins.lua create mode 100644 home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/5-luasnip.lua diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/init.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/init.lua new file mode 100644 index 0000000..0707bf3 --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/init.lua @@ -0,0 +1,40 @@ +--[[ + LazyVim configuration migrated from LunarVim +]] + +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.uv.fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + -- Core LazyVim distribution (must be first) + { "LazyVim/LazyVim", import = "lazyvim.plugins", version = "*" }, + + -- Extras (use :LazyExtras to browse all available extras) + { import = "lazyvim.plugins.extras.dap.core" }, + + -- Import user plugins from lua/plugins/*.lua + { import = "plugins" }, +}, { + defaults = { lazy = true, version = "*" }, + install = { colorscheme = { "habamax" } }, + checker = { enabled = true }, + performance = { + rtp = { + disabled_plugins = { + "gzip", + "matchit", + "matchparen", + "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lazy-lock.json b/home/.local/Apps/neovim-distros/LazyVim/nvim/lazy-lock.json new file mode 100644 index 0000000..d9655fe --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lazy-lock.json @@ -0,0 +1,53 @@ +{ + "LazyVim": { "branch": "main", "commit": "c10948c50b18fae7f256433afdef09e432410480" }, + "LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" }, + "NrrwRgn": { "branch": "master", "commit": "e027db9d94f94947153cd7b5ac9abd04371ab2b0" }, + "auto-session": { "branch": "main", "commit": "79ef41274354a486cf4f100a7adf4a7575802ccf" }, + "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, + "bracey.vim": { "branch": "master", "commit": "4e1a22acc01787814819df1057d039d4ecf357eb" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "catppuccin": { "branch": "main", "commit": "605b4603797de970e9f3a4238c199c850da03186" }, + "conform.nvim": { "branch": "master", "commit": "3543d000dafbc41cc7761d860cfdb24e82154f75" }, + "editorconfig.nvim": { "branch": "master", "commit": "2af880947129f1ab776b732a4eecb92528472ef5" }, + "emmet-vim": { "branch": "master", "commit": "92ef2f74f4093edc99db5e9e4cf7e40116a85bd6" }, + "flash.nvim": { "branch": "main", "commit": "ec0bf2842189f65f60fd40bf3557cac1029cc932" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "gitsigns.nvim": { "branch": "main", "commit": "a462f416e2ce4744531c6256252dee99a7d34a83" }, + "grug-far.nvim": { "branch": "main", "commit": "c995bbacf8229dc096ec1c3d60f8531059c86c1b" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lazydev.nvim": { "branch": "main", "commit": "01bc2aacd51cf9021eb19d048e70ce3dd09f7f93" }, + "live-server.nvim": { "branch": "main", "commit": "85915d0e7dd926a54b0082aaeafc10a82bfe8288" }, + "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, + "markdown-preview.nvim": { "branch": "main", "commit": "5fec271fb91c7be7eca11d5b1c8da16add12e205" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a5671269a1ddfa7790cdf97c14e600e269da550f" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "e51f9b259f066c4347f9a79ffde54c29a0619384" }, + "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, + "mini.ai": { "branch": "main", "commit": "bfb26d9072670c3aaefab0f53024b2f3729c8083" }, + "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "mini.pairs": { "branch": "main", "commit": "d5a29b6254dad07757832db505ea5aeab9aad43a" }, + "noice.nvim": { "branch": "main", "commit": "cf758e9df66451889aab56613a21b8673f045ec2" }, + "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, + "nvim-dap": { "branch": "master", "commit": "6a5bba0ddea5d419a783e170c20988046376090d" }, + "nvim-dap-ui": { "branch": "master", "commit": "f7d75cca202b52a60c520ec7b1ec3414d6e77b0f" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, + "nvim-lint": { "branch": "master", "commit": "01c9842c089069ab497430159312b2c8868a4590" }, + "nvim-lspconfig": { "branch": "master", "commit": "229b79051b380377664edc4cbd534930154921a1" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-surround": { "branch": "main", "commit": "2e93e154de9ff326def6480a4358bfc149d5da2c" }, + "nvim-treesitter": { "branch": "main", "commit": "7caec274fd19c12b55902a5b795100d21531391f" }, + "nvim-treesitter-textobjects": { "branch": "main", "commit": "851e865342e5a4cb1ae23d31caf6e991e1c99f1e" }, + "nvim-ts-autotag": { "branch": "main", "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275" }, + "persistence.nvim": { "branch": "main", "commit": "c45ff862b53ce07a853a753fb0b33e148dbb99d2" }, + "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, + "snacks.nvim": { "branch": "main", "commit": "e6fd58c82f2f3fcddd3fe81703d47d6d48fc7b9f" }, + "tabular": { "branch": "master", "commit": "7bd1d0de5d390834220b7d0a791bb9734fafa0cc" }, + "telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "tokyonight.nvim": { "branch": "main", "commit": "545d72cde6400835d895160ecb5853874fd5156d" }, + "trouble.nvim": { "branch": "main", "commit": "748ca2789044607f19786b1d837044544c55e80a" }, + "ts-comments.nvim": { "branch": "main", "commit": "79e4337e4231ff8ca33dab85162b5ee8e78f22ce" }, + "vim-fugitive": { "branch": "master", "commit": "96c1009fcf8ce60161cc938d149dd5a66d570756" }, + "vim-gnupg": { "branch": "main", "commit": "6d106fa49df3d8c1e63fac8eb64b4a0174f7e83f" }, + "vim-snippets": { "branch": "master", "commit": "4ed409154bcaa32fba6fd153cc0c915e44982872" }, + "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" } +} diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lazyvim.json b/home/.local/Apps/neovim-distros/LazyVim/nvim/lazyvim.json new file mode 100644 index 0000000..d8bcaf6 --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lazyvim.json @@ -0,0 +1,10 @@ +{ + "extras": [ + + ], + "install_version": 8, + "news": { + "NEWS.md": "11866" + }, + "version": 8 +} \ No newline at end of file diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/autocmds.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..77e471d --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/autocmds.lua @@ -0,0 +1,101 @@ +-- @section commands +-- Custom user commands migrated from LunarVim's config.lua vim.cmd block + +--- @section commands-grep +-- Gr: Search with grep and show results in quickfix list +vim.api.nvim_create_user_command("Gr", function(input) + vim.cmd("silent execute 'grep! " .. input.args .. " | copen'") +end, { nargs = "+", desc = "Grep and open quickfix list" }) + +-- Grc: Raw grep command (no quickfix auto-open) +vim.api.nvim_create_user_command("Grc", function(input) + vim.cmd("grep " .. input.args) +end, { nargs = "*", desc = "Run grep without quickfix" }) + +--- @section commands-file +-- Header: Add file header via external script +vim.api.nvim_create_user_command("Header", function() + vim.cmd("0r!file-header '%'") +end, { desc = "Add file header from external file-header script" }) + +-- Termw: Open konsole terminal emulator +vim.api.nvim_create_user_command("Termw", function() + vim.cmd("!konsole -e bash-session &") +end, { desc = "Open konsole terminal" }) + +-- Term: Open embedded terminal in a horizontal split +vim.api.nvim_create_user_command("Term", function() + vim.cmd("sp | term") +end, { desc = "Open terminal in split window" }) + +-- EditSnippet: Open LuaSnip snippet files for editing +vim.api.nvim_create_user_command("EditSnippet", function() + require("luasnip.loaders").edit_snippet_files() +end, { desc = "Edit LuaSnip snippet files" }) + +-- Cwd: Change working directory to current file's directory +vim.api.nvim_create_user_command("Cwd", function() + vim.cmd("cd %:p:h") +end, { desc = "Change directory to current file" }) + +-- Tcd: Change tab-local working directory to current file's directory +vim.api.nvim_create_user_command("Tcd", function() + vim.cmd(":tcd %:p:h") +end, { desc = "Change tab directory to current file" }) + +-- Reload: Reload all buffers from disk +vim.api.nvim_create_user_command("Reload", function() + vim.cmd("bufdo execute 'checktime . bufnr('%')'") +end, { desc = "Reload all buffers" }) + +-- Rm: Delete current file from disk and close buffer +vim.api.nvim_create_user_command("Rm", function() + vim.cmd("!rm % | bd") +end, { desc = "Delete file and close buffer" }) + +-- CopyFilename: Copy current file path to system clipboard +vim.api.nvim_create_user_command("CopyFilename", function() + vim.fn.setreg("+", vim.fn.expand("%")) +end, { desc = "Copy file path to clipboard" }) + +-- Code: Open current file in VS Code at current line +vim.api.nvim_create_user_command("Code", function() + vim.cmd("!code ./ -g %:" .. (vim.fn.line(".") + 1)) +end, { desc = "Open in VS Code at current line" }) + +--- @section keymaps-grep (defined as keymap in vim.cmd, moved here for clarity) +-- : Search word under cursor with custom Gr command +vim.keymap.set("n", "", function() + vim.cmd("Gr " .. vim.fn.expand("")) +end, { desc = "Grep word under cursor (custom Gr)" }) + +-- : Live grep word under cursor via Snacks picker +vim.keymap.set("n", "", function() + LazyVim.pick("live_grep", { default_text = vim.fn.expand("") })() +end, { desc = "Snacks grep word under cursor" }) + +-- @section autocmds-filetype +-- Caddyfile: Set filetype for Caddyfile (any path, any name containing "Caddyfile") +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + pattern = "*Caddyfile", + callback = function() + vim.bo.filetype = "caddy" + end, + desc = "Detect Caddyfile filetype", +}) + +-- @section autocmds-emmet +-- Emmet: Enable Emmet for web development filetypes (migrated from LunarVim) +-- Disabled by default for all filetypes; enabled only for these specific filetypes. +vim.api.nvim_create_autocmd("FileType", { + pattern = { "html", "css", "vue", "jsx", "php", "javascriptreact" }, + callback = function() + vim.cmd("EmmetInstall") + end, + desc = "Enable Emmet for web filetypes", +}) + +-- @section config-grepprg +-- Set grep program to `ag` (preserved from LunarVim) +-- LazyVim defaults to `rg --vimgrep`. This overrides it. +vim.opt.grepprg = "ag --vimgrep" diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/keymaps.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..a72350e --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/keymaps.lua @@ -0,0 +1,97 @@ +-- @section keymaps +-- Custom keymaps migrated from LunarVim config. +-- LazyVim already defines many keymaps (e.g. for save, for buffer prev/next, +-- bd for delete buffer). Only keymaps that add to or differ from LazyVim defaults +-- are listed here. Grouped by function with @section markers. + +local map = vim.keymap.set + +--- @section keymaps-buffers +-- Meta+number: Jump to specific buffer (via BufferLine) +-- LazyVim provides bj for BufferLinePick (interactive pick). +-- These direct-access keys are preserved from your LunarVim config. +for i = 1, 9 do + map("n", "", function() + vim.cmd("BufferLineGoToBuffer " .. i) + end, { desc = "Go to buffer " .. i }) +end + +--- @section keymaps-picker +-- : Quick file find (Snacks picker replaces your Telescope "fd" picker) +map("n", "", function() + LazyVim.pick("files")() +end, { desc = "Find Files" }) + +--- @section keymaps-external +-- Launch external tools from Neovim +map("n", "t", ":!konsole&", { desc = "Open Konsole terminal" }) +map("n", "g", ":!git gui &", { desc = "Open Git GUI" }) + +--- @section keymaps-file +-- File-level operations +map("n", "", ":e!", { desc = "Reload current file (discard changes)" }) +map("n", "", function() + Snacks.bufdelete() +end, { desc = "Delete current buffer (preserves window layout)" }) +map("n", "", ":bd!", { desc = "Force delete buffer and close window" }) + +--- @section keymaps-visual +-- Visual mode operations +map("v", "", '"fy:%s#f#', { desc = "Replace all occurrences of selected text" }) +map("v", "", '"fy/f', { desc = "Search for selected word" }) + +--- @section keymaps-insert +-- Insert mode helpers +map("i", "", "A;", { desc = "Append semicolon at end of line" }) +map("i", "", "(emmet-expand-abbr)", { desc = "Expand Emmet abbreviation" }) + +--- @section keymaps-window +-- Window navigation with Alt+arrows (preserved from LunarVim) +-- LazyVim defaults have for window nav. +-- These Alt+arrow mappings give you an alternative. +map("n", "", "k", { desc = "Move to window above" }) +map("n", "", "j", { desc = "Move to window below" }) +map("n", "", "l", { desc = "Move to window right" }) +map("n", "", "h", { desc = "Move to window left" }) + +--- @section keymaps-terminal +-- Terminal mode keymaps for window navigation and tab switching +map("t", "", "", { desc = "Terminal: Previous tab" }) +map("t", "", "", { desc = "Terminal: Next tab" }) +map("t", "", "k", { desc = "Terminal: Window up" }) +map("t", "", "j", { desc = "Terminal: Window down" }) +map("t", "", "l", { desc = "Terminal: Window right" }) +map("t", "", "h", { desc = "Terminal: Window left" }) + +--- @section keymaps-buffer-switch +-- Buffer switching keys preserved from LunarVim. +-- NOTE: and conflict with LazyVim's default window navigation +-- (=window down, =window up). Since you use for windows, +-- these override to buffer navigation instead. +map("n", "", ":BufferLineCyclePrev", { desc = "Previous buffer" }) +map("n", "", ":BufferLineCycleNext", { desc = "Next buffer" }) +map("n", "", ":BufferLineMovePrev", { desc = "Move buffer left" }) +map("n", "", ":BufferLineMoveNext", { desc = "Move buffer right" }) +map("n", "", ":BufferLineCyclePrev", { desc = "Previous buffer" }) +map("n", "", ":BufferLineCycleNext", { desc = "Next buffer" }) +map("n", "", ":BufferLineMovePrev", { desc = "Move buffer left" }) +map("n", "", ":BufferLineMoveNext", { desc = "Move buffer right" }) + +--- @section keymaps-tab +map("n", "", ":tabedit", { desc = "Open new tab" }) + +--- @section keymaps-dap +-- Quick DAP access keys (dap.core extra provides d prefix mappings) +-- These F-keys provide direct access to the most common debugging actions. +map("n", "", function() + require("dap").continue() +end, { desc = "DAP: Continue / Start debugging" }) +map("n", "", function() + require("dap").step_over() +end, { desc = "DAP: Step over" }) +map("n", "", function() + require("dap").step_into() +end, { desc = "DAP: Step into" }) +map("n", "", function() + require("dap").step_out() +end, { desc = "DAP: Step out" }) diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/lazy.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..06a4abd --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/lazy.lua @@ -0,0 +1,36 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.uv.fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + -- Core LazyVim distribution (must be first) + { "LazyVim/LazyVim", import = "lazyvim.plugins", version = "*" }, + + -- Extras (use :LazyExtras to browse all available extras) + { import = "lazyvim.plugins.extras.dap.core" }, + + -- Import user plugins from lua/plugins/*.lua + { import = "plugins" }, +}, { + defaults = { lazy = true, version = "*" }, + install = { colorscheme = { "habamax" } }, + checker = { enabled = true }, + performance = { + rtp = { + disabled_plugins = { + "gzip", + "matchit", + "matchparen", + "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/options.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/options.lua new file mode 100644 index 0000000..326d727 --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/config/options.lua @@ -0,0 +1,12 @@ +-- @section vim-options +-- Override LazyVim default vim options to match your previous LunarVim config. +-- LazyVim defaults already include: shiftwidth=2, tabstop=2, number=true, list=true, +-- relativenumber=true. + +-- Relativenumber: Your LunarVim config explicitly disabled it. +-- LazyVim defaults to true; this overrides it back to false. +vim.opt.relativenumber = false + +-- Grepprg: Your LunarVim config used `ag --vimgrep`. +-- LazyVim defaults to `rg --vimgrep`. Uncomment below to switch to `ag`: +-- vim.opt.grepprg = "ag --vimgrep" diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/1-snacks.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/1-snacks.lua new file mode 100644 index 0000000..220acc7 --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/1-snacks.lua @@ -0,0 +1,28 @@ +-- @section snacks-picker +-- Snacks picker configuration preserved from LunarVim's Telescope settings. +-- LazyVim defaults to Snacks picker (no extra import needed since the +-- defaults system auto-enables it when Telescope/Fzf extras aren't imported). + +-- Telescope's `file_ignore_patterns` handled differently in Snacks: +-- Snacks picker uses `fd`/`rg` which respect .gitignore by default. +-- Hidden files are shown, and VCS-ignored files are excluded. +-- Your original ignore patterns are listed below for reference; you can +-- adjust the find command or add global gitignore entries as needed. + +return { + { + "folke/snacks.nvim", + opts = function(_, opts) + return vim.tbl_deep_extend("force", opts or {}, { + picker = { + sources = { + files = { + -- Show hidden files by default (dotfiles) + hidden = true, + }, + }, + }, + }) + end, + }, +} diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/2-dap.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/2-dap.lua new file mode 100644 index 0000000..eb1bea1 --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/2-dap.lua @@ -0,0 +1,58 @@ +-- @section dap +-- DAP (Debug Adapter Protocol) configuration. +-- Core DAP support comes from the `lazyvim.plugins.extras.dap.core` extra +-- (imported in init.lua), which provides nvim-dap, nvim-dap-ui, and +-- d keybindings. +-- +-- This file adds: +-- 1. F-key shortcuts for common debug actions +-- 2. PHP debug adapter configuration (migrated from LunarVim) + +return { + { + "mfussenegger/nvim-dap", + -- @section dap-keymaps + -- F-key mappings for quick DAP access. + -- The dap.core extra already provides d{letter} bindings; + -- these F-keys are additional shortcuts preserved from your LunarVim config. + keys = { + { "", function() + require("dap").continue() + end, desc = "DAP: Continue / Start" }, + { "", function() + require("dap").step_over() + end, desc = "DAP: Step Over" }, + { "", function() + require("dap").step_into() + end, desc = "DAP: Step Into" }, + { "", function() + require("dap").step_out() + end, desc = "DAP: Step Out" }, + }, + -- @section dap-php + -- PHP debug adapter setup (migrated from LunarVim) + -- Uses php-debug-adapter installed via Mason. + -- The adapter listens on port 9003 (Xdebug default). + init = function() + LazyVim.on_load("nvim-dap", function() + local dap = require("dap") + dap.adapters.php = { + type = "executable", + command = "node", + args = { + vim.fn.stdpath("data") + .. "/mason/packages/php-debug-adapter/extension/out/phpDebug.js", + }, + } + dap.configurations.php = { + { + type = "php", + request = "launch", + name = "Listen for Xdebug", + port = 9003, + }, + } + end) + end, + }, +} diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/3-lualine.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/3-lualine.lua new file mode 100644 index 0000000..60ebc30 --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/3-lualine.lua @@ -0,0 +1,18 @@ +-- @section lualine +-- Lualine statusline customization (migrated from LunarVim). +-- Your LunarVim config set lualine_b to show both branch name and current file. +-- This extends the default LazyVim lualine_b (which shows just "branch") to +-- also show the full file path (%f). + +return { + { + "nvim-lualine/lualine.nvim", + opts = function(_, opts) + -- Extend the default lualine_b section to show branch + file path + -- (preserved from LunarVim: lvim.builtin.lualine.sections.lualine_b = { 'branch', '%f' }) + opts.sections = opts.sections or {} + opts.sections.lualine_b = { "branch", "%f" } + return opts + end, + }, +} diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/4-plugins.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/4-plugins.lua new file mode 100644 index 0000000..5dfbeb7 --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/4-plugins.lua @@ -0,0 +1,148 @@ +-- @section plugins +-- Extra plugins migrated from LunarVim's `lvim.plugins` list. +-- Each plugin is defined as a lazy.nvim spec. + +return { + --- @section plugins-editorconfig + { + "gpanders/editorconfig.nvim", + desc = "EditorConfig support (respects .editorconfig files)", + }, + + --- @section plugins-emmet + { + "mattn/emmet-vim", + desc = "Emmet: HTML/CSS Zen coding expansion", + }, + + --- @section plugins-fugitive + { + "tpope/vim-fugitive", + cmd = { + "G", "Git", "Gdiffsplit", "Gread", "Gwrite", + "Ggrep", "GMove", "GDelete", "GBrowse", + "GRemove", "GRename", "Glgrep", "Gedit", + }, + ft = { "fugitive" }, + desc = "Git integration (tpope)", + }, + { + "selimacerbas/live-server.nvim", + dependencies = { + "folke/which-key.nvim", + "nvim-telescope/telescope.nvim", -- recommended for path picker + }, + init = function() + -- which-key group label only (best practice) + local ok, wk = pcall(require, "which-key") + if ok then wk.add({ { "l", group = "LiveServer" } }) end + end, + opts = { + default_port = 8000, + live_reload = { enabled = true, inject_script = true, debounce = 120, css_inject = true }, + directory_listing = { enabled = true, show_hidden = false }, + }, + -- map to user commands (robust lazy-loading) + keys = { + { "ls", "LiveServerStart", desc = "Start (pick path & port)" }, + { "lo", "LiveServerOpen", desc = "Open existing port in browser" }, + { "lr", "LiveServerReload", desc = "Force reload (pick port)" }, + { "lt", "LiveServerToggleLive", desc = "Toggle live-reload (pick port)" }, + { "li", "LiveServerStatus", desc = "Show server status" }, + { "lS", "LiveServerStop", desc = "Stop one (pick port)" }, + { "lA", "LiveServerStopAll", desc = "Stop all" }, + }, + config = function(_, opts) + require("live_server").setup(opts) + end, + }, + + --- @section plugins-markdown-preview + { + "harish2704/markdown-preview.nvim", + dependencies = { "selimacerbas/live-server.nvim" }, + ft = 'markdown', + config = function() + require("markdown_preview").setup({ + -- all optional; sane defaults shown + instance_mode = "takeover", -- "takeover" (one tab) or "multi" (tab per instance) + port = 0, -- 0 = auto (8421 for takeover, OS-assigned for multi) + open_browser = true, + default_theme = "light", -- "dark" or "light"; initial preview theme + debounce_ms = 300, + mermaid_elk = true, + }) + end, + }, + -- { + -- { + -- "iamcco/markdown-preview.nvim", + -- ft = 'markdown', + -- build = function() + -- require("lazy").load({ plugins = { "markdown-preview.nvim" } }) + -- vim.fn["mkdp#util#install"]() + -- local app_dir = vim.fn.stdpath("data") .. "/lazy/markdown-preview.nvim/app" + -- vim.fn.system( + -- "cd " + -- .. app_dir + -- .. " && bun install mermaid@latest && cp node_modules/mermaid/dist/mermaid.min.js _static/mermaid.min.js" + -- ) + -- end, + -- }, + -- }, + + -- --- @section plugins-bracey + { + "turbio/bracey.vim", + cmd = { "Bracey", "BracyStop", "BraceyReload", "BraceyEval" }, + build = "npm install --prefix server", + desc = "Live HTML/CSS/JS editor preview", + }, + + --- @section plugins-gnupg + { + "jamessan/vim-gnupg", + desc = "Transparent editing of GnuPG encrypted files", + }, + + --- @section plugins-vim-snippets + { + "honza/vim-snippets", + event = "InsertEnter", + config = function() + require("luasnip.loaders.from_snipmate").lazy_load() + end, + desc = "SnipMate snippet collection (honza)", + }, + + --- @section plugins-tabular + { + "godlygeek/tabular", + desc = "Text alignment and formatting", + }, + + --- @section plugins-nrrwrgn + { "chrisbra/NrrwRgn", desc = "Narrow region: edit a selection in a separate buffer" }, + + --- @section plugins-nvim-surround + { + "kylechui/nvim-surround", + config = function() + require("nvim-surround").setup({}) + end, + desc = "Surround text objects (parentheses, quotes, tags, etc.)", + }, + + --- @section plugins-auto-session + { + "rmagatti/auto-session", + config = function() + require("auto-session").setup({ + log_level = "error", + -- Only restore/save sessions manually, not automatically + auto_session_create_enabled = false, + }) + end, + desc = "Session management (manual mode)", + }, +} diff --git a/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/5-luasnip.lua b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/5-luasnip.lua new file mode 100644 index 0000000..0100a0c --- /dev/null +++ b/home/.local/Apps/neovim-distros/LazyVim/nvim/lua/plugins/5-luasnip.lua @@ -0,0 +1,23 @@ +-- @section luasnip-dart +-- LuaSnip: Extend dart filetype with flutter snippets (migrated from LunarVim) +-- When editing .dart files, this adds flutter snippet sources so that +-- Flutter-specific completions (like `stless`, `stful`) are available. + +return { + { + "L3MON4D3/LuaSnip", + init = function() + vim.api.nvim_create_autocmd("User", { + pattern = "VeryLazy", + once = true, + callback = function() + local ok, luasnip = pcall(require, "luasnip") + if ok then + luasnip.filetype_extend("dart", { "flutter" }) + end + end, + }) + end, + desc = "Add Flutter snippets to Dart buffers", + }, +} diff --git a/home/.local/Apps/neovim-distros/lzvim.sh b/home/.local/Apps/neovim-distros/lzvim.sh index aeaee9b..bb3764c 100755 --- a/home/.local/Apps/neovim-distros/lzvim.sh +++ b/home/.local/Apps/neovim-distros/lzvim.sh @@ -6,7 +6,11 @@ nvconf="$THIS_DIR/$PKG" if [[ -d $nvconf ]]; then mkdir -p $nvconf/cache + if [[ -n "$NO_GUI" ]]; then + env XDG_CACHE_DIR=$nvconf/cache XDG_CACHE_HOME=$nvconf/cache XDG_DATA_HOME=$nvconf/share XDG_CONFIG_HOME=$nvconf nvim $@ + else exec -a "Lazyvim" alacritty -e env XDG_CACHE_DIR=$nvconf/cache XDG_CACHE_HOME=$nvconf/cache XDG_DATA_HOME=$nvconf/share XDG_CONFIG_HOME=$nvconf nvim $@ & + fi else echo "invalid \$PKG. Available values:" ls `dirname $nvconf`