Separating plugin manager instalation from configuration

This commit is contained in:
juanito87 2024-04-21 18:10:11 -03:00
parent 834e294b9e
commit 9ef80b2ace
No known key found for this signature in database
GPG Key ID: EAB042894FD44AFD
3 changed files with 13 additions and 11 deletions

View File

@ -103,4 +103,5 @@ require 'keymaps'
require 'autocommands' require 'autocommands'
-- [[ Lazy package manager ]] -- [[ Lazy package manager ]]
require 'lazy' require 'lazy-install'
require 'lazy-config'

View File

@ -1,13 +1,6 @@
-- [[ Install `lazy.nvim` plugin manager ]]
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)
-- [[ Configure and install plugins ]] -- [[ Configure and install plugins ]]
-- Definitions
local autocmd = vim.api.nvim_create_autocmd
-- --
-- To check the current status of your plugins, run -- To check the current status of your plugins, run
-- :Lazy -- :Lazy
@ -249,7 +242,7 @@ require('lazy').setup({
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
-- function will be executed to configure the current buffer -- function will be executed to configure the current buffer
autocmd('LspAttach', { autocmd('LspAttach', {
group = augroup('kickstart-lsp-attach', { clear = true }), group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }),
callback = function(event) callback = function(event)
-- NOTE: Remember that Lua is a real programming language, and as such it is possible -- NOTE: Remember that Lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself. -- to define small helper and utility functions so you don't have to repeat yourself.

8
lua/lazy-install.lua Normal file
View File

@ -0,0 +1,8 @@
-- [[ Install `lazy.nvim` plugin manager ]]
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)