From d0291709a9751ac17ef048eac4ed253eb14012a0 Mon Sep 17 00:00:00 2001 From: Tristan Russell Date: Fri, 8 May 2026 04:18:59 -0400 Subject: [PATCH] refactor: Moved all plugin specs to their own file under truss/lazy directory. --- lua/truss/init.lua | 2 +- lua/truss/lazy.lua | 103 --------------------------------- lua/truss/lazy/cmp-buffer.lua | 4 ++ lua/truss/lazy/cmp-cmdline.lua | 4 ++ lua/truss/lazy/cmp-lsp.lua | 4 ++ lua/truss/lazy/cmp-path.lua | 4 ++ lua/truss/lazy/cmp.lua | 4 ++ lua/truss/lazy/colorizer.lua | 5 ++ lua/truss/lazy/fugitive.lua | 4 ++ lua/truss/lazy/harpoon.lua | 4 ++ lua/truss/lazy/lspconfig.lua | 4 ++ lua/truss/lazy/luasnip.lua | 7 +++ lua/truss/lazy/mason.lua | 4 ++ lua/truss/lazy/none.lua | 4 ++ lua/truss/lazy/telescope.lua | 9 +++ lua/truss/lazy/tokyonight.lua | 4 ++ lua/truss/lazy/treesitter.lua | 6 ++ lua/truss/lazy/undotree.lua | 4 ++ lua/truss/lazy/whichkey.lua | 13 +++++ lua/truss/lazyInit.lua | 28 +++++++++ 20 files changed, 117 insertions(+), 104 deletions(-) mode change 100644 => 100755 lua/truss/init.lua delete mode 100644 lua/truss/lazy.lua create mode 100644 lua/truss/lazy/cmp-buffer.lua create mode 100644 lua/truss/lazy/cmp-cmdline.lua create mode 100644 lua/truss/lazy/cmp-lsp.lua create mode 100644 lua/truss/lazy/cmp-path.lua create mode 100644 lua/truss/lazy/cmp.lua create mode 100644 lua/truss/lazy/colorizer.lua create mode 100644 lua/truss/lazy/fugitive.lua create mode 100644 lua/truss/lazy/harpoon.lua create mode 100644 lua/truss/lazy/lspconfig.lua create mode 100644 lua/truss/lazy/luasnip.lua create mode 100644 lua/truss/lazy/mason.lua create mode 100644 lua/truss/lazy/none.lua create mode 100644 lua/truss/lazy/telescope.lua create mode 100644 lua/truss/lazy/tokyonight.lua create mode 100644 lua/truss/lazy/treesitter.lua create mode 100644 lua/truss/lazy/undotree.lua create mode 100644 lua/truss/lazy/whichkey.lua create mode 100755 lua/truss/lazyInit.lua diff --git a/lua/truss/init.lua b/lua/truss/init.lua old mode 100644 new mode 100755 index 28da245..7da3ecd --- a/lua/truss/init.lua +++ b/lua/truss/init.lua @@ -1,6 +1,6 @@ require("truss.remap") require("truss.set") -require("truss.lazy") +require("truss.lazyInit") local augroup = vim.api.nvim_create_augroup local autocmd = vim.api.nvim_create_autocmd diff --git a/lua/truss/lazy.lua b/lua/truss/lazy.lua deleted file mode 100644 index ee32da2..0000000 --- a/lua/truss/lazy.lua +++ /dev/null @@ -1,103 +0,0 @@ --- 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 -end -vim.opt.rtp:prepend(lazypath) - --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" - --- Setup lazy.nvim -require("lazy").setup({ - spec = { - { -- Syntax Highlighter - 'nvim-treesitter/nvim-treesitter', branch = 'main', - lazy = false, build = ":TSUpdate" - }, - { -- Packager Manager (LSPs) - 'williamboman/mason.nvim' - }, - { -- Formatter, Linter, etc bridge?? - 'nvimtools/none-ls.nvim' - }, - { -- LSP Configuration tool - 'neovim/nvim-lspconfig' - }, - { -- Snippet engine? - "L3MON4D3/LuaSnip", - version = "v2.4", -- Replace by the latest released major (first number of latest release) - -- install jsregexp (optional!). - build = "make install_jsregexp" - }, - { -- Code completion - 'hrsh7th/nvim-cmp' - }, - { -- Utility thing for code completion - 'hrsh7th/cmp-nvim-lsp' - }, - { -- Buffer source for code completion - 'hrsh7th/cmp-buffer' - }, - { -- Path source for code completion - 'hrsh7th/cmp-path' - }, - { -- Cmdline source for code completion - 'hrsh7th/cmp-cmdline' - }, - { -- File navigation fuzzy finder - 'nvim-telescope/telescope.nvim', version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - -- optional but recommended - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, - } - }, - { -- File navigation utility - 'ThePrimeagen/harpoon' - }, - { -- Undo.. tree - 'mbbill/undotree' - }, - { -- Git utility - 'tpope/vim-fugitive' - }, - { -- Hex colors - 'norcalli/nvim-colorizer.lua', - config=true - }, - { -- Keybind helper - 'folke/which-key.nvim', - keys = { - { - "?", - function() - require("which-key").show({ global = false }) - end, - desc = "Buffer Local Keymaps (which-key)", - }, - }, - }, - { -- Color Scheme - 'folke/tokyonight.nvim' - } - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, - -- automatically check for plugin updates - checker = { enabled = true }, -}) diff --git a/lua/truss/lazy/cmp-buffer.lua b/lua/truss/lazy/cmp-buffer.lua new file mode 100644 index 0000000..08c5524 --- /dev/null +++ b/lua/truss/lazy/cmp-buffer.lua @@ -0,0 +1,4 @@ +return { + -- Buffer source for code completion + 'hrsh7th/cmp-buffer' +} diff --git a/lua/truss/lazy/cmp-cmdline.lua b/lua/truss/lazy/cmp-cmdline.lua new file mode 100644 index 0000000..5c934f7 --- /dev/null +++ b/lua/truss/lazy/cmp-cmdline.lua @@ -0,0 +1,4 @@ +return { + -- Cmdline source for code completion + 'hrsh7th/cmp-cmdline' +} diff --git a/lua/truss/lazy/cmp-lsp.lua b/lua/truss/lazy/cmp-lsp.lua new file mode 100644 index 0000000..693920a --- /dev/null +++ b/lua/truss/lazy/cmp-lsp.lua @@ -0,0 +1,4 @@ +return { + -- Utility thing for code completion + 'hrsh7th/cmp-nvim-lsp' +} diff --git a/lua/truss/lazy/cmp-path.lua b/lua/truss/lazy/cmp-path.lua new file mode 100644 index 0000000..29463da --- /dev/null +++ b/lua/truss/lazy/cmp-path.lua @@ -0,0 +1,4 @@ +return { + -- Path source for code completion + 'hrsh7th/cmp-path' +} diff --git a/lua/truss/lazy/cmp.lua b/lua/truss/lazy/cmp.lua new file mode 100644 index 0000000..b549e52 --- /dev/null +++ b/lua/truss/lazy/cmp.lua @@ -0,0 +1,4 @@ +return { + -- Code completion + 'hrsh7th/nvim-cmp' +} diff --git a/lua/truss/lazy/colorizer.lua b/lua/truss/lazy/colorizer.lua new file mode 100644 index 0000000..1b5c8a0 --- /dev/null +++ b/lua/truss/lazy/colorizer.lua @@ -0,0 +1,5 @@ +return { + -- Hex colors + 'norcalli/nvim-colorizer.lua', + config=true +} diff --git a/lua/truss/lazy/fugitive.lua b/lua/truss/lazy/fugitive.lua new file mode 100644 index 0000000..3b394aa --- /dev/null +++ b/lua/truss/lazy/fugitive.lua @@ -0,0 +1,4 @@ +return { + -- Git utility + 'tpope/vim-fugitive' +} diff --git a/lua/truss/lazy/harpoon.lua b/lua/truss/lazy/harpoon.lua new file mode 100644 index 0000000..dff51df --- /dev/null +++ b/lua/truss/lazy/harpoon.lua @@ -0,0 +1,4 @@ +return { + -- File navigation utility + 'ThePrimeagen/harpoon' +} diff --git a/lua/truss/lazy/lspconfig.lua b/lua/truss/lazy/lspconfig.lua new file mode 100644 index 0000000..8bf8c48 --- /dev/null +++ b/lua/truss/lazy/lspconfig.lua @@ -0,0 +1,4 @@ +return { + -- LSP Configuration tool + 'neovim/nvim-lspconfig' +} diff --git a/lua/truss/lazy/luasnip.lua b/lua/truss/lazy/luasnip.lua new file mode 100644 index 0000000..869401f --- /dev/null +++ b/lua/truss/lazy/luasnip.lua @@ -0,0 +1,7 @@ +return { + -- Snippet engine? + "L3MON4D3/LuaSnip", + version = "v2.4", -- Replace by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp" +} diff --git a/lua/truss/lazy/mason.lua b/lua/truss/lazy/mason.lua new file mode 100644 index 0000000..ff195ac --- /dev/null +++ b/lua/truss/lazy/mason.lua @@ -0,0 +1,4 @@ +return { + -- Packager Manager (LSPs) + 'williamboman/mason.nvim' +} diff --git a/lua/truss/lazy/none.lua b/lua/truss/lazy/none.lua new file mode 100644 index 0000000..316a7c1 --- /dev/null +++ b/lua/truss/lazy/none.lua @@ -0,0 +1,4 @@ +return { + -- Formatter, Linter, etc bridge?? + 'nvimtools/none-ls.nvim' +} diff --git a/lua/truss/lazy/telescope.lua b/lua/truss/lazy/telescope.lua new file mode 100644 index 0000000..15afab6 --- /dev/null +++ b/lua/truss/lazy/telescope.lua @@ -0,0 +1,9 @@ +return { + -- File navigation fuzzy finder + 'nvim-telescope/telescope.nvim', version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + -- optional but recommended + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, + } +} diff --git a/lua/truss/lazy/tokyonight.lua b/lua/truss/lazy/tokyonight.lua new file mode 100644 index 0000000..f0a0dee --- /dev/null +++ b/lua/truss/lazy/tokyonight.lua @@ -0,0 +1,4 @@ +return { + -- Color Scheme + 'folke/tokyonight.nvim' +} diff --git a/lua/truss/lazy/treesitter.lua b/lua/truss/lazy/treesitter.lua new file mode 100644 index 0000000..dd76c83 --- /dev/null +++ b/lua/truss/lazy/treesitter.lua @@ -0,0 +1,6 @@ +return { + -- Syntax Highlighter + 'nvim-treesitter/nvim-treesitter', + lazy = false, + build = ":TSUpdate" +} diff --git a/lua/truss/lazy/undotree.lua b/lua/truss/lazy/undotree.lua new file mode 100644 index 0000000..c5586fa --- /dev/null +++ b/lua/truss/lazy/undotree.lua @@ -0,0 +1,4 @@ +return { + -- Undo.. tree + 'mbbill/undotree' +} diff --git a/lua/truss/lazy/whichkey.lua b/lua/truss/lazy/whichkey.lua new file mode 100644 index 0000000..2a26edc --- /dev/null +++ b/lua/truss/lazy/whichkey.lua @@ -0,0 +1,13 @@ +return { + -- Keybind helper + 'folke/which-key.nvim', + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, +} diff --git a/lua/truss/lazyInit.lua b/lua/truss/lazyInit.lua new file mode 100755 index 0000000..a8a5e36 --- /dev/null +++ b/lua/truss/lazyInit.lua @@ -0,0 +1,28 @@ +-- 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 +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = "truss.lazy", + checker = { enabled = true }, +})