From 78d8ef9c8b536e4fb82f37746198e2c71f094f68 Mon Sep 17 00:00:00 2001 From: theMackabu Date: Sun, 13 Jul 2025 22:07:44 +0000 Subject: [PATCH] feat(nvim): add LazyVim configuration with custom plugins and settings --- nvim/.gitignore | 8 ++++++++ nvim/.neoconf.json | 15 +++++++++++++++ nvim/init.lua | 2 ++ nvim/lazy-lock.json | 37 +++++++++++++++++++++++++++++++++++++ nvim/lazyvim.json | 9 +++++++++ nvim/stylua.toml | 3 +++ nvim/static/neovim.cat | 8 ++++++++ nvim/static/neovim.lolcat | 8 ++++++++ nvim/lua/config/autocmds.lua | 15 +++++++++++++++ nvim/lua/config/keymaps.lua | 3 +++ nvim/lua/config/lazy.lua | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ nvim/lua/config/options.lua | 4 ++++ nvim/lua/plugins/comment.lua | 4 ++++ nvim/lua/plugins/disabled.lua | 3 +++ nvim/lua/plugins/snacks.lua | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 15 file(s) changed, 316 insertion(s)(+), 0 deletion(s)(-) diff --git a/nvim/.gitignore b/nvim/.gitignore new file mode 100644 --- /dev/null +++ b/nvim/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/nvim/.neoconf.json b/nvim/.neoconf.json new file mode 100644 --- /dev/null +++ b/nvim/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,2 @@ +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,37 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LazyVim": { "branch": "main", "commit": "d0c366e4d861b848bdc710696d5311dca2c6d540" }, + "blink.cmp": { "branch": "main", "commit": "5b0f52d42ecbb374695da1a93fa40eca4dc7a7ff" }, + "bufferline.nvim": { "branch": "main", "commit": "9f0826ae6adfd836a23bf8a4910e3c07450211f4" }, + "catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" }, + "conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" }, + "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, + "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, + "fzf-lua": { "branch": "main", "commit": "2b6fb06da75c4eb1381ac66d89a8c4485435f1e9" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "grug-far.nvim": { "branch": "main", "commit": "08f32182335754abf461dfb77b2c4e24bfe4d614" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.ai": { "branch": "main", "commit": "ebb04799794a7f94628153991e6334c3304961b8" }, + "mini.icons": { "branch": "main", "commit": "1c79feb7478ca773fa3dac5cadf43ced9180e861" }, + "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, + "neo-tree.nvim": { "branch": "main", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" }, + "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, + "nvim-lint": { "branch": "master", "commit": "dfa45de973c3ce7bd1b9a6d346f896a68ad07e44" }, + "nvim-lspconfig": { "branch": "master", "commit": "8121483b8132b7053120fafd83728178fb3febf6" }, + "nvim-treesitter": { "branch": "master", "commit": "958af94dd8d74071c72c9d6840b41d06ea436b2f" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "snacks.nvim": { "branch": "main", "commit": "14e89401da348f5d14509fca164fb7bcec83e597" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "tokyonight.nvim": { "branch": "main", "commit": "7bb270adaa7692c2c33befc35f5567fc596a2504" }, + "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, + "ts-comments.nvim": { "branch": "main", "commit": "872dcfa0418f4a33b7437fb4d9f4e89f2f000d74" }, + "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" } +} diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json new file mode 100644 --- /dev/null +++ b/nvim/lazyvim.json @@ -0,0 +1,9 @@ +{ + "extras": [ + + ], + "news": { + "NEWS.md": "10960" + }, + "version": 7 +} \ No newline at end of file diff --git a/nvim/stylua.toml b/nvim/stylua.toml new file mode 100644 --- /dev/null +++ b/nvim/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file diff --git a/nvim/static/neovim.cat b/nvim/static/neovim.cat new file mode 100644 --- /dev/null +++ b/nvim/static/neovim.cat @@ -0,0 +1,8 @@ +  + ████ ██████ █████ ██ btw + ███████████ █████  + █████████ ███████████████████ ███ ███████████ + █████████ ███ █████████████ █████ ██████████████ + █████████ ██████████ █████████ █████ █████ ████ █████ + ███████████ ███ ███ █████████ █████ █████ ████ █████ + ██████ █████████████████████ ████ ████ █████ ████ ██████ diff --git a/nvim/static/neovim.lolcat b/nvim/static/neovim.lolcat new file mode 100644 --- /dev/null +++ b/nvim/static/neovim.lolcat @@ -0,0 +1,8 @@ +                                                                      +       ████ ██████           █████      ██                    btw     +      ███████████             █████                              +      █████████ ███████████████████ ███   ███████████    +     █████████  ███    █████████████ █████ ██████████████    +    █████████ ██████████ █████████ █████ █████ ████ █████    +  ███████████ ███    ███ █████████ █████ █████ ████ █████   + ██████  █████████████████████ ████ ████ █████ ████ ██████  diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua new file mode 100644 --- /dev/null +++ b/nvim/lua/config/autocmds.lua @@ -0,0 +1,15 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- +-- Add any additional autocmds here +-- with `vim.api.nvim_create_autocmd` +-- +-- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) +-- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "markdown", "text" }, + callback = function() + vim.opt_local.spell = false + end, +}) diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua new file mode 100644 --- /dev/null +++ b/nvim/lua/config/keymaps.lua @@ -0,0 +1,3 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,60 @@ +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 +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "tokyonight", "catppuccin" } }, + checker = { + enabled = true, -- check for plugin updates periodically + notify = false, -- notify on update + }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) + +require("catppuccin").setup({ + flavour = "mocha", + transparent_background = true, +}) + +vim.cmd.colorscheme "catppuccin" \ No newline at end of file diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua new file mode 100644 --- /dev/null +++ b/nvim/lua/config/options.lua @@ -0,0 +1,4 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here +vim.opt.relativenumber = false diff --git a/nvim/lua/plugins/comment.lua b/nvim/lua/plugins/comment.lua new file mode 100644 --- /dev/null +++ b/nvim/lua/plugins/comment.lua @@ -0,0 +1,4 @@ +return { + 'numToStr/Comment.nvim', + opts = {} +} \ No newline at end of file diff --git a/nvim/lua/plugins/disabled.lua b/nvim/lua/plugins/disabled.lua new file mode 100644 --- /dev/null +++ b/nvim/lua/plugins/disabled.lua @@ -0,0 +1,3 @@ +return { + { "noice.nvim", enabled = false }, +} diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua new file mode 100644 --- /dev/null +++ b/nvim/lua/plugins/snacks.lua @@ -0,0 +1,137 @@ +local dashboard_config_1 = { + preset = { + -- stylua: ignore + ---@type snacks.dashboard.Item[] + keys = { + { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" }, + { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" }, + { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" }, + { icon = " ", key = "e", desc = "File Explorer", action = ":Neotree" }, + { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" }, + { icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" }, + { icon = " ", key = "s", desc = "Restore Session", section = "session" }, + { icon = " ", key = "x", desc = "Lazy Extras", action = ":LazyExtras" }, + { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, + }, + sections = { + { + section = "terminal", + -- lolcat -F 0.2 ~/.config/nvim/static/neovim.cat + cmd = "cat ~/.config/nvim/static/neovim.lolcat", + indent = -5, + height = 8, + width = 73, + padding = 3, + }, + { section = 'keys', padding = 2 }, + { + section = 'terminal', + icon = ' ', + title = 'Git Status', + enabled = function() + return Snacks.git.get_root() ~= nil + end, + cmd = 'git --no-pager diff --stat -B -M -C', + height = 8, + padding = 2, + ttl = 5 * 60, + indent = 2, + }, + { section = "startup" }, + }, +} + +local dashboard_config_2 = { + enabled = true, + width = 18, + sections = { + -- stylua: ignore start + { hidden = true, icon = " ", key = "t", desc = "Find [T]ext", action = ":lua Snacks.dashboard.pick('live_grep')" }, + { hidden = true, icon = " ", key = "r", desc = "[R]ecent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" }, + { hidden = true, icon = "󰒲 ", key = "l", desc = "[L]azy", action = ":Lazy" }, + -- stylua: ignore end + + -- Header + { text = " ", padding = 12 }, + { + padding = 2, + text = { + { "Neovim :: M Λ C K ", hl = "Normal" }, + { "- Editing made simple", hl = "NonText" }, + }, + action = ":lua Snacks.dashboard.pick('files')", + key = "f", + }, + + -- Keys + { + padding = 1, + text = { + { " Find [F]ile", width = 19, hl = "NonText" }, + { " Find [T]ext", hl = "NonText" }, + }, + action = ":lua Snacks.dashboard.pick('files')", + key = "f", + }, + { + padding = 1, + text = { + { " ", width = 3 }, + { " [N]ew File", width = 19, hl = "NonText" }, + { " [R]ecent File", hl = "NonText" }, + }, + action = ":ene | startinsert", + key = "n", + }, + { + padding = 2, + text = { + { " ", width = 9 }, + { " [C]onfig", hl = "NonText" }, + { " ", width = 8 }, + { "󰒲 [L]azy", hl = "NonText" }, + { " ", width = 14 }, + }, + action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})", + key = "c", + }, + { + padding = 2, + text = { + { " ", width = 5 }, + { " [Q]uit", hl = "NonText" }, + }, + action = ":quitall", + key = "q", + }, + + -- Startup + { section = "startup", padding = 1 }, + { section = "terminal", cmd = "printf ' '", height = 15 }, + + -- Keys + { + text = { + [[ +Copyright (c) 2025 - M Λ C K + ]], + + hl = "NonText", + }, + }, + }, + + formats = { key = { "" } }, +} + +return { + "snacks.nvim", + opts = function() + math.randomseed(os.time()) + return { + dashboard = (math.random(5) == 1) and dashboard_config_2 or dashboard_config_1 + } + end, +} \ No newline at end of file -- tangled.sh