From a59303bf828fcd6e4236d6dd6baabc5baea53f66 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Tue, 26 Mar 2024 16:47:12 -0500 Subject: [PATCH] chg: Reorganize config files --- laptop/{ => config}/globals.lua | 4 -- laptop/{ => config}/keymaps.lua | 0 laptop/config/plugins.lua | 68 +++++++++++++++++++ laptop/init.lua | 2 +- .../tex.snippets | 0 laptop/plugin/misc.lua | 3 + laptop/plugins.lua | 62 ----------------- server/{ => config}/globals.lua | 0 server/{ => config}/keymaps.lua | 0 server/{ => config}/plugins.lua | 10 ++- server/init.lua | 2 +- vps/{ => config}/globals.lua | 0 vps/{ => config}/keymaps.lua | 0 vps/{ => config}/plugins.lua | 10 ++- vps/init.lua | 2 +- 15 files changed, 90 insertions(+), 73 deletions(-) rename laptop/{ => config}/globals.lua (86%) rename laptop/{ => config}/keymaps.lua (100%) create mode 100644 laptop/config/plugins.lua rename laptop/{custom-snippets => my-snippets}/tex.snippets (100%) delete mode 100644 laptop/plugins.lua rename server/{ => config}/globals.lua (100%) rename server/{ => config}/keymaps.lua (100%) rename server/{ => config}/plugins.lua (90%) rename vps/{ => config}/globals.lua (100%) rename vps/{ => config}/keymaps.lua (100%) rename vps/{ => config}/plugins.lua (90%) diff --git a/laptop/globals.lua b/laptop/config/globals.lua similarity index 86% rename from laptop/globals.lua rename to laptop/config/globals.lua index e1d05ff..d66f428 100644 --- a/laptop/globals.lua +++ b/laptop/config/globals.lua @@ -29,7 +29,3 @@ set.spelllang = { "en", "programming" } vim.g.loaded_perl_provider = 0 vim.g.loaded_node_provider = 0 vim.g.loaded_ruby_provider = 0 - --- Load UltiSnips snippets from custom-snippets directory -vim.g.UltiSnipsSnippetDirectories = { "custom-snippets", "UltiSnips" } - diff --git a/laptop/keymaps.lua b/laptop/config/keymaps.lua similarity index 100% rename from laptop/keymaps.lua rename to laptop/config/keymaps.lua diff --git a/laptop/config/plugins.lua b/laptop/config/plugins.lua new file mode 100644 index 0000000..41b8540 --- /dev/null +++ b/laptop/config/plugins.lua @@ -0,0 +1,68 @@ +-- Automatically bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- Load plugin via paq-nvim +require("lazy").setup( + { + -- Use lualine for statusbar + "nvim-lualine/lualine.nvim", + "nvim-tree/nvim-web-devicons", + -- Auto commenting per filetype + "numToStr/Comment.nvim", + -- Give option to save files using sudo, if needed + "lambdalisue/suda.vim", + -- Auto toggle for number mode when vim isn't focused + "sitiom/nvim-numbertoggle", + -- Plugin for lean + "julian/lean.nvim", + -- Treesitter + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + -- LSP related plugins + "neovim/nvim-lspconfig", + "nvim-lua/plenary.nvim", + { + "hrsh7th/nvim-cmp", -- For LSP completion + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "micangl/cmp-vimtex", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + } + }, + "SirVer/ultisnips", -- For snippets + -- Support programming terms + { "psliwka/vim-dirtytalk", build = ":DirtytalkUpdate" }, + -- vim-moonfly theme + { "bluz71/vim-moonfly-colors", as = "moonfly" }, + -- Rust tools + "simrat39/rust-tools.nvim", + -- Automatically add bracket pairs + "windwp/nvim-autopairs", + -- Syntax highlighting for Fish scripts + "khaveesh/vim-fish-syntax", + -- Plugin for LaTeX + "lervag/vimtex", + -- Formatter + "stevearc/conform.nvim", + "kylechui/nvim-surround", + "junegunn/fzf", + "junegunn/fzf.vim", + }, + { + lockfile = vim.fn.stdpath("config") .. "/config/lazy-lock.json", + install = { missing = true }, + } +) diff --git a/laptop/init.lua b/laptop/init.lua index 4a2ab50..75135ae 100644 --- a/laptop/init.lua +++ b/laptop/init.lua @@ -1,5 +1,5 @@ -- Load the different config files -package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/?.lua" +package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/config/?.lua" -- Load global configs require("globals") diff --git a/laptop/custom-snippets/tex.snippets b/laptop/my-snippets/tex.snippets similarity index 100% rename from laptop/custom-snippets/tex.snippets rename to laptop/my-snippets/tex.snippets diff --git a/laptop/plugin/misc.lua b/laptop/plugin/misc.lua index 575d90e..ca63c38 100644 --- a/laptop/plugin/misc.lua +++ b/laptop/plugin/misc.lua @@ -5,3 +5,6 @@ require("Comment").setup() -- Default settings for nvim-surround require("nvim-surround").setup() + +-- Load UltiSnips snippets from custom-snippets directory +vim.g.UltiSnipsSnippetDirectories = { "my-snippets", "UltiSnips" } diff --git a/laptop/plugins.lua b/laptop/plugins.lua deleted file mode 100644 index 66b3e3d..0000000 --- a/laptop/plugins.lua +++ /dev/null @@ -1,62 +0,0 @@ --- Automatically bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - --- Load plugin via paq-nvim -require("lazy").setup({ - -- Use lualine for statusbar - "nvim-lualine/lualine.nvim", - "nvim-tree/nvim-web-devicons", - -- Auto commenting per filetype - "numToStr/Comment.nvim", - -- Give option to save files using sudo, if needed - "lambdalisue/suda.vim", - -- Auto toggle for number mode when vim isn't focused - "sitiom/nvim-numbertoggle", - -- Plugin for lean - "julian/lean.nvim", - -- Treesitter - { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, - -- LSP related plugins - "neovim/nvim-lspconfig", - "nvim-lua/plenary.nvim", - { - "hrsh7th/nvim-cmp", -- For LSP completion - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "micangl/cmp-vimtex", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - } - }, - "SirVer/ultisnips", -- For snippets - -- Support programming terms - { "psliwka/vim-dirtytalk", build = ":DirtytalkUpdate" }, - -- vim-moonfly theme - { "bluz71/vim-moonfly-colors", as = "moonfly" }, - -- Rust tools - "simrat39/rust-tools.nvim", - -- Automatically add bracket pairs - "windwp/nvim-autopairs", - -- Syntax highlighting for Fish scripts - "khaveesh/vim-fish-syntax", - -- Plugin for LaTeX - "lervag/vimtex", - -- Formatter - "stevearc/conform.nvim", - "kylechui/nvim-surround", - "junegunn/fzf", - "junegunn/fzf.vim", -}) diff --git a/server/globals.lua b/server/config/globals.lua similarity index 100% rename from server/globals.lua rename to server/config/globals.lua diff --git a/server/keymaps.lua b/server/config/keymaps.lua similarity index 100% rename from server/keymaps.lua rename to server/config/keymaps.lua diff --git a/server/plugins.lua b/server/config/plugins.lua similarity index 90% rename from server/plugins.lua rename to server/config/plugins.lua index 0074cfa..0b54fdb 100644 --- a/server/plugins.lua +++ b/server/config/plugins.lua @@ -13,7 +13,8 @@ end vim.opt.rtp:prepend(lazypath) -- Load plugins via lazy.nvim -require("lazy").setup({ +require("lazy").setup( + { -- Use lualine for statusbar "nvim-lualine/lualine.nvim", "nvim-tree/nvim-web-devicons", @@ -50,5 +51,10 @@ require("lazy").setup({ "kylechui/nvim-surround", "junegunn/fzf", "junegunn/fzf.vim", -}) + }, + { + lockfile = vim.fn.stdpath("config") .. "/config/lazy-lock.json", + install = { missing = true }, + } +) diff --git a/server/init.lua b/server/init.lua index 4a2ab50..75135ae 100644 --- a/server/init.lua +++ b/server/init.lua @@ -1,5 +1,5 @@ -- Load the different config files -package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/?.lua" +package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/config/?.lua" -- Load global configs require("globals") diff --git a/vps/globals.lua b/vps/config/globals.lua similarity index 100% rename from vps/globals.lua rename to vps/config/globals.lua diff --git a/vps/keymaps.lua b/vps/config/keymaps.lua similarity index 100% rename from vps/keymaps.lua rename to vps/config/keymaps.lua diff --git a/vps/plugins.lua b/vps/config/plugins.lua similarity index 90% rename from vps/plugins.lua rename to vps/config/plugins.lua index b1339dc..19bfa56 100644 --- a/vps/plugins.lua +++ b/vps/config/plugins.lua @@ -13,7 +13,8 @@ end vim.opt.rtp:prepend(lazypath) -- Load plugins via lazy.nvim -require("lazy").setup({ +require("lazy").setup( + { -- Use lualine for statusbar "nvim-lualine/lualine.nvim", "nvim-tree/nvim-web-devicons", @@ -50,5 +51,10 @@ require("lazy").setup({ "kylechui/nvim-surround", "junegunn/fzf", "junegunn/fzf.vim", -}) + }, + { + lockfile = vim.fn.stdpath("config") .. "/config/lazy-lock.json", + install = { missing = true }, + } +) diff --git a/vps/init.lua b/vps/init.lua index 4a2ab50..75135ae 100644 --- a/vps/init.lua +++ b/vps/init.lua @@ -1,5 +1,5 @@ -- Load the different config files -package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/?.lua" +package.path = package.path .. ';' .. vim.fn.stdpath("config") .. "/config/?.lua" -- Load global configs require("globals")