2021-07-03 20:19:46 -04:00
|
|
|
local fn,api = vim.fn,vim.api
|
2021-07-10 12:40:43 -04:00
|
|
|
local packer_dir = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
|
2021-07-03 20:19:46 -04:00
|
|
|
|
|
|
|
if fn.empty(fn.glob(packer_dir)) > 0 then
|
|
|
|
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', packer_dir})
|
|
|
|
api.nvim_command('packadd packer.nvim')
|
|
|
|
end
|
|
|
|
|
2021-07-10 12:40:43 -04:00
|
|
|
-- Require since we use 'packer' as opt
|
|
|
|
vim.cmd [[packadd packer.nvim]]
|
2021-07-03 20:19:46 -04:00
|
|
|
|
2021-07-10 12:40:43 -04:00
|
|
|
return require('packer').startup(
|
2021-07-11 21:20:58 -04:00
|
|
|
function(use)
|
2021-07-10 12:40:43 -04:00
|
|
|
use {'wbthomason/packer.nvim', opt = true}
|
2021-07-03 20:19:46 -04:00
|
|
|
|
2021-07-10 12:40:43 -04:00
|
|
|
-----------------
|
|
|
|
-- UI elements --
|
|
|
|
-----------------
|
2021-07-03 20:19:46 -04:00
|
|
|
use {
|
2021-07-04 15:03:20 -04:00
|
|
|
'glepnir/dashboard-nvim',
|
2021-07-10 12:40:43 -04:00
|
|
|
cmd = {
|
|
|
|
'Dashboard',
|
|
|
|
'DashboardNewFile',
|
|
|
|
'DashboardFindFile',
|
|
|
|
'DashboardFindHistory',
|
|
|
|
'DashboardFindWord',
|
|
|
|
'DashboardJumpMark',
|
|
|
|
'SessionLoad',
|
|
|
|
'SessionSave'
|
|
|
|
},
|
2021-07-04 15:03:20 -04:00
|
|
|
setup = function()
|
|
|
|
require('modules.dashboard')
|
|
|
|
end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'glepnir/galaxyline.nvim',
|
|
|
|
branch = 'main',
|
|
|
|
requires = 'kyazdani42/nvim-web-devicons',
|
2021-07-03 20:19:46 -04:00
|
|
|
config = function()
|
2021-07-04 15:03:20 -04:00
|
|
|
require('modules.statusline')
|
2021-07-03 20:19:46 -04:00
|
|
|
end
|
|
|
|
}
|
2021-07-06 07:26:25 -04:00
|
|
|
use {
|
|
|
|
'akinsho/nvim-bufferline.lua',
|
|
|
|
config = function()
|
|
|
|
require('modules.bufferline')
|
|
|
|
end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'kyazdani42/nvim-tree.lua',
|
|
|
|
cmd = 'NvimTreeToggle',
|
|
|
|
setup = function()
|
2021-07-07 15:33:29 -04:00
|
|
|
require('modules.nvimtree')
|
2021-07-06 07:26:25 -04:00
|
|
|
end
|
|
|
|
}
|
2021-07-07 15:33:29 -04:00
|
|
|
use {
|
|
|
|
'folke/which-key.nvim',
|
2021-07-08 16:08:10 -04:00
|
|
|
config = function()
|
|
|
|
require('modules.whichkey')
|
|
|
|
end
|
2021-07-07 15:33:29 -04:00
|
|
|
}
|
2021-07-06 07:26:25 -04:00
|
|
|
|
2021-07-10 12:40:43 -04:00
|
|
|
------------------
|
|
|
|
-- Highlighting --
|
|
|
|
------------------
|
2021-07-07 04:08:00 -04:00
|
|
|
use {
|
|
|
|
'lewis6991/gitsigns.nvim',
|
2021-07-08 18:26:52 -04:00
|
|
|
event = {'BufRead', 'BufNewFile'},
|
2021-07-11 21:20:58 -04:00
|
|
|
wants = 'plenary.nvim',
|
|
|
|
requires = {{'nvim-lua/plenary.nvim', opt = true}},
|
2021-07-07 04:08:00 -04:00
|
|
|
config = function()
|
|
|
|
require('modules.gitgutter')
|
|
|
|
end
|
|
|
|
}
|
2021-07-07 15:33:29 -04:00
|
|
|
use {
|
|
|
|
'norcalli/nvim-colorizer.lua',
|
2021-07-10 12:40:43 -04:00
|
|
|
cmd = 'ColorizerToggle',
|
2021-07-07 15:33:29 -04:00
|
|
|
config = function()
|
|
|
|
require('modules.colorizer')
|
|
|
|
end
|
|
|
|
}
|
2021-07-10 12:40:43 -04:00
|
|
|
use {
|
|
|
|
'RRethy/vim-illuminate',
|
|
|
|
event = {'BufRead', 'BufNewFile'}
|
|
|
|
}
|
2021-07-08 16:08:10 -04:00
|
|
|
use {
|
|
|
|
'lukas-reineke/indent-blankline.nvim',
|
2021-07-08 18:26:52 -04:00
|
|
|
event = 'BufRead',
|
2021-07-08 16:08:10 -04:00
|
|
|
config = function()
|
|
|
|
require('modules.blankline')
|
|
|
|
end
|
|
|
|
}
|
2021-07-07 15:33:29 -04:00
|
|
|
use {
|
|
|
|
'nvim-treesitter/nvim-treesitter',
|
|
|
|
run = ':TSUpdate',
|
|
|
|
event = 'BufRead',
|
|
|
|
config = function()
|
|
|
|
require('modules.treesitter')
|
|
|
|
end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'p00f/nvim-ts-rainbow',
|
|
|
|
after = 'nvim-treesitter',
|
|
|
|
config = function()
|
2021-07-10 12:40:43 -04:00
|
|
|
require('nvim-treesitter.configs').setup {
|
|
|
|
rainbow = {
|
|
|
|
enable = true,
|
|
|
|
extended_mode = false,
|
|
|
|
max_file_lines = 1000
|
|
|
|
}
|
|
|
|
}
|
2021-07-07 15:33:29 -04:00
|
|
|
end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'romgrk/nvim-treesitter-context',
|
|
|
|
after = 'nvim-treesitter'
|
|
|
|
}
|
|
|
|
|
2021-07-10 12:40:43 -04:00
|
|
|
---------
|
|
|
|
-- LSP --
|
|
|
|
---------
|
2021-07-11 21:20:58 -04:00
|
|
|
use {
|
2021-07-10 12:40:43 -04:00
|
|
|
'neovim/nvim-lspconfig',
|
2021-07-11 21:20:58 -04:00
|
|
|
event = 'BufReadPre',
|
|
|
|
config = function()
|
|
|
|
require('modules.lsp')
|
|
|
|
end
|
2021-07-10 12:40:43 -04:00
|
|
|
}
|
2021-07-14 09:23:24 -04:00
|
|
|
use {
|
|
|
|
'onsails/lspkind-nvim',
|
2021-07-14 19:59:31 -04:00
|
|
|
event = 'InsertEnter',
|
2021-07-14 09:23:24 -04:00
|
|
|
config = function()
|
|
|
|
require('lspkind').init({with_text = false})
|
|
|
|
end
|
|
|
|
}
|
2021-07-14 19:59:31 -04:00
|
|
|
use {
|
|
|
|
'folke/trouble.nvim',
|
|
|
|
event = 'BufRead',
|
|
|
|
config = function()
|
|
|
|
require('modules.lsptrouble')
|
|
|
|
end
|
|
|
|
}
|
2021-07-07 15:33:29 -04:00
|
|
|
use {
|
2021-07-10 12:40:43 -04:00
|
|
|
'hrsh7th/nvim-compe',
|
|
|
|
event = 'InsertEnter',
|
|
|
|
config = function()
|
|
|
|
require('modules.completion')
|
|
|
|
end
|
2021-07-07 15:33:29 -04:00
|
|
|
}
|
|
|
|
use {
|
2021-07-10 12:40:43 -04:00
|
|
|
'L3MON4D3/LuaSnip', -- can't lazy-load (conflicts with autopairs' map_cr)
|
|
|
|
requires = 'rafamadriz/friendly-snippets',
|
|
|
|
config = function()
|
|
|
|
require('modules.snippets')
|
|
|
|
end
|
2021-07-07 15:33:29 -04:00
|
|
|
}
|
|
|
|
|
2021-07-10 12:40:43 -04:00
|
|
|
---------------
|
|
|
|
-- Utilities --
|
|
|
|
---------------
|
|
|
|
use {
|
|
|
|
'nvim-telescope/telescope.nvim',
|
|
|
|
cmd = 'Telescope',
|
2021-07-11 21:20:58 -04:00
|
|
|
wants = {
|
|
|
|
'popup.nvim',
|
|
|
|
'plenary.nvim',
|
|
|
|
'telescope-symbols.nvim',
|
|
|
|
'telescope-project.nvim',
|
|
|
|
'telescope-fzf-native.nvim'
|
|
|
|
},
|
2021-07-10 12:40:43 -04:00
|
|
|
requires = {
|
2021-07-11 21:20:58 -04:00
|
|
|
{'nvim-lua/popup.nvim', opt = true},
|
|
|
|
{'nvim-lua/plenary.nvim', opt = true},
|
|
|
|
{'nvim-telescope/telescope-symbols.nvim', opt = true},
|
|
|
|
{'nvim-telescope/telescope-project.nvim', opt = true},
|
|
|
|
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make', opt = true}
|
2021-07-10 12:40:43 -04:00
|
|
|
},
|
|
|
|
config = function()
|
|
|
|
require('modules.telescope-nvim')
|
|
|
|
end
|
|
|
|
}
|
2021-07-11 21:20:58 -04:00
|
|
|
use { -- TODO: colors + config
|
2021-07-10 12:40:43 -04:00
|
|
|
'pwntester/octo.nvim',
|
|
|
|
cmd = 'Octo',
|
|
|
|
wants = 'telescope.nvim',
|
|
|
|
config = function()
|
|
|
|
require('octo').setup()
|
|
|
|
end
|
|
|
|
}
|
2021-07-13 13:22:07 -04:00
|
|
|
use {
|
2021-07-10 12:40:43 -04:00
|
|
|
'TimUntersberger/neogit',
|
|
|
|
cmd = 'Neogit',
|
2021-07-11 21:20:58 -04:00
|
|
|
wants = {
|
|
|
|
'diffview.nvim',
|
|
|
|
'plenary.nvim'
|
|
|
|
},
|
2021-07-10 12:40:43 -04:00
|
|
|
requires = {
|
2021-07-11 21:20:58 -04:00
|
|
|
{'nvim-lua/plenary.nvim', opt = true},
|
2021-07-13 13:22:07 -04:00
|
|
|
{
|
|
|
|
'sindrets/diffview.nvim',
|
|
|
|
config = function()
|
|
|
|
require('diffview').setup {
|
|
|
|
diff_binaries = true
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
opt = true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
config = function()
|
|
|
|
require('neogit').setup {
|
|
|
|
integrations = {
|
|
|
|
diffview = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
2021-07-10 12:40:43 -04:00
|
|
|
}
|
2021-07-07 15:33:29 -04:00
|
|
|
use {
|
2021-07-10 12:40:43 -04:00
|
|
|
'kristijanhusak/vim-dadbod-ui',
|
|
|
|
cmd = {'DBUIToggle', 'DBUIAddConnection', 'DBUI', 'DBUIFindBuffer', 'DBUIRenameBuffer'},
|
|
|
|
wants = 'vim-dadbod',
|
|
|
|
requires = {{'tpope/vim-dadbod', opt = true}},
|
2021-07-07 15:33:29 -04:00
|
|
|
config = function()
|
2021-07-10 12:40:43 -04:00
|
|
|
require('modules.dadbod')
|
|
|
|
end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'kristijanhusak/vim-dadbod-completion',
|
|
|
|
after = 'vim-dadbod-ui',
|
|
|
|
config = function()
|
|
|
|
vim.g.compe.source.vim_dadbod_completion = true
|
2021-07-07 15:33:29 -04:00
|
|
|
end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'windwp/nvim-autopairs',
|
2021-07-10 12:40:43 -04:00
|
|
|
event = 'InsertCharPre',
|
2021-07-07 15:33:29 -04:00
|
|
|
config = function()
|
|
|
|
require('nvim-autopairs').setup()
|
2021-07-10 12:40:43 -04:00
|
|
|
require('nvim-autopairs.completion.compe').setup({
|
|
|
|
map_cr = true,
|
|
|
|
map_complete = true
|
|
|
|
})
|
|
|
|
end
|
|
|
|
}
|
2021-07-11 21:20:58 -04:00
|
|
|
use {
|
|
|
|
'machakann/vim-sandwich',
|
|
|
|
event = 'BufRead'
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'junegunn/vim-easy-align',
|
|
|
|
keys = 'ga'
|
|
|
|
}
|
2021-07-10 12:40:43 -04:00
|
|
|
use {
|
|
|
|
'terrortylor/nvim-comment',
|
|
|
|
keys = 'gc',
|
|
|
|
config = function()
|
|
|
|
require('nvim_comment').setup({comment_empty = false})
|
|
|
|
end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'windwp/nvim-ts-autotag',
|
2021-07-11 21:20:58 -04:00
|
|
|
ft = {
|
|
|
|
'html',
|
|
|
|
'xml',
|
|
|
|
'javascript',
|
|
|
|
'javascriptreact',
|
|
|
|
'typescript',
|
|
|
|
'typescriptreact',
|
|
|
|
'vue',
|
|
|
|
'svelte',
|
|
|
|
'php'
|
|
|
|
},
|
2021-07-10 12:40:43 -04:00
|
|
|
wants = 'nvim-treesitter',
|
|
|
|
config = function()
|
|
|
|
require('nvim-treesitter.configs').setup {
|
|
|
|
autotag = {
|
|
|
|
enable = true
|
|
|
|
}
|
|
|
|
}
|
2021-07-07 15:33:29 -04:00
|
|
|
end
|
|
|
|
}
|
2021-07-11 21:20:58 -04:00
|
|
|
use {
|
|
|
|
'ahmedkhalf/lsp-rooter.nvim',
|
|
|
|
after = 'nvim-lspconfig'
|
|
|
|
}
|
2021-07-10 12:40:43 -04:00
|
|
|
use {
|
|
|
|
'iamcco/markdown-preview.nvim',
|
|
|
|
run = 'cd app && yarn install',
|
|
|
|
ft = {'markdown', 'pandoc.markdown', 'rmd'},
|
|
|
|
config = function()
|
|
|
|
require('modules.markdown-preview')
|
|
|
|
end
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'turbio/bracey.vim',
|
|
|
|
run = 'npm install --prefix server',
|
|
|
|
cmd = 'Bracey'
|
|
|
|
}
|
|
|
|
use {
|
|
|
|
'akinsho/nvim-toggleterm.lua',
|
|
|
|
cmd = 'ToggleTerm',
|
|
|
|
config = function()
|
|
|
|
require('modules.terminal')
|
|
|
|
end
|
|
|
|
}
|
|
|
|
-- Just for benchmarking
|
|
|
|
use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'}
|
2021-07-14 09:23:24 -04:00
|
|
|
-- File picker, since Telescope file browser doesn't support dotfiles
|
|
|
|
use {
|
|
|
|
'mcchrish/nnn.vim',
|
|
|
|
cmd = 'NnnPicker',
|
|
|
|
config = function()
|
|
|
|
require('modules.picker')
|
|
|
|
end
|
|
|
|
}
|
2021-07-10 12:40:43 -04:00
|
|
|
|
2021-07-14 19:59:31 -04:00
|
|
|
-- TODO: lspsaga, orgmode.nvim, TrueZen/zen-mode, nvim-lint, vim-spectre, nvim-dap, hop.nvim, dial.nvim, asynctasks.nvim
|
2021-07-03 20:19:46 -04:00
|
|
|
end
|
|
|
|
)
|