move packer_setup to plugins

This commit is contained in:
Vladan Popovic 2023-09-26 02:15:22 +02:00
parent bb552b1482
commit 88e3cb4ead
3 changed files with 3 additions and 1 deletions

View file

@ -1,3 +1,5 @@
require('plugins.packer_setup')
require('packer').startup(function()
-- Packer can manage itself as an optional plugin
@ -49,6 +51,7 @@ require('packer').startup(function()
use { 'RRethy/vim-illuminate' } -- highlight all words same as the one under cursor
use { 'vim-scripts/DrawIt' } -- ascii diagrams
use { 'nathom/filetype.nvim' }
end)
require('plugins.cmp')

View file

@ -0,0 +1,9 @@
-- Auto install packer.nvim if not exists
local install_path = vim.fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.api.nvim_command('!git clone https://github.com/wbthomason/packer.nvim '..install_path)
end
vim.cmd [[packadd packer.nvim]]
-- Auto compile when there are changes in plugins.lua
vim.cmd 'autocmd BufWritePost plugins.lua PackerCompile'