228 lines
4.6 KiB
Lua
228 lines
4.6 KiB
Lua
local M = {}
|
|
|
|
function M.setup()
|
|
local packer_bootstrap = false
|
|
|
|
local conf = {
|
|
profile = {
|
|
enable = true,
|
|
threshold = 0,
|
|
},
|
|
display = {
|
|
open_fn = function()
|
|
return require("packer.util").float { border = "rounded" }
|
|
end,
|
|
},
|
|
}
|
|
|
|
local function packer_init()
|
|
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.git",
|
|
install_path,
|
|
}
|
|
vim.cmd [[packadd packer.nvim]]
|
|
end
|
|
vim.cmd "autocmd BufWritePost plugins.lua source <afile> | PackerCompile"
|
|
end
|
|
|
|
local function plugins(use)
|
|
use { "wbthomason/packer.nvim" }
|
|
|
|
use {
|
|
"sainnhe/edge",
|
|
config = function()
|
|
vim.cmd "colorscheme edge"
|
|
end,
|
|
}
|
|
|
|
use {
|
|
"folke/which-key.nvim",
|
|
config = function()
|
|
require("config.whichkey").setup()
|
|
end,
|
|
}
|
|
|
|
use {
|
|
"lukas-reineke/indent-blankline.nvim",
|
|
event = "BufReadPre",
|
|
config = function()
|
|
require("config.indentblankline").setup()
|
|
end,
|
|
}
|
|
|
|
use {
|
|
"kyazdani42/nvim-web-devicons",
|
|
module = "nvim-web-devicons",
|
|
config = function()
|
|
require("nvim-web-devicons").setup { default = true }
|
|
end,
|
|
}
|
|
|
|
use {
|
|
'numToStr/Comment.nvim',
|
|
config = function()
|
|
require('Comment').setup()
|
|
end
|
|
}
|
|
|
|
use { "chaoren/vim-wordmotion" }
|
|
|
|
-- Easy hopping
|
|
use {
|
|
"phaazon/hop.nvim",
|
|
cmd = { "HopWord", "HopChar1" },
|
|
config = function()
|
|
require("hop").setup {}
|
|
end,
|
|
}
|
|
|
|
use {
|
|
"nvim-lualine/lualine.nvim",
|
|
after = "nvim-treesitter",
|
|
config = function()
|
|
require("config.lualine").setup()
|
|
end,
|
|
requires = { "nvim-web-devicons" },
|
|
}
|
|
|
|
use {
|
|
"nvim-treesitter/nvim-treesitter",
|
|
run = ":TSUpdate",
|
|
config = function()
|
|
require("config.treesitter").setup()
|
|
end,
|
|
requires = {
|
|
{ "nvim-treesitter/nvim-treesitter-textobjects" },
|
|
}
|
|
}
|
|
|
|
use {
|
|
"SmiteshP/nvim-gps",
|
|
requires = "nvim-treesitter/nvim-treesitter",
|
|
module = "nvim-gps",
|
|
config = function()
|
|
require("nvim-gps").setup()
|
|
end,
|
|
}
|
|
|
|
use {
|
|
"hrsh7th/nvim-cmp",
|
|
config = function()
|
|
require("config.cmp").setup()
|
|
end,
|
|
wants = { "LuaSnip", "lspkind.nvim" },
|
|
requires = {
|
|
"hrsh7th/cmp-buffer",
|
|
"hrsh7th/cmp-path",
|
|
"hrsh7th/cmp-nvim-lua",
|
|
"ray-x/cmp-treesitter",
|
|
"hrsh7th/cmp-cmdline",
|
|
"saadparwaiz1/cmp_luasnip",
|
|
"hrsh7th/cmp-calc",
|
|
"f3fora/cmp-spell",
|
|
"hrsh7th/cmp-emoji",
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
"saadparwaiz1/cmp_luasnip",
|
|
"hrsh7th/cmp-nvim-lsp-signature-help",
|
|
{
|
|
"onsails/lspkind.nvim",
|
|
},
|
|
{
|
|
"L3MON4D3/LuaSnip",
|
|
wants = "friendly-snippets",
|
|
config = function()
|
|
require("config.luasnip").setup()
|
|
end,
|
|
},
|
|
disable = false,
|
|
},
|
|
}
|
|
|
|
use {
|
|
"windwp/nvim-autopairs",
|
|
wants = "nvim-treesitter",
|
|
module = { "nvim-autopairs.completion.cmp", "nvim-autopairs" },
|
|
config = function()
|
|
require("config.autopairs").setup()
|
|
end,
|
|
}
|
|
|
|
use {
|
|
"windwp/nvim-ts-autotag",
|
|
wants = "nvim-treesitter",
|
|
event = "InsertEnter",
|
|
config = function()
|
|
require("nvim-ts-autotag").setup { enable = true }
|
|
end,
|
|
}
|
|
|
|
use {
|
|
"neovim/nvim-lspconfig",
|
|
opt = true,
|
|
event = "BufReadPre",
|
|
wants = { "nvim-lsp-installer", "cmp-nvim-lsp", "lsp_signature.nvim" },
|
|
config = function()
|
|
require("config.lsp").setup()
|
|
end,
|
|
requires = {
|
|
"williamboman/nvim-lsp-installer",
|
|
"ray-x/lsp_signature.nvim"
|
|
}
|
|
}
|
|
|
|
use {
|
|
"nvim-telescope/telescope.nvim",
|
|
opt = true,
|
|
config = function()
|
|
require("config.telescope").setup()
|
|
end,
|
|
cmd = { "Telescope" },
|
|
module = "telescope",
|
|
keys = { "<leader>f", "<leader>p" },
|
|
wants = {
|
|
"plenary.nvim",
|
|
"popup.nvim",
|
|
"telescope-fzf-native.nvim",
|
|
"telescope-project.nvim",
|
|
"telescope-repo.nvim",
|
|
"telescope-file-browser.nvim",
|
|
"project.nvim",
|
|
},
|
|
requires = {
|
|
"nvim-lua/popup.nvim",
|
|
"nvim-lua/plenary.nvim",
|
|
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
|
|
"nvim-telescope/telescope-project.nvim",
|
|
"cljoly/telescope-repo.nvim",
|
|
"nvim-telescope/telescope-file-browser.nvim",
|
|
{
|
|
"ahmedkhalf/project.nvim",
|
|
config = function()
|
|
require("project_nvim").setup {}
|
|
end,
|
|
},
|
|
},
|
|
}
|
|
|
|
if packer_bootstrap then
|
|
print "Plugin Bootstrap - Restart Neovim required after installation!"
|
|
require("packer").sync()
|
|
end
|
|
end
|
|
|
|
packer_init()
|
|
|
|
local packer = require "packer"
|
|
packer.init(conf)
|
|
packer.startup(plugins)
|
|
end
|
|
|
|
return M
|