Create Lazyvim configs from Lunarvim configs

This commit is contained in:
2026-06-20 16:21:55 +05:30
parent fab64cc52e
commit a82f0372be
13 changed files with 628 additions and 0 deletions
@@ -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,
},
}
@@ -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
-- <leader>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 <leader>d{letter} bindings;
-- these F-keys are additional shortcuts preserved from your LunarVim config.
keys = {
{ "<F5>", function()
require("dap").continue()
end, desc = "DAP: Continue / Start" },
{ "<F10>", function()
require("dap").step_over()
end, desc = "DAP: Step Over" },
{ "<F11>", function()
require("dap").step_into()
end, desc = "DAP: Step Into" },
{ "<F12>", 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,
},
}
@@ -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,
},
}
@@ -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({ { "<leader>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 = {
{ "<leader>ls", "<cmd>LiveServerStart<cr>", desc = "Start (pick path & port)" },
{ "<leader>lo", "<cmd>LiveServerOpen<cr>", desc = "Open existing port in browser" },
{ "<leader>lr", "<cmd>LiveServerReload<cr>", desc = "Force reload (pick port)" },
{ "<leader>lt", "<cmd>LiveServerToggleLive<cr>", desc = "Toggle live-reload (pick port)" },
{ "<leader>li", "<cmd>LiveServerStatus<cr>", desc = "Show server status" },
{ "<leader>lS", "<cmd>LiveServerStop<cr>", desc = "Stop one (pick port)" },
{ "<leader>lA", "<cmd>LiveServerStopAll<cr>", 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)",
},
}
@@ -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",
},
}