FollieHiyuki-dotfiles/home/.config/nvim/lua/plugins.lua
2021-10-17 21:48:03 +07:00

248 lines
7.3 KiB
Lua

local fn,api = vim.fn,vim.api
local packer_dir = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
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
-- Require since we use 'packer' as opt
vim.cmd [[packadd packer.nvim]]
return require('packer').startup(
function()
use {'wbthomason/packer.nvim', opt = true}
-----------------
-- UI elements --
-----------------
use {
'glepnir/dashboard-nvim',
cmd = {
'Dashboard',
'DashboardNewFile',
'DashboardFindFile',
'DashboardFindHistory',
'DashboardFindWord',
'DashboardJumpMark',
'SessionLoad',
'SessionSave'
},
setup = function()
require('modules.dashboard')
end
}
use {
'glepnir/galaxyline.nvim',
branch = 'main',
requires = 'kyazdani42/nvim-web-devicons',
config = function()
require('modules.statusline')
end
}
use {
'akinsho/nvim-bufferline.lua',
config = function()
require('modules.bufferline')
end
}
use {
'kyazdani42/nvim-tree.lua',
cmd = 'NvimTreeToggle',
setup = function()
require('modules.nvimtree')
end
}
use {
'folke/which-key.nvim',
config = function()
require('modules.whichkey')
end
}
------------------
-- Highlighting --
------------------
use {
'lewis6991/gitsigns.nvim',
event = {'BufRead', 'BufNewFile'},
requires = 'nvim-lua/plenary.nvim',
config = function()
require('modules.gitgutter')
end
}
use {
'norcalli/nvim-colorizer.lua',
cmd = 'ColorizerToggle',
config = function()
require('modules.colorizer')
end
}
use {
'RRethy/vim-illuminate',
event = {'BufRead', 'BufNewFile'}
}
use {
'lukas-reineke/indent-blankline.nvim',
event = 'BufRead',
config = function()
require('modules.blankline')
end
}
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()
require('nvim-treesitter.configs').setup {
rainbow = {
enable = true,
extended_mode = false,
max_file_lines = 1000
}
}
end
}
use {
'romgrk/nvim-treesitter-context',
after = 'nvim-treesitter'
}
---------
-- LSP --
---------
use { -- TODO: config + colors
'neovim/nvim-lspconfig',
event = 'BufReadPre'
}
use { -- TODO: lua, python, clang
'kabouzeid/nvim-lspinstall'
}
use {
'hrsh7th/nvim-compe',
event = 'InsertEnter',
config = function()
require('modules.completion')
end
}
use {
'L3MON4D3/LuaSnip', -- can't lazy-load (conflicts with autopairs' map_cr)
requires = 'rafamadriz/friendly-snippets',
config = function()
require('modules.snippets')
end
}
---------------
-- Utilities --
---------------
use {
'nvim-telescope/telescope.nvim',
cmd = 'Telescope',
requires = {
'nvim-lua/popup.nvim',
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope-symbols.nvim',
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make'}
},
config = function()
require('modules.telescope-nvim')
end
}
use { -- TODO: colors + config + custom telescope menu
'pwntester/octo.nvim',
cmd = 'Octo',
wants = 'telescope.nvim',
config = function()
require('octo').setup()
end
}
use { -- TODO: config + colors
'TimUntersberger/neogit',
cmd = 'Neogit',
requires = {
-- 'sindrets/diffview.nvim',
'nvim-lua/plenary.nvim'
}
}
use {
'kristijanhusak/vim-dadbod-ui',
cmd = {'DBUIToggle', 'DBUIAddConnection', 'DBUI', 'DBUIFindBuffer', 'DBUIRenameBuffer'},
wants = 'vim-dadbod',
requires = {{'tpope/vim-dadbod', opt = true}},
config = function()
require('modules.dadbod')
end
}
use {
'kristijanhusak/vim-dadbod-completion',
after = 'vim-dadbod-ui',
config = function()
vim.g.compe.source.vim_dadbod_completion = true
end
}
use {
'windwp/nvim-autopairs',
event = 'InsertCharPre',
config = function()
require('nvim-autopairs').setup()
require('nvim-autopairs.completion.compe').setup({
map_cr = true,
map_complete = true
})
end
}
use {
'terrortylor/nvim-comment',
keys = 'gc',
config = function()
require('nvim_comment').setup({comment_empty = false})
end
}
use {
'windwp/nvim-ts-autotag',
ft = {'html', 'xml', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'vue', 'svelte', 'php'},
wants = 'nvim-treesitter',
config = function()
require('nvim-treesitter.configs').setup {
autotag = {
enable = true
}
}
end
}
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'}
-- TODO: trouble.nvim, lspsaga, orgmode.nvim, lspkind, TrueZen/zen-mode, nvim-lint, vim-spectre, nvim-dap, lsp-rooter, hop.nvim, dial.nvim
end
)