.dotfiles/config/nvim/init.lua

54 lines
1.4 KiB
Lua

local ensure_packer = function()
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
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
require('config')
require('plugins')
local packer_bootstrap = ensure_packer()
vim.opt.clipboard = 'unnamed'
return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
-- TreeSitter
use ('nvim-treesitter/nvim-treesitter', { run = ":TSUpdate"})
use {'nvim-telescope/telescope.nvim', tag = '0.1.8', requires = { {'nvim-lua/plenary.nvim'} }}
use ({"williamboman/mason.nvim"})
use ({"williamboman/mason-lspconfig.nvim"})
use ({'VonHeikemen/lsp-zero.nvim', branch = 'v4.x'})
use ({'neovim/nvim-lspconfig'})
use ({'hrsh7th/nvim-cmp'})
use ({'hrsh7th/cmp-nvim-lsp'})
use ({"L3MON4D3/LuaSnip"})
use ({"rafamadriz/friendly-snippets"})
use {
'hrsh7th/nvim-cmp',
config = function ()
require'cmp'.setup {
snippet = {
expand = function(args)
require'luasnip'.lsp_expand(args.body)
end
},
}
end
}
use { 'saadparwaiz1/cmp_luasnip' }
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then
require('packer').sync()
end
end)