From 48f9e170aa9ca2733bb40df39ea6ed706932b88a Mon Sep 17 00:00:00 2001 From: Fey Naomi Schrewe Date: Sat, 7 Sep 2024 10:31:18 +0200 Subject: [PATCH] feat: move lazy config to file for reloading --- init.lua | 16 +++++ lazy-lock.json | 1 + lua/lsp-setup.lua | 1 + lua/plugins.lua | 165 ++++++++++++++++++++++------------------------ 4 files changed, 97 insertions(+), 86 deletions(-) diff --git a/init.lua b/init.lua index 81e751a..a34db8e 100644 --- a/init.lua +++ b/init.lua @@ -9,3 +9,19 @@ vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 vim.opt.expandtab = false vim.opt.relativenumber = true + +-- bootstrap lazy +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) + +require('lazy').setup('plugins') diff --git a/lazy-lock.json b/lazy-lock.json index ec60a4d..85eb45c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -21,6 +21,7 @@ "nvim-treesitter": { "branch": "master", "commit": "30de5e7e9486fb1b1b8c2a1e71052b13f94f1cb0" }, "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, "rose-pine": { "branch": "main", "commit": "b6fe88c3282cf9f117a3e836d761c2d78d02f417" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, diff --git a/lua/lsp-setup.lua b/lua/lsp-setup.lua index 5f257bb..77e3355 100644 --- a/lua/lsp-setup.lua +++ b/lua/lsp-setup.lua @@ -4,6 +4,7 @@ local lspconfig = require('lspconfig') lspconfig.lua_ls.setup {} lspconfig.tsserver.setup {} +lspconfig.ccls.setup {} -- Global mappings. -- See `:help vim.diagnostic.*` for documentation on any of the below functions diff --git a/lua/plugins.lua b/lua/plugins.lua index 39c1ab7..d2a7395 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,88 +1,81 @@ --- bootstrap lazy -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) - -return require('lazy').setup { - spec = { - { - 'rose-pine/neovim', - name = 'rose-pine', - config = function() vim.cmd [[colorscheme rose-pine-moon]] end +return { + { + 'rose-pine/neovim', + name = 'rose-pine', + config = function() vim.cmd [[colorscheme rose-pine-moon]] end + }, + { + "L3MON4D3/LuaSnip", + version = "v2.*", + build = "make install_jsregexp" + }, + 'saadparwaiz1/cmp_luasnip', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + { + 'hrsh7th/nvim-cmp', + config = function() require 'cmp-setup' end + }, + "lukas-reineke/cmp-under-comparator", + 'folke/neodev.nvim', + { 'neovim/nvim-lspconfig', config = function() require 'lsp-setup' end, after = 'neodev.nvim' }, + 'simrat39/rust-tools.nvim', + 'mfussenegger/nvim-dap', + { + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup() + end + }, + { + "NeogitOrg/neogit", + version = "v0.0.1", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "nvim-telescope/telescope.nvim", -- optional + "sindrets/diffview.nvim", -- optional }, - { - "L3MON4D3/LuaSnip", - version = "v2.*", - build = "make install_jsregexp" - }, - 'saadparwaiz1/cmp_luasnip', - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - { - 'hrsh7th/nvim-cmp', - config = function() require 'cmp-setup' end - }, - "lukas-reineke/cmp-under-comparator", - 'folke/neodev.nvim', - { 'neovim/nvim-lspconfig', config = function() require 'lsp-setup' end, after = 'neodev.nvim' }, - 'simrat39/rust-tools.nvim', - 'mfussenegger/nvim-dap', - { - 'numToStr/Comment.nvim', - config = function() - require('Comment').setup() - end - }, - { - "NeogitOrg/neogit", - version = "v0.0.1", - dependencies = { - "nvim-lua/plenary.nvim", -- required - "nvim-telescope/telescope.nvim", -- optional - "sindrets/diffview.nvim", -- optional - }, - config = true, - }, - 'lambdalisue/suda.vim', - { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - config = function() - require("nvim-surround").setup({}) - end - }, - { - 'nvim-treesitter/nvim-treesitter', - config = function() require 'nvim-treesitter.configs'.setup({}) end, - build = function() - local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) - ts_update() - end, - }, - { - 'theblob42/drex.nvim', - dependencies = 'kyazdani42/nvim-web-devicons', - config = function() - vim.keymap.set('n', '', ':DrexDrawerToggle') - end - }, - { - "klen/nvim-test", - config = function() - require('nvim-test').setup() - end - }, - 'direnv/direnv.vim' - } + config = true, + }, + { + "ahmedkhalf/project.nvim", + config = function() + require("project_nvim").setup { + } + end + }, + 'lambdalisue/suda.vim', + { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + config = function() + require("nvim-surround").setup({}) + end + }, + { + 'nvim-treesitter/nvim-treesitter', + config = function() require 'nvim-treesitter.configs'.setup({ + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "rust", "cpp" } + }) end, + build = function() + local ts_update = require('nvim-treesitter.install').update({ with_sync = true }) + ts_update() + end, + }, + { + 'theblob42/drex.nvim', + dependencies = 'kyazdani42/nvim-web-devicons', + config = function() + vim.keymap.set('n', '', ':DrexDrawerToggle') + end + }, + { + "klen/nvim-test", + config = function() + require('nvim-test').setup() + end + }, + 'direnv/direnv.vim' }