From 503635ea27a75548475bfffc54592e7d93ef97ab Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Tue, 19 Mar 2024 03:55:32 -0500 Subject: [PATCH] chg: Moved from vim-plug to paq-nvim for plugins --- init.lua | 4 +-- paq.lua | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plug.vim | 48 ----------------------------------- 3 files changed, 78 insertions(+), 50 deletions(-) create mode 100644 paq.lua delete mode 100644 plug.vim diff --git a/init.lua b/init.lua index fdc66ff..d7112a0 100644 --- a/init.lua +++ b/init.lua @@ -3,8 +3,8 @@ local vimrc = vim.fn.stdpath("config") .. "/vimrc.vim" vim.cmd.source(vimrc) -- Load plugins using vim-plug -local plug = vim.fn.stdpath("config") .. "/plug.vim" -vim.cmd.source(plug) +local paq = vim.fn.stdpath("config") .. "/paq.lua" +vim.cmd.source(paq) -- Default settings for comment plugin require('Comment').setup() diff --git a/paq.lua b/paq.lua new file mode 100644 index 0000000..2411f81 --- /dev/null +++ b/paq.lua @@ -0,0 +1,76 @@ +-- Automatically bootstrap paq-nvim +local function clone_paq() + local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim" + local is_installed = vim.fn.empty(vim.fn.glob(path)) == 0 + if not is_installed then + vim.fn.system { "git", "clone", "--depth=1", "https://github.com/savq/paq-nvim.git", path } + return true + end + end + + local function bootstrap_paq(packages) + local first_install = clone_paq() + vim.cmd.packadd("paq-nvim") + local paq = require("paq") + if first_install then + vim.notify("Installing plugins... If prompted, hit Enter to continue.") + paq.install() + end + paq(packages) + end + +-- Automatically install new packages at startup +vim.api.nvim_create_autocmd("VimEnter", { + once = true, + callback = function() + local paq = require("paq") + local pkgs_count = #paq.query("to_install") + if pkgs_count < 1 then + paq.update() + return end + vim.notify(string.format("There are %d plugins to install", pkgs_count)) + paq.install() + end +}) + +-- Load plugin via paq-nvim +bootstrap_paq { + "savq/paq-nvim", + -- airline related plugins + "vim-airline/vim-airline", + "vim-airline/vim-airline-themes", + -- 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", + -- LSP related plugins + "neovim/nvim-lspconfig", + "nvim-lua/plenary.nvim", + "hrsh7th/nvim-cmp", -- For LSP completion + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-omni", -- For LaTeX completion + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "SirVer/ultisnips", -- For snippets + -- Support programming terms + { "psliwka/vim-dirtytalk", build = ':let &rtp = &rtp | 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", + -- For Searching + "junegunn/fzf.vim", +} diff --git a/plug.vim b/plug.vim deleted file mode 100644 index 7d40112..0000000 --- a/plug.vim +++ /dev/null @@ -1,48 +0,0 @@ -" Auto install vim-plug -let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' -if empty(glob(data_dir . '/autoload/plug.vim')) - silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - autocmd VimEnter * PlugInstall --sync | source $MYVIMRC -endif - -" Load plugins via vim-plug -call plug#begin() - " airline related plugins - Plug 'vim-airline/vim-airline' - Plug 'vim-airline/vim-airline-themes' - " Auto commenting per filetype - Plug 'numToStr/Comment.nvim' - " Give option to save files using sudo, if needed - Plug 'lambdalisue/suda.vim' - " Auto toggle for number mode when vim isn't focused - Plug 'sitiom/nvim-numbertoggle' - " Plugin for lean - Plug 'julian/lean.nvim' - " LSP related plugins - Plug 'neovim/nvim-lspconfig' - Plug 'nvim-lua/plenary.nvim' - Plug 'hrsh7th/nvim-cmp' " For LSP completion - Plug 'hrsh7th/cmp-nvim-lsp' - Plug 'hrsh7th/cmp-buffer' - Plug 'hrsh7th/cmp-omni' " For LaTeX completion - Plug 'hrsh7th/cmp-path' - Plug 'hrsh7th/cmp-cmdline' - Plug 'SirVer/ultisnips' " For snippets - " Support programming terms - Plug 'psliwka/vim-dirtytalk', { 'do': ':let &rtp = &rtp \| DirtytalkUpdate' } - " vim-moonfly theme - Plug 'bluz71/vim-moonfly-colors', { 'as': 'moonfly' } - " Rust tools - Plug 'simrat39/rust-tools.nvim' - " Automatically add bracket pairs - Plug 'windwp/nvim-autopairs' - " Syntax highlighting for Fish scripts - Plug 'khaveesh/vim-fish-syntax' - " Plugin for LaTeX - Plug 'lervag/vimtex' - " Formatter - Plug 'stevearc/conform.nvim' - " For Searching - Plug 'junegunn/fzf.vim' -call plug#end() -