Refine packer update commands
This commit is contained in:
parent
6e52e8a4fb
commit
64d984edb8
2 changed files with 14 additions and 11 deletions
|
@ -3,20 +3,20 @@ local fn = vim.fn
|
||||||
-- Install packer if it's not yet installed
|
-- Install packer if it's not yet installed
|
||||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
local install_path = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
print('installing packer')
|
print('Installing Packer')
|
||||||
Packer_bootstrap = fn.system({
|
Packer_bootstrap = fn.system({
|
||||||
'git', 'clone', '--depth', '1',
|
'git', 'clone', '--depth', '1',
|
||||||
'https://github.com/wbthomason/packer.nvim', install_path
|
'https://github.com/wbthomason/packer.nvim', install_path
|
||||||
})
|
})
|
||||||
vim.o.runtimepath = vim.fn.stdpath('data') .. '/site/pack/*/start/*,' ..
|
vim.o.runtimepath = vim.fn.stdpath('data') .. '/site/pack/*/start/*,' ..
|
||||||
vim.o.runtimepath
|
vim.o.runtimepath
|
||||||
print('installed packer')
|
print('Installed Packer')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Configure packer
|
-- Configure packer
|
||||||
vim.cmd [[packadd packer.nvim]]
|
vim.cmd [[packadd packer.nvim]]
|
||||||
require('packer').startup(function()
|
require('packer').startup(function()
|
||||||
local use = require('packer').use
|
local use = require('packer').use
|
||||||
|
|
||||||
-- The plugin manager itself
|
-- The plugin manager itself
|
||||||
use {'wbthomason/packer.nvim', opt=true}
|
use {'wbthomason/packer.nvim', opt=true}
|
||||||
|
@ -122,15 +122,16 @@ local use = require('packer').use
|
||||||
-- Vim <3 Asciidoctor
|
-- Vim <3 Asciidoctor
|
||||||
use 'habamax/vim-asciidoctor'
|
use 'habamax/vim-asciidoctor'
|
||||||
|
|
||||||
-- Sync plugins if Packer was just
|
|
||||||
-- installed
|
|
||||||
if Packer_bootstrap then
|
|
||||||
print('syncing')
|
|
||||||
require('packer').sync()
|
|
||||||
print('synced')
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Sync plugins if Packer was just
|
||||||
|
-- installed
|
||||||
|
if Packer_bootstrap then
|
||||||
|
print('Syncing plugins')
|
||||||
|
require('packer').sync()
|
||||||
|
print('Synced')
|
||||||
|
end
|
||||||
|
|
||||||
-- Source configurations
|
-- Source configurations
|
||||||
require 'plugins/lualine'
|
require 'plugins/lualine'
|
||||||
require 'plugins/bufferline'
|
require 'plugins/bufferline'
|
||||||
|
|
|
@ -132,7 +132,9 @@ update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins() {
|
plugins() {
|
||||||
nvim -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
|
echo "Updating NeoVim plugins"
|
||||||
|
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
|
||||||
|
echo "Updating NeoVim TreeSitter"
|
||||||
nvim --headless +TSUpdateSync +qa
|
nvim --headless +TSUpdateSync +qa
|
||||||
zinit self-update
|
zinit self-update
|
||||||
zinit update -p
|
zinit update -p
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue