From dc218d6736af9c3afb147766bf7542cc0476a9a0 Mon Sep 17 00:00:00 2001 From: Von Random Date: Wed, 13 Sep 2023 22:57:25 +0300 Subject: [PATCH] nvim: move to lazy.nvim --- .gitignore | 2 +- cli/.config/nvim/lua/packer_init.lua | 23 ------------ cli/.config/nvim/lua/plugins.lua | 52 ++++++++++++++++------------ 3 files changed, 30 insertions(+), 47 deletions(-) delete mode 100644 cli/.config/nvim/lua/packer_init.lua diff --git a/.gitignore b/.gitignore index f7db4a7..342f63f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ cli/.config/zsh/env.zsh cli/.config/zsh/local.zsh cli/.config/fish/conf.d/local.fish cli/.config/fish/fish_variables -cli/.config/nvim/plugin/packer_compiled.lua +cli/.config/nvim/lazy-lock.json diff --git a/cli/.config/nvim/lua/packer_init.lua b/cli/.config/nvim/lua/packer_init.lua deleted file mode 100644 index 9552f8e..0000000 --- a/cli/.config/nvim/lua/packer_init.lua +++ /dev/null @@ -1,23 +0,0 @@ -local packer_init = {} - -packer_init.init = function(plugins) - local ensure_packer = function() - local install_path = vim.fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' - if vim.fn.empty(vim.fn.glob(install_path)) > 0 then - vim.fn.system {'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path} - vim.cmd [[packadd packer.nvim]] - return true - end - return false - end - - local packer_bootstrap = ensure_packer() - require('packer').startup(plugins) - if packer_bootstrap then - require('packer').sync() - return true - end - return false -end - -return packer_init diff --git a/cli/.config/nvim/lua/plugins.lua b/cli/.config/nvim/lua/plugins.lua index 259cd4a..5a33d9f 100644 --- a/cli/.config/nvim/lua/plugins.lua +++ b/cli/.config/nvim/lua/plugins.lua @@ -1,28 +1,34 @@ --- [[ plugins list ]] -local function plugins(use) - use 'wbthomason/packer.nvim' - - use { - 'lifepillar/vim-solarized8', - branch = 'neovim' - } - use 'lifepillar/vim-cheat40' - use 'hashivim/vim-terraform' - use 'khaveesh/vim-fish-syntax' - use 'lewis6991/gitsigns.nvim' - use 'tpope/vim-rsi' - use 'tpope/vim-vinegar' - use { - 'nvim-telescope/telescope.nvim', - requires = 'nvim-lua/plenary.nvim' - } - use { - 'w0rp/ale', - ft = { 'bash', 'sh', 'zsh', 'lua', 'python' }, - cmd = 'ALEEnable' +-- [[ plugins bootstrap ]] +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", lazypath } end -if require('packer_init').init(plugins) then return end +vim.opt.rtp:prepend(lazypath) + +--[[ plugins list ]] +require('lazy').setup { + {'lifepillar/vim-solarized8', branch = 'neovim'}, + 'lewis6991/gitsigns.nvim', + 'lifepillar/vim-cheat40', + 'hashivim/vim-terraform', + 'khaveesh/vim-fish-syntax', + 'lewis6991/gitsigns.nvim', + 'tpope/vim-rsi', + 'tpope/vim-vinegar', + { + 'nvim-telescope/telescope.nvim', + dependencies = {'nvim-lua/plenary.nvim'} + }, + { + 'w0rp/ale', + cmd = 'ALEEnable', + ft = {'bash', 'sh', 'zsh', 'lua', 'python'} + } +} --[[ plugin configs and maps ]] require('gitsigns').setup()