243 lines
7.1 KiB
Lua
243 lines
7.1 KiB
Lua
-- Automatically run :PackerCompile whenever plugins.lua is updated with an autocommand:
|
|
|
|
vim.api.nvim_create_autocmd('BufWritePost', {
|
|
group = vim.api.nvim_create_augroup('PACKER', { clear = true }),
|
|
pattern = 'plugins.lua',
|
|
command = 'source <afile> | PackerCompile',
|
|
})
|
|
|
|
return require('packer').startup({
|
|
function(use)
|
|
---------------------
|
|
-- Package Manager --
|
|
---------------------
|
|
|
|
use('wbthomason/packer.nvim')
|
|
|
|
----------------------
|
|
-- Required plugins --
|
|
----------------------
|
|
|
|
-- lua functions that you don't want to write twice
|
|
use('nvim-lua/plenary.nvim')
|
|
|
|
---------------------------------------- Theme, Icons, Statusbar, Bufferbar --
|
|
----------------------------------------
|
|
|
|
-- A file type icons
|
|
use('nvim-tree/nvim-web-devicons')
|
|
|
|
use({
|
|
'numToStr/Sakura.nvim',
|
|
config = function()
|
|
require('macbook.plugins.sakura')
|
|
end,
|
|
})
|
|
|
|
use({
|
|
{
|
|
'nvim-lualine/lualine.nvim',
|
|
event = 'BufEnter',
|
|
config = function()
|
|
require('macbook.plugins.lualine')
|
|
end,
|
|
},
|
|
|
|
-- Standalone UI for nvim-lsp progress
|
|
{
|
|
'j-hui/fidget.nvim',
|
|
after = 'lualine.nvim',
|
|
config = function()
|
|
require('fidget').setup()
|
|
end,
|
|
},
|
|
})
|
|
|
|
-----------------------------------
|
|
-- Treesitter: Better Highlights --
|
|
-----------------------------------
|
|
|
|
use({
|
|
{
|
|
'nvim-treesitter/nvim-treesitter',
|
|
event = 'CursorHold',
|
|
run = ':TSUpdate',
|
|
config = function()
|
|
require('macbook.plugins.treesitter')
|
|
end,
|
|
},
|
|
{ 'nvim-treesitter/nvim-treesitter-textobjects', after = 'nvim-treesitter' },
|
|
{ 'nvim-treesitter/nvim-treesitter-refactor', after = 'nvim-treesitter' },
|
|
{ 'windwp/nvim-ts-autotag', after = 'nvim-treesitter' },
|
|
{ 'JoosepAlviste/nvim-ts-context-commentstring', after = 'nvim-treesitter' },
|
|
})
|
|
|
|
--------------------------
|
|
-- Editor UI Niceties --
|
|
--------------------------
|
|
|
|
use({
|
|
'norcalli/nvim-colorizer.lua',
|
|
event = 'CursorHold',
|
|
config = function()
|
|
require('colorizer').setup()
|
|
end,
|
|
})
|
|
|
|
use({
|
|
'lewis6991/gitsigns.nvim',
|
|
event = 'BufRead',
|
|
config = function()
|
|
require('macbook.plugins.gitsigns')
|
|
end,
|
|
})
|
|
|
|
use({
|
|
'rhysd/git-messenger.vim',
|
|
event = 'BufRead',
|
|
config = function()
|
|
require('macbook.plugins.git-messenger')
|
|
end,
|
|
})
|
|
|
|
---------------------------------
|
|
-- Navigation and Fuzzy Search --
|
|
---------------------------------
|
|
|
|
use({
|
|
'nvim-tree/nvim-tree.lua',
|
|
event = 'CursorHold',
|
|
config = function()
|
|
require('macbook.plugins.nvim-tree')
|
|
end,
|
|
})
|
|
|
|
use({
|
|
{
|
|
'nvim-telescope/telescope.nvim',
|
|
event = 'CursorHold',
|
|
config = function()
|
|
require('macbook.plugins.telescope')
|
|
end,
|
|
},
|
|
{
|
|
'nvim-telescope/telescope-fzf-native.nvim',
|
|
after = 'telescope.nvim',
|
|
run = 'make',
|
|
config = function()
|
|
require('telescope').load_extension('fzf')
|
|
end,
|
|
},
|
|
{
|
|
'nvim-telescope/telescope-symbols.nvim',
|
|
after = 'telescope.nvim',
|
|
},
|
|
})
|
|
|
|
-- Quickly move to any word in the file
|
|
use({
|
|
'smoka7/hop.nvim',
|
|
event = 'BufRead',
|
|
config = function()
|
|
require('macbook.plugins.hop')
|
|
end,
|
|
})
|
|
|
|
-- smooth scrolling
|
|
use({
|
|
'karb94/neoscroll.nvim',
|
|
event = 'WinScrolled',
|
|
config = function()
|
|
require('neoscroll').setup({ hide_cursor = false })
|
|
end,
|
|
})
|
|
|
|
-- markdown previewer
|
|
use({
|
|
'toppair/peek.nvim',
|
|
event = 'BufRead',
|
|
build = 'deno task --quiet build:fast',
|
|
config = function()
|
|
require('macbook.plugins.peek')
|
|
end,
|
|
})
|
|
|
|
-----------------------------------
|
|
-- LSP, Completions and Snippets --
|
|
-----------------------------------
|
|
|
|
use({
|
|
'neovim/nvim-lspconfig',
|
|
event = 'BufRead',
|
|
config = function()
|
|
require('macbook.plugins.lsp.servers')
|
|
end,
|
|
requires = {
|
|
{
|
|
-- WARN: Unfortunately, we won't be able to lazy load this
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
},
|
|
},
|
|
})
|
|
|
|
-- Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
|
|
use({
|
|
'nvimtools/none-ls.nvim',
|
|
event = 'BufRead',
|
|
config = function()
|
|
require('macbook.plugins.lsp.null-ls')
|
|
end,
|
|
})
|
|
|
|
-- A completion plugin for neovim coded in Lua.
|
|
use({
|
|
{
|
|
'hrsh7th/nvim-cmp',
|
|
event = 'InsertEnter',
|
|
config = function()
|
|
require('macbook.plugins.lsp.nvim-cmp')
|
|
end,
|
|
requires = {
|
|
{
|
|
-- Snippet Engine for Neovim written in Lua.
|
|
'L3MON4D3/LuaSnip',
|
|
event = 'InsertEnter',
|
|
config = function()
|
|
require('macbook.plugins.lsp.luasnip')
|
|
end,
|
|
requires = {
|
|
{
|
|
'rafamadriz/friendly-snippets',
|
|
event = 'CursorHold',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{ 'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp' },
|
|
{ 'hrsh7th/cmp-path', after = 'nvim-cmp' },
|
|
{ 'hrsh7th/cmp-buffer', after = 'nvim-cmp' },
|
|
})
|
|
|
|
-- NOTE: nvim-autopairs needs to be loaded after nvim-cmp, so that <CR> would work properly
|
|
use({
|
|
'windwp/nvim-autopairs',
|
|
event = 'InsertCharPre',
|
|
after = 'nvim-cmp',
|
|
config = function()
|
|
require('macbook.plugins.pairs')
|
|
end,
|
|
})
|
|
|
|
-- LSP plugin for flutter ecosystem
|
|
use({
|
|
'akinsho/flutter-tools.nvim',
|
|
requires = {
|
|
'nvim-lua/plenary.nvim',
|
|
'stevearc/dressing.nvim', -- This improves the default vim.ui interfaces
|
|
},
|
|
})
|
|
|
|
end,
|
|
})
|