Dot_Files/.config/nvim/lua/plugins/plugins.lua

771 lines
22 KiB
Lua
Raw Normal View History

2022-01-12 21:36:47 -06:00
local fn = vim.fn
2022-01-15 22:07:21 -06:00
-- Packer strap, install packer automatically and configure plugins
-- See the end of this file for how the variable `packer_strap` gets used
2022-05-06 16:52:44 -05:00
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
2022-01-12 21:36:47 -06:00
if fn.empty(fn.glob(install_path)) > 0 then
2022-05-06 16:52:44 -05:00
PACKER_STRAP = fn.system({
'git',
'clone',
'--depth',
'1',
'https://github.com/wbthomason/packer.nvim',
install_path,
})
-- Update the runtime so packer can be used
vim.o.runtimepath = vim.fn.stdpath('data') .. '/site/pack/*/start/*,' .. vim.o.runtimepath
2022-01-12 21:36:47 -06:00
end
local packer = require('packer')
2022-03-18 05:25:16 -05:00
packer.init({
2022-05-08 00:19:31 -05:00
max_jobs = 20,
2022-03-18 05:25:16 -05:00
})
return packer.startup({
2022-05-06 16:52:44 -05:00
function(use)
-- Performance boost on startup
-- keep at top of plugins
use({ 'lewis6991/impatient.nvim' })
-- Packer Itself
use({ 'wbthomason/packer.nvim' })
-- Commonly used library
use({
'nvim-lua/plenary.nvim',
})
-- Nvim Notify
use({
'rcarriga/nvim-notify',
config = function()
require('plugins.configs.nvim-notify')
end,
})
-- Color schemes
use({ 'folke/tokyonight.nvim' })
use({
'EdenEast/nightfox.nvim',
config = function()
require('nightfox').setup({
options = {
transparent = true,
dim_inactive = true,
},
})
end,
})
2022-05-11 21:22:25 -05:00
use({
'rebelot/kanagawa.nvim',
2022-05-15 22:29:18 -05:00
config = function()
2022-05-11 21:22:25 -05:00
require('kanagawa').setup({
2022-05-15 22:29:18 -05:00
transparent = true,
2022-05-11 21:22:25 -05:00
})
2022-05-15 22:29:18 -05:00
end,
2022-05-11 21:22:25 -05:00
})
2022-05-06 16:52:44 -05:00
-- Icons for folders, files, etc.
use({
'kyazdani42/nvim-web-devicons',
event = 'BufEnter',
})
-- Tab Line at top of editor
use({
'akinsho/nvim-bufferline.lua',
after = 'nvim-web-devicons',
requires = { 'nvim-web-devicons' },
config = function()
require('plugins.configs.bufferline')
end,
})
-- Statusline.
use({
'nvim-lualine/lualine.nvim',
after = {
'nvim-bufferline.lua',
'tokyonight.nvim',
},
2022-05-06 16:52:44 -05:00
config = function()
require('plugins.configs.statusline')
2022-05-06 16:52:44 -05:00
end,
})
-- Indentation Guides
use({
'lukas-reineke/indent-blankline.nvim',
event = 'BufEnter',
config = function()
require('plugins.configs.indent-blankline')
end,
})
-- Treesitter
use({
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate',
config = function()
require('plugins.configs.treesitter')
end,
})
2022-05-09 17:36:56 -05:00
use({
'nvim-treesitter/nvim-treesitter-textobjects',
after = 'nvim-treesitter',
config = function()
require('nvim-treesitter.configs').setup({
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
['ib'] = '@block.inner',
2022-05-11 21:00:57 -05:00
['ab'] = '@block.outer',
2022-05-09 17:36:56 -05:00
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
[']fs'] = '@function.outer',
[']cs'] = '@class.outer',
[']bs'] = '@block.outer',
},
goto_next_end = {
[']fe'] = '@function.outer',
[']ce'] = '@class.outer',
[']be'] = '@block.outer',
},
goto_previous_start = {
['[fs'] = '@function.outer',
['[cs'] = '@class.outer',
['[bs'] = '@block.outer',
},
goto_previous_end = {
['[fe'] = '@function.outer',
['[ce'] = '@class.outer',
['[bs'] = '@block.outer',
},
},
},
})
end,
})
2022-05-06 16:52:44 -05:00
-- Better treesitter indentations
-- NOTE: Remove this once treesitter gets up to par
-- NOTE: this is just a placeholder until it is.
use({
'yioneko/nvim-yati',
requires = 'nvim-treesitter/nvim-treesitter',
})
-- Highlight given color codes
use({
'norcalli/nvim-colorizer.lua',
event = 'BufEnter',
config = function()
require('plugins.configs.nvim-colorizer')
end,
})
-- Dashboard when no file is given to nvim
2022-05-06 16:52:44 -05:00
use({
'goolord/alpha-nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
config = function()
require('plugins.configs.alpha')
2022-05-06 16:52:44 -05:00
end,
})
-- Telescope Extensions
use({
'nvim-telescope/telescope-fzf-native.nvim',
run = 'make',
})
use({
'nvim-telescope/telescope-media-files.nvim',
'nvim-telescope/telescope-file-browser.nvim',
'artart222/telescope_find_directories',
2022-05-27 21:54:19 -05:00
'nvim-telescope/telescope-ui-select.nvim',
2022-06-27 14:24:15 -05:00
{ 'nvim-telescope/telescope-smart-history.nvim', requires = 'tami5/sqlite.lua' },
2022-05-06 16:52:44 -05:00
})
-- Telescope
use({
'nvim-telescope/telescope.nvim',
config = function()
require('plugins.configs.telescope-nvim')
end,
})
-- File Tree
use({
'nvim-neo-tree/neo-tree.nvim',
branch = 'v2.x',
requires = {
'kyazdani42/nvim-web-devicons',
'nvim-lua/plenary.nvim',
'MunifTanjim/nui.nvim',
},
config = function()
require('plugins.configs.neotree')
end,
})
2022-06-03 22:52:38 -05:00
-- Workspaces
use({
'natecraddock/workspaces.nvim',
2022-06-10 20:20:17 -05:00
config = function()
local workspaces = require('workspaces')
2022-06-03 22:52:38 -05:00
workspaces.setup({
hooks = {
2022-06-10 20:20:17 -05:00
open = 'Neotree',
},
2022-06-03 22:52:38 -05:00
})
2022-06-10 20:20:17 -05:00
end,
2022-06-03 22:52:38 -05:00
})
2022-05-06 16:52:44 -05:00
-- LSP, LSP Installer
use({
'neovim/nvim-lspconfig',
config = function()
require('plugins.configs.lspconfig')
end,
2022-05-06 20:44:22 -05:00
requires = {
'folke/lua-dev.nvim',
2022-06-01 23:35:11 -05:00
'Decodetalkers/csharpls-extended-lsp.nvim',
2022-05-06 20:44:22 -05:00
},
2022-05-06 16:52:44 -05:00
})
use({
'williamboman/nvim-lsp-installer',
after = 'nvim-lspconfig',
config = function()
require('plugins.configs.lsp')
end,
})
2022-06-30 16:49:53 -05:00
-- Show lsp diags at bottom
use({
'folke/trouble.nvim',
config = function()
require('trouble').setup()
end,
cmd = {
'Trouble',
'TroubleClose',
'TroubleToggle',
'TroubleRefresh',
},
})
2022-05-15 22:29:18 -05:00
-- Sql support
use({
'nanotee/sqls.nvim',
})
2022-05-06 16:52:44 -05:00
-- Lsp Vertical Lines
use({
'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
after = 'nvim-lspconfig',
config = function()
require('lsp_lines').register_lsp_virtual_lines()
end,
})
2022-05-27 20:25:54 -05:00
2022-05-06 16:52:44 -05:00
-- Display LSP Progress
use({
'j-hui/fidget.nvim',
config = function()
require('plugins.configs.fidget-spinner')
end,
-- after = "nvim-lspconfig"
})
-- Display Lsp Signature
use({
'ray-x/lsp_signature.nvim',
config = function()
require('lsp_signature').setup({
hint_prefix = '',
hint_enable = true,
floating_window = false,
toggle_key = '<M-x>',
})
end,
})
-- Code Action Menu, prettier ui for LSP code actions
require('packer').use({
2022-05-15 22:29:18 -05:00
'weilbith/nvim-code-action-menu',
2022-05-06 16:52:44 -05:00
})
-- Lsp From Null LS
use({
'jose-elias-alvarez/null-ls.nvim',
config = function()
require('plugins.configs.null_ls')
end,
})
-- Better LSP Handling for Rust
use({
'simrat39/rust-tools.nvim',
})
-- Autopairs
use({
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup()
end,
})
-- Snippets
use({
'rafamadriz/friendly-snippets',
config = function()
2022-05-19 16:55:27 -05:00
require('luasnip.loaders.from_vscode').lazy_load()
2022-05-06 16:52:44 -05:00
end,
requires = {
'L3MON4D3/LuaSnip',
'https://github.com/saadparwaiz1/cmp_luasnip',
},
after = 'LuaSnip',
2022-05-19 16:55:27 -05:00
event = 'BufEnter',
2022-05-06 16:52:44 -05:00
})
-- Code completion
use({
'hrsh7th/nvim-cmp',
requires = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-emoji',
'hrsh7th/vim-vsnip',
'hrsh7th/cmp-nvim-lsp-document-symbol',
'hrsh7th/cmp-calc',
'davidsierradz/cmp-conventionalcommits',
'tamago324/cmp-zsh',
'dmitmel/cmp-cmdline-history',
'David-Kunz/cmp-npm',
'lukas-reineke/cmp-rg',
},
2022-05-06 16:52:44 -05:00
config = function()
require('plugins.configs._cmp')
end,
})
use({
'tzachar/cmp-fuzzy-buffer',
requires = { 'hrsh7th/nvim-cmp', 'tzachar/fuzzy.nvim' },
})
use({ 'tzachar/cmp-fuzzy-path', requires = { 'hrsh7th/nvim-cmp', 'tzachar/fuzzy.nvim' } })
2022-05-06 16:52:44 -05:00
use({
'saecki/crates.nvim',
event = { 'BufRead Cargo.toml' },
requires = { { 'nvim-lua/plenary.nvim' } },
config = function()
require('crates').setup()
end,
})
-- Show code outline
use({
'simrat39/symbols-outline.nvim',
cmd = { 'SymbolsOutline', 'SymbolsOutlineOpen', 'SymbolsOutlineClose' },
config = function()
-- TODO: Clean this up and use the `nvim.api.nvim_set_hl` api
vim.cmd(
2022-05-08 22:10:24 -05:00
[[hi FocusedSymbol term=italic,bold cterm=italic ctermbg=yellow ctermfg=darkblue gui=bold,italic guibg=none guifg=#59D0FF]]
2022-05-06 16:52:44 -05:00
)
end,
})
-- DAP, debugger
use({
'mfussenegger/nvim-dap',
config = function()
require('dap.ext.vscode').load_launchjs()
require('plugins.configs._dap')
end,
2022-06-16 12:16:57 -05:00
after = 'nvim-notify',
2022-05-06 16:52:44 -05:00
})
-- Python debugger, dapinstall does not play nice with debugpy
use({
'mfussenegger/nvim-dap-python',
after = 'nvim-dap',
config = function()
require('plugins.configs.python-dap')
end,
})
-- Virtual Text for DAP
use({
'theHamsta/nvim-dap-virtual-text',
after = 'nvim-dap',
config = function()
require('nvim-dap-virtual-text').setup({})
end,
})
-- Fancy ui for dap
use({
'rcarriga/nvim-dap-ui',
after = 'nvim-dap',
config = function()
require('plugins.configs.dap-ui')
end,
})
-- Code formatting
use({
'sbdchd/neoformat',
cmd = 'Neoformat',
config = function()
require('plugins.configs.neoformat')
end,
})
use({
'anuvyklack/pretty-fold.nvim',
requires = 'anuvyklack/nvim-keymap-amend',
config = function()
require('pretty-fold').setup({
fill_char = ' ',
})
require('pretty-fold.preview').setup()
end,
})
-- Stabalize closing buffers
use({
'luukvbaal/stabilize.nvim',
config = function()
require('plugins.configs._stabilize')
end,
})
-- Git signs
use({
'lewis6991/gitsigns.nvim',
event = 'BufRead',
config = function()
2022-06-01 21:29:21 -05:00
require('gitsigns').setup({
current_line_blame = true,
current_line_blame_opts = {
2022-06-01 23:35:11 -05:00
delay = 0,
},
2022-06-01 21:29:21 -05:00
})
2022-05-06 16:52:44 -05:00
end,
})
-- Highlight certain comments, TODO, BUG, etc.
use({
'folke/todo-comments.nvim',
event = 'BufEnter',
config = function()
require('todo-comments').setup({})
end,
})
-- Show possible key bindings during typing
use({
'folke/which-key.nvim',
config = function()
require('which-key').setup({})
2022-05-06 16:52:44 -05:00
end,
})
-- Create full path if not existing on write
use({
'jghauser/mkdir.nvim',
cmd = 'new',
config = function()
require('mkdir')
end,
})
-- Text commenting
use({
'terrortylor/nvim-comment',
cmd = 'CommentToggle',
config = function()
require('nvim_comment').setup()
end,
})
-- Move selections with alt+movement key
use({
'matze/vim-move',
})
-- Register support in telescope with persistent save
use({
'AckslD/nvim-neoclip.lua',
requires = {
{ 'tami5/sqlite.lua', module = 'sqlite' },
{ 'nvim-telescope/telescope.nvim' },
},
config = function()
require('plugins.configs._neoclip')
end,
})
-- Markdown Previewer
use({
'iamcco/markdown-preview.nvim',
run = 'cd app && npm install',
setup = function()
vim.g.mkdp_filetypes = { 'markdown' }
end,
ft = { 'markdown' },
})
2022-06-02 11:36:16 -05:00
-- Better Git integration
2022-05-06 16:52:44 -05:00
use({
2022-06-02 11:36:16 -05:00
'TimUntersberger/neogit',
2022-06-02 11:52:27 -05:00
config = function()
2022-06-02 11:54:02 -05:00
require('neogit').setup({
disable_commit_confirmation = true,
2022-06-02 11:54:02 -05:00
integrations = {
2022-06-02 20:29:48 -05:00
diffview = true,
},
2022-06-02 11:54:02 -05:00
})
2022-06-02 11:52:27 -05:00
end,
requires = {
'sindrets/diffview.nvim',
},
2022-05-06 16:52:44 -05:00
})
-- Ansible Syntax Highlighting
use({
'pearofducks/ansible-vim',
})
-- Better search display
use({
'kevinhwang91/nvim-hlslens',
module = 'hlslens',
keys = '/',
})
-- Lsp Diags on scrollbar
use({
'petertriho/nvim-scrollbar',
requires = {
'kevinhwang91/nvim-hlslens',
'folke/tokyonight.nvim',
},
after = 'nvim-hlslens',
config = function()
require('plugins.configs.diag-scrollbar')
end,
})
-- Discord Rich Presence
use({
'andweeb/presence.nvim',
config = function()
2022-05-19 22:34:14 -05:00
require('presence'):setup({
2022-05-19 22:37:11 -05:00
neovim_image_text = 'How do I exit?',
2022-05-19 22:34:14 -05:00
})
end,
})
2022-05-06 16:52:44 -05:00
-- Note Taking
use({
'nvim-neorg/neorg',
config = function()
require('plugins.configs._neorg')
end,
requires = {
'nvim-lua/plenary.nvim',
'nvim-neorg/neorg-telescope',
},
after = 'nvim-treesitter',
})
-- Log Syntax Highlighting
use({
'MTDL9/vim-log-highlighting',
})
-- Lots of small modules pulled into
-- one git repository
use({
'echasnovski/mini.nvim',
config = function()
-- Underline matching words to word undor cursor
require('mini.cursorword').setup({})
2022-06-21 01:37:16 -05:00
-- Surround operators
require('mini.surround').setup({
mappings = {
add = 'gs',
delete = 'ds',
find = '',
find_left = '',
highlight = '',
replace = 'cs',
update_n_lines = '',
},
})
2022-05-06 16:52:44 -05:00
end,
})
-- Smoother Scrolling
use({
'karb94/neoscroll.nvim',
config = function()
require('neoscroll').setup({
easing_function = 'circular',
})
end,
})
-- Generate function/class/etc annotations
use({
'danymat/neogen',
requires = 'nvim-treesitter/nvim-treesitter',
config = function()
require('neogen').setup({
snippet_engine = 'luasnip',
})
end,
})
-- Center code, make it visually prettier
use({
'folke/zen-mode.nvim',
config = function()
require('zen-mode').setup({})
end,
cmd = 'ZenMode',
})
-- Multiple cursor/multiple visual selection support
use({
'mg979/vim-visual-multi',
})
-- Editorconfig support
use({
'gpanders/editorconfig.nvim',
})
-- Run snippets in-line
use({
'michaelb/sniprun',
run = 'bash ./install.sh',
})
-- Maintain last cursor position in files
use({
'ethanholz/nvim-lastplace',
config = function()
require('nvim-lastplace').setup({
lastplace_ignore_buftype = { 'quickfix', 'nofile', 'help' },
lastplace_ignore_filetype = { 'gitcommit', 'gitrebase', 'svn', 'hgcommit', 'fugitive' },
lastplace_open_folds = true,
})
end,
})
2022-05-27 21:54:19 -05:00
-- Diagnose startup time
2022-05-19 16:55:27 -05:00
use({ 'dstein64/vim-startuptime' })
2022-05-27 21:54:19 -05:00
-- More codeactions
2022-05-26 16:25:34 -05:00
use({
'ThePrimeagen/refactoring.nvim',
requires = {
{ 'nvim-lua/plenary.nvim' },
{ 'nvim-treesitter/nvim-treesitter' },
},
})
2022-05-27 21:54:19 -05:00
2022-06-10 20:20:17 -05:00
-- Http Request Support
use({
'NTBBloodbath/rest.nvim',
requires = {
'https://github.com/nvim-lua/plenary.nvim',
},
config = function()
local rest_nvim = require('rest-nvim')
rest_nvim.setup({
-- This is a dev plugin, makes life easier
skip_ssl_verification = true,
})
end,
})
2022-06-22 10:33:22 -05:00
-- Undotree, similar to git branch history
use({
'mbbill/undotree',
cmd = 'UndotreeToggle',
setup = function()
vim.g.undotree_WindowLayout = 3
end,
2022-06-22 10:33:22 -05:00
})
2022-06-30 16:49:53 -05:00
-- Allows repeating actions and more
2022-06-30 11:24:26 -05:00
use({
'anuvyklack/hydra.nvim',
2022-06-30 11:29:28 -05:00
requires = {
'anuvyklack/keymap-layer.nvim',
},
2022-06-30 11:24:26 -05:00
config = function()
require('plugins.configs.hydra')
end,
})
2022-06-30 16:49:53 -05:00
2022-05-06 16:52:44 -05:00
-- Leave at end!!!
-- Install and deploy packer plugins
-- automatically
if PACKER_STRAP then
vim.notify('Syncing packer from bootstrap')
function _G.NotifyRestartNeeded()
local notify_available, _ = require('notify')
local message = 'Neovim Restart Required to Finish Installation!'
if notify_available then
vim.notify(message, vim.lsp.log_levels.WARN, {
title = 'Packer Strap',
keep = function()
return true
end,
})
else
vim.notify(message)
end
end
vim.api.nvim_exec(
[[
autocmd User PackerCompileDone lua NotifyRestartNeeded()
]],
false
)
require('packer').sync()
end
end,
config = {
display = {
open_fn = function()
return require('packer.util').float({ border = 'double' })
end,
},
compile_path = vim.fn.stdpath('config') .. '/lua/packer_compiled.lua',
},
2022-01-10 09:55:15 -06:00
})