First version of the packer plugin setup calls

This commit is contained in:
Oliver Hartmann 2022-03-16 17:22:06 +01:00
parent d1b14f05c1
commit 7e1182a11b
3 changed files with 95 additions and 73 deletions

View File

@ -5,20 +5,6 @@ local opt = vim.opt -- to set options
local utils = require('utils')
local packerUtil = require'packer.util'
-------------------- PACKER --------------------------------
-- Auto install packer.nvim if not exists
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd 'packadd packer.nvim'
end
vim.cmd [[packadd packer.nvim]]
require('packer').init({
snapshot_path = packerUtil.join_paths(vim.fn.stdpath('config'), 'snapshots'),
display = {
open_fn = require('packer.util').float,
}
})
-------------------- EXTERNAL ------------------------------
require('my_plugins')
require('my_keymappings')
@ -26,7 +12,6 @@ require('my_options')
require("my_autocommands")
-- plugins
require('my_telescope')
require('my_lspinstall')
require('my_cmp')
require('my_neogen')

View File

@ -1,3 +1,28 @@
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
augroup end
]])
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({
"git",
"clone",
"--depth",
"1",
"https://github.com/wbthomason/packer.nvim",
install_path,
})
end
vim.api.nvim_command("packadd packer.nvim")
function get_setup(name)
return string.format('require("setup/%s")', name)
end
return require('packer').startup(function()
-- Packer can manage itself as an optional plugin
@ -7,10 +32,15 @@ return require('packer').startup(function()
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
}
use {
use({
'nvim-telescope/telescope.nvim',
requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}, {'kyazdani42/nvim-web-devicons'}}
}
requires = {
{'nvim-lua/popup.nvim'},
{'nvim-lua/plenary.nvim'},
{'kyazdani42/nvim-web-devicons'}
},
config = get_setup("telescope"),
})
use {'sainnhe/gruvbox-material'}
use {'ellisonleao/gruvbox.nvim'}
use {'lukas-reineke/indent-blankline.nvim'}
@ -24,10 +54,17 @@ return require('packer').startup(function()
use {
'hrsh7th/nvim-cmp',
requires = {
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-nvim-lua',
'octaltree/cmp-look', 'hrsh7th/cmp-path', 'hrsh7th/cmp-calc',
'f3fora/cmp-spell', 'hrsh7th/cmp-emoji', 'hrsh7th/cmp-cmdline'
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-nvim-lua',
'octaltree/cmp-look',
'hrsh7th/cmp-path',
'hrsh7th/cmp-calc',
'f3fora/cmp-spell',
'hrsh7th/cmp-emoji',
'hrsh7th/cmp-cmdline'
}
}
use {'rafamadriz/friendly-snippets'}