You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
126 lines
3.2 KiB
Lua
126 lines
3.2 KiB
Lua
local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
|
local is_bootstrap = false
|
|
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
|
is_bootstrap = true
|
|
vim.fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
|
|
vim.cmd([[packadd packer.nvim]])
|
|
end
|
|
|
|
require("packer").startup(function(use)
|
|
-- Packer can manage itself
|
|
use("wbthomason/packer.nvim")
|
|
use("folke/tokyonight.nvim")
|
|
use({
|
|
"nvim-telescope/telescope.nvim",
|
|
tag = "0.1.0",
|
|
requires = {
|
|
"nvim-lua/plenary.nvim",
|
|
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
|
|
},
|
|
wants = {
|
|
"telescope-fzf-native.nvim",
|
|
},
|
|
})
|
|
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
|
|
use({
|
|
"nvim-treesitter/nvim-treesitter",
|
|
run = function()
|
|
local ts_update = require("nvim-treesitter.install").update({ with_sync = true })
|
|
ts_update()
|
|
end,
|
|
})
|
|
|
|
-- LSP
|
|
use({
|
|
"VonHeikemen/lsp-zero.nvim",
|
|
requires = {
|
|
-- LSP Support
|
|
{ "neovim/nvim-lspconfig" },
|
|
{ "williamboman/mason.nvim" },
|
|
{ "williamboman/mason-lspconfig.nvim" },
|
|
|
|
-- Autocompletion
|
|
{ "hrsh7th/nvim-cmp" },
|
|
{ "hrsh7th/cmp-buffer" },
|
|
{ "hrsh7th/cmp-path" },
|
|
{ "saadparwaiz1/cmp_luasnip" },
|
|
{ "hrsh7th/cmp-nvim-lsp" },
|
|
{ "hrsh7th/cmp-nvim-lua" },
|
|
|
|
-- Snippets
|
|
{ "L3MON4D3/LuaSnip" },
|
|
{ "rafamadriz/friendly-snippets" },
|
|
},
|
|
})
|
|
|
|
-- formatting & linting
|
|
use("jose-elias-alvarez/null-ls.nvim")
|
|
use("jayp0521/mason-null-ls.nvim")
|
|
|
|
use({
|
|
"nvim-lualine/lualine.nvim",
|
|
requires = { "nvim-tree/nvim-web-devicons", opt = true },
|
|
})
|
|
|
|
use({
|
|
"lewis6991/gitsigns.nvim",
|
|
config = function()
|
|
require("gitsigns").setup()
|
|
end,
|
|
})
|
|
|
|
use("tpope/vim-fugitive")
|
|
use("tpope/vim-rhubarb")
|
|
|
|
use({
|
|
"folke/trouble.nvim",
|
|
requires = "kyazdani42/nvim-web-devicons",
|
|
config = function()
|
|
require("trouble").setup({
|
|
-- your configuration comes here
|
|
-- or leave it empty to use the default settings
|
|
-- refer to the configuration section below
|
|
})
|
|
end,
|
|
})
|
|
|
|
use({
|
|
"kylechui/nvim-surround",
|
|
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
|
|
config = function()
|
|
require("nvim-surround").setup({
|
|
-- Configuration here, or leave empty to use defaults
|
|
})
|
|
end,
|
|
})
|
|
|
|
use("theprimeagen/harpoon")
|
|
|
|
-- Automatically set up your configuration after cloning packer.nvim
|
|
-- Put this at the end after all plugins
|
|
if is_bootstrap then
|
|
require("packer").sync()
|
|
end
|
|
end)
|
|
|
|
-- When we are bootstrapping a configuration, it doesn't
|
|
-- make sense to execute the rest of the init.lua.
|
|
--
|
|
-- You'll need to restart nvim, and then it will work.
|
|
if is_bootstrap then
|
|
print("==================================")
|
|
print(" Plugins are being installed")
|
|
print(" Wait until Packer completes,")
|
|
print(" then restart nvim")
|
|
print("==================================")
|
|
return
|
|
end
|
|
|
|
-- Automatically source and re-compile packer whenever you save this init.lua
|
|
local packer_group = vim.api.nvim_create_augroup("Packer", { clear = true })
|
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
|
command = "source <afile> | silent! LspStop | silent! LspStart | PackerCompile",
|
|
group = packer_group,
|
|
pattern = vim.fn.expand("$MYVIMRC"),
|
|
})
|