LunarVim/lua/plugins.lua

252 lines
7.2 KiB
Lua
Raw Normal View History

2021-03-14 20:10:28 +01:00
local execute = vim.api.nvim_command
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
2021-03-14 20:10:28 +01:00
if fn.empty(fn.glob(install_path)) > 0 then
2021-06-27 21:31:33 +02:00
execute("!git clone https://github.com/wbthomason/packer.nvim " ..
install_path)
execute "packadd packer.nvim"
2021-03-14 20:10:28 +01:00
end
2021-06-28 07:46:25 +02:00
vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
-- vim.cmd "autocmd BufWritePost lv-config.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
return require("packer").startup(function(use)
-- Packer can manage itself as an optional plugin
use "wbthomason/packer.nvim"
-- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
2021-06-28 06:36:29 +02:00
use {"neovim/nvim-lspconfig"}
2021-06-28 17:58:30 +02:00
use {"glepnir/lspsaga.nvim", event = "BufRead"}
use {"kabouzeid/nvim-lspinstall", event = "BufRead"}
-- Telescope
2021-06-28 06:36:29 +02:00
use {"nvim-lua/popup.nvim"}
use {"nvim-lua/plenary.nvim"}
use {"nvim-telescope/telescope.nvim"}
-- Autocomplete
2021-06-28 04:11:33 +02:00
use {
"hrsh7th/nvim-compe",
2021-06-28 09:26:45 +02:00
event = "InsertEnter",
2021-06-28 04:11:33 +02:00
config = function()
require("lv-compe").config()
2021-06-28 17:58:30 +02:00
end
2021-06-28 04:11:33 +02:00
}
2021-06-28 09:26:45 +02:00
use {"hrsh7th/vim-vsnip", event = "InsertCharPre"}
use {"rafamadriz/friendly-snippets", event = "InsertEnter"}
-- Treesitter
2021-06-28 06:36:29 +02:00
use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}
2021-06-28 04:11:33 +02:00
use {
"kyazdani42/nvim-tree.lua",
2021-06-28 06:04:29 +02:00
cmd = "NvimTreeToggle",
2021-06-28 04:11:33 +02:00
config = function()
require("lv-nvimtree").config()
2021-06-28 06:04:29 +02:00
end
2021-06-28 04:11:33 +02:00
}
-- use {'lukas-reineke/indent-blankline.nvim', opt=true, branch = 'lua'}
2021-06-28 06:04:29 +02:00
use {
"lewis6991/gitsigns.nvim",
2021-06-28 04:11:33 +02:00
2021-06-28 06:04:29 +02:00
config = function()
require("lv-gitsigns").config()
end,
2021-06-28 06:11:10 +02:00
event = "BufRead"
2021-06-28 04:11:33 +02:00
}
2021-06-28 18:45:45 +02:00
-- whichkey
use {
"folke/which-key.nvim",
config = function()
require('lv-which-key').config()
end,
event = "BufRead"
}
-- Autopairs
2021-06-28 06:36:29 +02:00
use {"windwp/nvim-autopairs"}
-- Comments
2021-06-27 21:31:33 +02:00
use {
"terrortylor/nvim-comment",
2021-06-27 21:40:45 +02:00
cmd = "CommentToggle",
2021-06-28 04:11:33 +02:00
config = function()
require('nvim_comment').setup()
2021-06-28 06:04:29 +02:00
end
2021-06-27 21:31:33 +02:00
}
-- Color
2021-06-28 04:11:33 +02:00
use {"christianchiarulli/nvcode-color-schemes.vim", opt = true}
-- Icons
2021-06-28 06:36:29 +02:00
use {"kyazdani42/nvim-web-devicons"}
-- Status Line and Bufferline
2021-06-28 06:36:29 +02:00
use {"glepnir/galaxyline.nvim"}
2021-06-28 04:11:33 +02:00
2021-06-28 06:04:29 +02:00
use {
"romgrk/barbar.nvim",
2021-06-28 04:11:33 +02:00
config = function()
2021-06-28 06:04:29 +02:00
vim.api.nvim_set_keymap('n', '<TAB>', ':BufferNext<CR>',
{noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<S-TAB>', ':BufferPrevious<CR>',
{noremap = true, silent = true})
vim.api.nvim_set_keymap('n', '<S-x>', ':BufferClose<CR>',
{noremap = true, silent = true})
2021-06-28 18:45:45 +02:00
end,
event = "BufRead"
2021-06-28 04:11:33 +02:00
2021-06-27 21:31:33 +02:00
}
2021-06-27 08:37:38 +02:00
2021-06-28 18:45:45 +02:00
-- Extras, these do not load by default
2021-06-28 08:37:33 +02:00
-- Better motions
2021-06-28 07:46:25 +02:00
use {
'phaazon/hop.nvim',
2021-06-28 08:37:33 +02:00
event = 'BufRead',
2021-06-28 07:46:25 +02:00
config = function()
require('lv-hop').config()
end,
2021-06-28 08:37:33 +02:00
disable = not O.plugin.hop.active,
2021-06-28 07:46:25 +02:00
opt = true
}
2021-06-28 08:37:33 +02:00
-- Enhanced increment/decrement
use {
'monaqa/dial.nvim',
event = 'BufRead',
config = function()
require('lv-dial').config()
end,
disable = not O.plugin.dial.active,
opt = true
}
-- Dashboard
use {
"ChristianChiarulli/dashboard-nvim",
event = 'BufWinEnter',
cmd = {"Dashboard", "DashboardNewFile", "DashboardJumpMarks"},
config = function()
require('lv-dashboard').config()
end,
disable = not O.plugin.dashboard.active,
opt = true
}
2021-06-28 09:26:45 +02:00
2021-06-28 18:45:45 +02:00
-- Zen Mode TODO this don't work with whichkey might gave to make this built in, may have to replace with folke zen
2021-06-28 09:04:28 +02:00
use {
"Pocco81/TrueZen.nvim",
2021-06-28 09:26:45 +02:00
-- event = 'BufEnter',
cmd = {"TZAtaraxis"},
2021-06-28 09:04:28 +02:00
config = function()
require('lv-zen').config()
2021-06-28 09:26:45 +02:00
end
-- event = "BufEnter"
2021-06-28 09:04:28 +02:00
-- disable = not O.plugin.zen.active,
}
-- matchup
2021-06-28 09:26:45 +02:00
use {
'andymass/vim-matchup',
2021-06-28 09:04:28 +02:00
event = "CursorMoved",
config = function()
require('lv-matchup').config()
end,
disable = not O.plugin.matchup.active,
opt = true
}
2021-06-28 08:37:33 +02:00
2021-06-28 18:45:45 +02:00
use {
"norcalli/nvim-colorizer.lua",
event = "BufRead",
config = function()
require("colorizer").setup()
vim.cmd("ColorizerReloadAllBuffers")
end,
disable = not O.plugin.colorizer.active
}
use {
"nacro90/numb.nvim",
event = "BufRead",
config = function()
require('numb').setup {
show_numbers = true, -- Enable 'number' for the window while peeking
show_cursorline = true -- Enable 'cursorline' for the window while peeking
}
end,
disable = not O.plugin.numb.active
}
2021-06-28 08:37:33 +02:00
-- -- Treesitter playground
-- use {'nvim-treesitter/playground', opt = true}
-- -- Latex
-- use {"lervag/vimtex", opt = true}
-- -- comments in context
-- use {'JoosepAlviste/nvim-ts-context-commentstring', opt = true}
-- -- Git extras
-- use {'f-person/git-blame.nvim', opt = true}
-- -- diagnostics
-- use {"folke/trouble.nvim", opt = true}
-- -- Debugging
-- use {"mfussenegger/nvim-dap", opt = true}
-- -- Better quickfix
-- use {"kevinhwang91/nvim-bqf", opt = true}
-- -- Search & Replace
-- use {'windwp/nvim-spectre', opt = true}
-- -- Symbol Outline
-- use {'simrat39/symbols-outline.nvim', opt = true}
-- -- Interactive scratchpad
-- use {'metakirby5/codi.vim', opt = true}
-- -- Markdown preview
-- use {
-- 'iamcco/markdown-preview.nvim',
-- run = 'cd app && npm install',
-- opt = true
-- }
-- -- Floating terminal
-- use {'numToStr/FTerm.nvim', opt = true}
-- -- Sane gx for netrw_gx bug
-- use {"felipec/vim-sanegx", opt = true}
-- lsp root
-- use {"ahmedkhalf/lsp-rooter.nvim", opt = true} -- with this nvim-tree will follow you
2021-06-27 19:46:25 +02:00
-- Extras
if O.extras then
-- HTML preview
2021-06-27 21:31:33 +02:00
use {
'turbio/bracey.vim',
run = 'npm install --prefix server',
opt = true
}
2021-06-28 08:37:33 +02:00
use {"nvim-telescope/telescope-fzy-native.nvim", opt = true}
use {"nvim-telescope/telescope-project.nvim", opt = true}
-- Autotag
-- use {"windwp/nvim-ts-autotag", opt = true}
-- require_plugin("nvim-ts-autotag")
-- folke/todo-comments.nvim
-- gennaro-tedesco/nvim-jqx
-- TimUntersberger/neogit
-- folke/lsp-colors.nvim
-- simrat39/symbols-outline.nvim
-- Git
-- use {'tpope/vim-fugitive', opt = true}
-- use {'tpope/vim-rhubarb', opt = true}
-- pwntester/octo.nvim
-- Easily Create Gists
-- use {'mattn/vim-gist', opt = true}
-- use {'mattn/webapi-vim', opt = true}
end
end)