dotfiles/.config/nvim/lua/blake/plugins.lua

346 lines
12 KiB
Lua
Raw Normal View History

2021-09-03 01:18:44 -07:00
-- Load plugins
-- Bootstrap packer if needed {{
2021-09-03 01:18:44 -07:00
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
2021-09-05 13:47:46 -07:00
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd 'packadd packer.nvim'
2021-09-03 01:18:44 -07:00
end
-- }}
2021-09-03 01:18:44 -07:00
local use = require('packer').use
return require('packer').startup({function()
-- TODO: Find a better way to organize this
-- impatient (needs to go early)
use { -- lewis6991: impatient: Make nvim load faster by caching them
'lewis6991/impatient.nvim',
config = function()
require('impatient')
end,
}
2021-09-03 01:18:44 -07:00
-- Packer
2021-09-15 21:42:31 -07:00
use { -- packer
'wbthomason/packer.nvim',
config = function()
-- Map :PS to :PackerSync
vim.cmd 'command! PS PackerSync'
end
2021-09-03 01:18:44 -07:00
}
-- Colors (decorations)
2021-09-27 19:21:36 -07:00
use { -- treesitter: syntax highlighting and more
2021-09-03 01:18:44 -07:00
'nvim-treesitter/nvim-treesitter', run = ':TSUpdate',
config = function()
require('blake.lsp').treesitter()
2021-09-03 01:18:44 -07:00
end,
}
use { -- onedark theme
2021-09-03 01:18:44 -07:00
'navarasu/onedark.nvim',
config = function()
-- vim.g.onedark_transparent_background = true
vim.cmd [[
au ColorScheme onedark hi TabLine gui=none guibg='#282C34' guifg='#5C6370' " all tabs color
au ColorScheme onedark hi TabLineSel guibg='#282C34' guifg='#B5BBC7' " Highlighted tab color
au ColorScheme onedark hi TabLineFill guibg='#282C34' " tabline portion without tabs (right-hand side)
colorscheme onedark
]]
end
}
use { -- statusline: lualine
'nvim-lualine/lualine.nvim',
requires = {'kyazdani42/nvim-web-devicons', opt = true},
config = function()
require('blake.other').lualine()
end,
}
use { -- tabline
'alvarosevilla95/luatab.nvim',
requires = 'kyazdani42/nvim-web-devicons',
config = function()
-- vim.cmd [[
-- exec('au ColorScheme gruvbox hi TabLine gui=none guibg=' . $color01 . ' guifg=' . $color03)
-- exec('au ColorScheme gruvbox hi TabLineSel guibg=' . $color01 . ' guifg=' . $color06)
-- exec('au ColorScheme gruvbox hi TabLineFill guibg=' . $color01)
-- ]]
require('luatab').setup {}
2021-09-03 01:18:44 -07:00
end
}
use { -- css color tag highlighter (ex: #FFB13B)
'norcalli/nvim-colorizer.lua',
config = function()
vim.cmd 'command! COL ColorizerToggle'
end,
}
2021-09-03 01:18:44 -07:00
-- IDE features
---- LSP (document analysis)
use { -- lsp installer
2021-12-07 15:23:04 -08:00
'williamboman/nvim-lsp-installer',
2021-09-03 01:18:44 -07:00
}
use { -- Default LSP configs
'neovim/nvim-lspconfig',
2021-12-07 15:23:04 -08:00
before = 'williamboman/nvim-lsp-installer',
2021-09-03 01:18:44 -07:00
config = function()
require('blake.lsp').lspconfig()
2021-09-03 01:18:44 -07:00
end
}
use { -- commentstring based on context from treesitter
'JoosepAlviste/nvim-ts-context-commentstring',
requires = 'nvim-treesitter/nvim-treesitter',
config = function()
require'nvim-treesitter.configs'.setup {
context_commentstring = {
enable = true,
enable_autocmd = false,
}
}
end,
}
use { -- compe
'hrsh7th/nvim-cmp',
config = function()
require('blake.lsp').cmp()
end,
requires = { -- (mostly) nvim-cmp sources (not required by cmp, but reqired by my configuration)
'onsails/lspkind-nvim', -- icons for entries of the completion menu
'hrsh7th/cmp-path',
'hrsh7th/cmp-nvim-lua',
'hrsh7th/cmp-nvim-lsp',
2021-11-25 05:16:30 -08:00
'ray-x/cmp-treesitter',
'hrsh7th/cmp-calc',
'f3fora/cmp-spell',
'hrsh7th/cmp-buffer',
2021-11-25 05:16:30 -08:00
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-emoji',
2021-12-07 15:23:04 -08:00
},
2021-09-05 13:47:46 -07:00
}
use { -- function parameter previews
'ray-x/lsp_signature.nvim',
after = 'nvim-lspconfig',
2021-09-03 01:18:44 -07:00
config = function()
require('blake.lsp').signature()
2021-09-03 01:18:44 -07:00
end,
}
2021-12-07 15:23:04 -08:00
use { -- symbols-outline: treesitter-based document outline (:SO)
'simrat39/symbols-outline.nvim',
config = function()
vim.cmd 'command! SO SymbolsOutline'
end,
}
use { -- ALE: Support for lots of linters, etc
'dense-analysis/ale',
ft = {'sh', 'zsh', 'zshrc', 'bashrc', 'bash'},
config = function()
vim.g.ale_disable_lsp = 1
end
}
2021-09-05 13:47:46 -07:00
---- DAP (Debug Adapter Protocol)
use { -- nvim-dap: DAP support
'mfussenegger/nvim-dap',
config = function()
require('blake.dap').nvim_dap()
end
}
use { -- DAP adapter installer
'Pocco81/DAPInstall.nvim',
config = function()
require('blake.dap').dap_install()
end
}
use { -- virtual-text: Print Variable names while debugging
'theHamsta/nvim-dap-virtual-text',
config = function()
2021-11-20 17:09:28 -08:00
require("nvim-dap-virtual-text").setup()
end
}
use { -- a UI for nvim-dap (easy access to info)
'rcarriga/nvim-dap-ui',
config = function()
require('blake.dap').dap_ui()
end,
}
---- Other IDE features
2021-09-03 01:18:44 -07:00
use { -- git integration
'lewis6991/gitsigns.nvim',
requires = {
'nvim-lua/plenary.nvim'
},
2021-09-15 21:42:31 -07:00
config = function()
require('blake.other').gitsigns()
2021-09-15 21:42:31 -07:00
end,
2021-09-03 01:18:44 -07:00
}
-- use { -- file manager
-- 'kyazdani42/nvim-tree.lua',
-- requires = 'kyazdani42/nvim-web-devicons',
-- config = function()
-- require('blake.other').nvimtree()
-- end
-- }
2021-09-03 01:18:44 -07:00
use { -- terminal
'akinsho/toggleterm.nvim',
2021-09-03 01:18:44 -07:00
config = function()
require('blake.other').toggleterm()
2021-09-03 01:18:44 -07:00
end
}
2021-09-05 13:47:46 -07:00
use { -- Smooth Scrolling
'karb94/neoscroll.nvim',
config = function()
require('blake.other').neoscroll()
end,
2021-09-05 13:47:46 -07:00
}
2021-09-07 17:59:31 -07:00
use { -- automatic session management
'rmagatti/auto-session',
config = function()
require('blake.other').autosession()
2021-09-07 17:59:31 -07:00
end
}
2021-09-20 10:09:26 -07:00
use { -- Markdown preview
2021-09-15 21:39:21 -07:00
'ellisonleao/glow.nvim',
ft = { 'md', 'markdown', }
}
2021-12-11 17:57:18 -08:00
use { -- Zen mode (:ZenMode or :ZM)
"folke/zen-mode.nvim",
config = function()
vim.cmd 'command! ZM ZenMode'
require("zen-mode").setup()
end,
}
use { -- dim text outside paragraph or function
'folke/twilight.nvim',
config = function()
vim.cmd 'command! TW Twilight'
require("twilight").setup()
end,
}
use { -- matchup: Use the percent (%) key for more things
'andymass/vim-matchup',
}
-- use { -- lightspeed: Jump around in files quickly
-- 'ggandor/lightspeed.nvim',
-- }
use { -- indentline: Line indent indicators
'Yggdroot/indentLine',
config = function()
vim.cmd [[
let g:indentLine_char = ''
let g:indentLine_conceallevel = 1
2021-12-07 15:23:04 -08:00
let g:indentLine_fileTypeExclude = ['markdown', 'help', 'packer']
autocmd TermOpen * IndentLinesDisable
]]
end
}
use { -- targets.vim: fix ci' and other things to work right
'wellle/targets.vim',
}
2021-09-03 01:18:44 -07:00
-- Conveniences
2021-12-11 17:57:18 -08:00
use { -- Ghost: Web browser integration
2021-11-19 18:18:58 -08:00
'raghur/vim-ghost',
opt = true,
cmd = {'GhostStart', 'GhostInstall', 'GhostStop', 'GhostSync', 'GhostToggleSync',},
2021-11-19 18:18:58 -08:00
}
2021-09-03 01:18:44 -07:00
use { -- Undo tree
'mbbill/undotree',
config = function()
vim.cmd 'nnoremap <F5> <cmd>UndotreeToggle<CR>'
vim.api.nvim_set_keymap('n', '<F5>', '<cmd>UndotreeToggle<CR>', { noremap = true, silent = true, })
end
2021-09-03 01:18:44 -07:00
}
-- use { -- Dim inactive window
-- 'sunjon/shade.nvim',
-- config = function()
-- require'shade'.setup({
-- overlay_opacity = 50,
-- opacity_step = 1,
-- keys = {
-- brightness_up = '<C-Up>',
-- brightness_down = '<C-Down>',
-- toggle = '<Leader>s',
-- }
-- })
-- end
-- }
2021-11-16 23:26:02 -08:00
use { -- Quote pairing
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup()
end
}
2021-09-03 01:18:44 -07:00
use { -- Alignment
'junegunn/vim-easy-align',
}
use { -- cheat.sh integration
'dbeniamine/cheat.sh-vim',
}
-- use { -- Comments (gb and gc)
-- 'numToStr/Comment.nvim',
-- config = function()
-- require('Comment').setup {
-- pre_hook = function(ctx)
-- local U = require 'Comment.utils'
--
-- local location = nil
-- if ctx.ctype == U.ctype.block then
-- location = require('ts_context_commentstring.utils').get_cursor_location()
-- elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
-- location = require('ts_context_commentstring.utils').get_visual_start_location()
-- end
--
-- return require('ts_context_commentstring.internal').calculate_commentstring {
-- key = ctx.ctype == U.ctype.line and '__default' or '__multiline',
-- location = location,
-- }
-- end,
-- }
-- end
-- }
2021-12-07 15:23:04 -08:00
-- use { -- lewis6991: spellsitter: Spell checking in treesitter files
-- 'lewis6991/spellsitter.nvim',
-- config = function()
-- require('spellsitter').setup()
-- end,
-- }
use { -- lewis6991: spaceless: Strip trailing whitespace as you are editing
'lewis6991/spaceless.nvim',
config = function()
require'spaceless'.setup()
end,
}
use { -- lewis6991: foldsigns: Signs on folded lines
'lewis6991/foldsigns.nvim',
config = function()
require('foldsigns').setup()
end,
}
use { -- tpope: commentary
'tpope/vim-commentary',
}
use { -- tpope: surround
'tpope/vim-surround'
2021-09-03 01:18:44 -07:00
}
use { -- tpope: git integration
2021-09-03 01:18:44 -07:00
'tpope/vim-fugitive'
}
use { -- tpope: Repeatability for various tpope plugins
2021-09-03 01:18:44 -07:00
'tpope/vim-repeat',
}
2021-10-20 10:57:24 -07:00
-- Bootstrap packer if needed {
if (packer_bootstrap) then
2021-10-20 10:57:24 -07:00
require('packer').sync()
end -- }
end,
config = {
display = { open_fn = require('packer.util').float },
-- Move to lua dir so impatient.nvim can cache it
compile_path = vim.fn.stdpath('config')..'/lua/packer_compiled.lua',
}})
2021-09-03 01:18:44 -07:00
-- vim:fdm=marker:fmr={,}:fdl=1:expandtab:tabstop=3:sw=3