From e8f4a52702f0d097cc9f53b30cff5b5e590a9498 Mon Sep 17 00:00:00 2001 From: fabmorais Date: Thu, 20 Jun 2024 16:45:40 +0200 Subject: [PATCH] Breaking Changes: Migration packer.nvim to lazy.nvim --- init.lua | 2 +- lazy-lock.json | 47 +++++++++++++++ lua/chatgpt-config/init.lua | 1 + lua/dashboard-config/init.lua | 18 +----- lua/lazy-config/init.lua | 109 ++++++++++++++++++++++++++++++++++ lua/packer-config/init.lua | 94 ----------------------------- 6 files changed, 161 insertions(+), 110 deletions(-) create mode 100644 lazy-lock.json create mode 100644 lua/lazy-config/init.lua delete mode 100644 lua/packer-config/init.lua diff --git a/init.lua b/init.lua index 30551d2..94a2a63 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,6 @@ require("settings") require("mappings") -require("packer-config") +require("lazy-config") require("colorschemes-config.dracula") require("nvim-tree-config") require("lsp-config.lsp") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..37233bd --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,47 @@ +{ + "ChatGPT.nvim": { "branch": "main", "commit": "24bcca7f3fedfd5451d2c500d4e2cdfb9707d661" }, + "LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" }, + "auto-session": { "branch": "main", "commit": "af2219b9fa99c1d7ac409bd9eac094c459d3f52d" }, + "barbar.nvim": { "branch": "master", "commit": "d181f2cfd4b828f9c6f1e10e69c68241de59f54f" }, + "catppuccin": { "branch": "main", "commit": "67565cd353fa543fa30cb738570c2e4c87da3e9c" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "dashboard-nvim": { "branch": "master", "commit": "b88c997f468a1bacb1e9b13ff3b567638caa06e6" }, + "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, + "dracula.nvim": { "branch": "main", "commit": "8d8bddb8814c3e7e62d80dda65a9876f97eb699c" }, + "friendly-snippets": { "branch": "main", "commit": "682157939e57bd6a2c86277dfd4d6fbfce63dbac" }, + "gitsigns.nvim": { "branch": "main", "commit": "0dc886637f9686b7cfd245a4726f93abeab19d4a" }, + "gruvbox.nvim": { "branch": "main", "commit": "d4cde3853a172485961b515c36d51d757728d6e6" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, + "lazy.nvim": { "branch": "main", "commit": "bc620783663ab09d16bff9fdecc07da65b2a1528" }, + "lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, + "lspsaga.nvim": { "branch": "main", "commit": "6f920cfabddb9b7de5a3a4d0b7cd4f0774ae23e2" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, + "nui.nvim": { "branch": "main", "commit": "322978c734866996274467de084a95e4f9b5e0b1" }, + "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, + "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" }, + "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, + "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, + "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" }, + "nvim-lspconfig": { "branch": "master", "commit": "6806370929cf6a35be6e5e0e74588515a4356e4d" }, + "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, + "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, + "nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" }, + "nvim-treesitter": { "branch": "master", "commit": "7b04b398f868563cac37ae90baffd7c3dca513fe" }, + "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, + "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, + "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, + "telescope.nvim": { "branch": "master", "commit": "c392f1b78eaaf870ca584bd698e78076ed301b26" }, + "tint.nvim": { "branch": "master", "commit": "02bd0527a315a80e4e25bb2dd7b6994fb0daae01" }, + "toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" }, + "tokyonight.nvim": { "branch": "main", "commit": "81c867c5f638597a82c82094dcb90ed42444dabc" }, + "trouble.nvim": { "branch": "main", "commit": "2d8610a07033f2b367e71230ab128f8b89c2639d" }, + "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } +} \ No newline at end of file diff --git a/lua/chatgpt-config/init.lua b/lua/chatgpt-config/init.lua index ba8fdcc..4e9211d 100644 --- a/lua/chatgpt-config/init.lua +++ b/lua/chatgpt-config/init.lua @@ -1,3 +1,4 @@ require("chatgpt").setup({ api_key_cmd = "op read op://private/OpenAI/credential --no-newline", + api_model = "gpt-4-turbo", }) diff --git a/lua/dashboard-config/init.lua b/lua/dashboard-config/init.lua index 5bd1b98..9a60d3f 100644 --- a/lua/dashboard-config/init.lua +++ b/lua/dashboard-config/init.lua @@ -2,12 +2,13 @@ require("dashboard").setup({ config = { week_header = { enable = true }, shortcut = { + { desc = "󰊳 Lazy Update", group = "@property", action = "Lazy update", key = "u" }, { - desc = " Update", + desc = " Mason Update", -- group = "@variable", group = "Number", action = "MasonUpdate", - key = "u", + key = "m", }, { desc = " Files", @@ -16,19 +17,6 @@ require("dashboard").setup({ action = "Telescope find_files", key = "f", }, - { - desc = " Packer", - -- group = "@variable", - group = "Number", - action = "PackerSync", - key = "p", - }, - { - desc = " dotfiles", - group = "Number", - action = "Telescope dotfiles", - key = "d", - }, }, footer = { "@fab - https://github.com/fabmorais" }, }, diff --git a/lua/lazy-config/init.lua b/lua/lazy-config/init.lua new file mode 100644 index 0000000..b15c21a --- /dev/null +++ b/lua/lazy-config/init.lua @@ -0,0 +1,109 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or 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) + +vim.g.mapleader = " " + +local plugins = { + { "kyazdani42/nvim-tree.lua" }, + { "rcarriga/nvim-notify" }, + { "nvim-lualine/lualine.nvim" }, + { "romgrk/barbar.nvim" }, + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", dependencies = "p00f/nvim-ts-rainbow" }, + { "nvim-treesitter/nvim-treesitter-refactor" }, + { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + { "folke/which-key.nvim" }, + { "akinsho/toggleterm.nvim" }, + { + "lewis6991/gitsigns.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("gitsigns").setup({ current_line_blame = true }) + end, + }, + { "levouh/tint.nvim" }, + { "terrortylor/nvim-comment" }, + { "norcalli/nvim-colorizer.lua" }, + { + "nvimdev/dashboard-nvim", + event = "VimEnter", + config = function() + require("dashboard-config") + end, + dependencies = { "nvim-tree/nvim-web-devicons" }, + }, + { "lukas-reineke/indent-blankline.nvim" }, + { "windwp/nvim-autopairs" }, + { "sindrets/diffview.nvim", dependencies = "nvim-lua/plenary.nvim" }, + + --> Colorschemes + { "mofiqul/dracula.nvim", event = "VeryLazy" }, + { "ellisonleao/gruvbox.nvim", event = "VeryLazy" }, + { "catppuccin/nvim", name = "catppuccin", event = "VeryLazy" }, + { "folke/tokyonight.nvim", event = "VeryLazy" }, + + --> Debugging + { "mfussenegger/nvim-dap" }, + { "rcarriga/nvim-dap-ui" }, + { "theHamsta/nvim-dap-virtual-text" }, + { "nvim-neotest/nvim-nio" }, + + --> AI + { + "jackMort/ChatGPT.nvim", + event = "VeryLazy", + config = function() + require("chatgpt").setup() + end, + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "folke/trouble.nvim", + "nvim-telescope/telescope.nvim", + }, + }, + + --> Lsp + { "williamboman/mason.nvim" }, + { "williamboman/mason-lspconfig.nvim" }, + { "neovim/nvim-lspconfig" }, --> Collection of configurations for built-in LSP client + { "jose-elias-alvarez/null-ls.nvim" }, --> inject lsp diagnistocs, formattings, code actions, and more ... + { "onsails/lspkind-nvim" }, --> vscode-like pictograms for neovim lsp completion items + + --> Completions + { "hrsh7th/nvim-cmp" }, --> Autocompletion plugin + { "hrsh7th/cmp-nvim-lsp" }, --> LSP source for nvim-cmp + { "L3MON4D3/LuaSnip" }, --> Snippets plugin + { "rafamadriz/friendly-snippets" }, + { "saadparwaiz1/cmp_luasnip" }, --> Snippets source for nvim-cmp + { "simrat39/rust-tools.nvim" }, + { + "nvimdev/lspsaga.nvim", + dependencies = "nvim-lspconfig", + config = function() + require("lspsaga").setup({}) + end, + }, + + --> Auto Session + { + "rmagatti/auto-session", + config = function() + require("auto-session").setup() + end, + }, +} + +require("lazy").setup(plugins, {}) diff --git a/lua/packer-config/init.lua b/lua/packer-config/init.lua deleted file mode 100644 index eb2fe38..0000000 --- a/lua/packer-config/init.lua +++ /dev/null @@ -1,94 +0,0 @@ -return require("packer").startup(function(use) - use("wbthomason/packer.nvim") - use("kyazdani42/nvim-web-devicons") - use("kyazdani42/nvim-tree.lua") - use("rcarriga/nvim-notify") - use("nvim-lualine/lualine.nvim") - use("romgrk/barbar.nvim") - use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", requires = "p00f/nvim-ts-rainbow" }) - use("nvim-treesitter/nvim-treesitter-refactor") - use({ - "nvim-telescope/telescope.nvim", - requires = { { "nvim-lua/plenary.nvim" } }, - }) - use("folke/which-key.nvim") - use("akinsho/toggleterm.nvim") - use({ - "lewis6991/gitsigns.nvim", - requires = { "nvim-lua/plenary.nvim" }, - config = function() - require("gitsigns").setup({ current_line_blame = true }) - end, - }) - use("levouh/tint.nvim") - use("terrortylor/nvim-comment") - use("norcalli/nvim-colorizer.lua") - use({ - "glepnir/dashboard-nvim", - config = function() - require("dashboard-config") - end, - event = "VimEnter", - dependencies = { { "nvim-tree/nvim-web-devicons" } }, - }) - use("lukas-reineke/indent-blankline.nvim") - use("windwp/nvim-autopairs") - use({ "sindrets/diffview.nvim", requires = "nvim-lua/plenary.nvim" }) - - --> Colorschemes - use("mofiqul/dracula.nvim") - use({ "ellisonleao/gruvbox.nvim" }) - use({ "catppuccin/nvim", as = "catppuccin" }) - use({ "folke/tokyonight.nvim" }) - - --> Debugging - use("mfussenegger/nvim-dap") - use("rcarriga/nvim-dap-ui") - use("theHamsta/nvim-dap-virtual-text") - use({ "nvim-neotest/nvim-nio" }) - - --> AI - use({ - "jackMort/ChatGPT.nvim", - config = function() - require("chatgpt").setup() - end, - requires = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "folke/trouble.nvim", - "nvim-telescope/telescope.nvim", - }, - }) - - --> Lsp - use("williamboman/mason.nvim") - use("williamboman/mason-lspconfig.nvim") - use("neovim/nvim-lspconfig") --> Collection of configurations for built-in LSP client - use("jose-elias-alvarez/null-ls.nvim") --> inject lsp diagnistocs, formattings, code actions, and more ... - use("onsails/lspkind-nvim") --> vscode-like pictograms for neovim lsp completion items - - --> Completions - use("hrsh7th/nvim-cmp") --> Autocompletion plugin - use("hrsh7th/cmp-nvim-lsp") --> LSP source for nvim-cmp - use("L3MON4D3/LuaSnip") --> Snippets plugin - use("rafamadriz/friendly-snippets") - use("saadparwaiz1/cmp_luasnip") --> Snippets source for nvim-cmp - - use("simrat39/rust-tools.nvim") - use({ - "nvimdev/lspsaga.nvim", - after = "nvim-lspconfig", - config = function() - require("lspsaga").setup({}) - end, - }) - - --> Auto Session - use({ - "rmagatti/auto-session", - config = function() - require("auto-session").setup() - end, - }) -end)