2021-09-16 13:32:29 -07:00
-- Install packer
2022-01-06 21:14:18 -08:00
local utils = require ( " utils " )
2021-12-15 09:37:51 -08:00
local install_path = vim.fn . stdpath ( " data " ) .. " /site/pack/packer/opt/packer.nvim "
2022-10-25 09:42:59 -07:00
local packer_bootstrap = " "
2021-08-24 10:38:14 -07:00
if vim.fn . empty ( vim.fn . glob ( install_path ) ) > 0 then
2021-12-15 09:37:51 -08:00
packer_bootstrap = vim.fn . system ( { " git " , " clone " , " https://github.com/wbthomason/packer.nvim " , install_path } )
2021-08-24 10:38:14 -07:00
end
2021-12-15 09:37:51 -08:00
vim.cmd ( " packadd packer.nvim " )
2021-08-24 10:38:14 -07:00
2022-02-25 11:03:05 -08:00
local packer = require ( " packer " )
local packer_util = require ( " packer.util " )
local use = packer.use
packer.init ( {
-- Always load default
2023-03-08 14:39:00 -08:00
snapshot = utils.map_version_rule ( {
2023-06-01 17:11:50 -07:00
[ " >=0.9.0 " ] = " latest-0.9 " ,
2023-03-08 14:39:00 -08:00
[ " >=0.8.0 " ] = " latest-0.8 " ,
[ " >=0.7.0 " ] = " latest-0.7 " ,
2023-06-12 09:13:48 -07:00
[ " >=0.6.0 " ] = " latest-0.6 " ,
2023-03-08 14:39:00 -08:00
} ) ,
2022-02-25 11:03:05 -08:00
snapshot_path = packer_util.join_paths ( vim.fn . stdpath ( " config " ) , " packer_snapshots " ) ,
display = {
open_fn = function ( )
return packer_util.float ( { border = " single " } )
end ,
} ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Load things faster!
2023-06-01 17:11:50 -07:00
if vim.fn . has ( " nvim-0.9.0 " ) == 1 then
-- Not needed on nvim 0.9+
vim.loader . enable ( )
else
use ( {
" lewis6991/impatient.nvim " ,
config = [[require('impatient')]] ,
tag = utils.map_version_rule ( {
[ " >=0.7.0 " ] = utils.nil_val ,
[ " >0.6.0 " ] = " v0.2 " ,
[ " >=0.5.0 " ] = " v0.1 " ,
} ) ,
} )
end
2022-02-25 11:03:05 -08:00
-- Let Packer manage and lazyload itself
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/wbthomason/packer.nvim " ,
2022-02-25 11:03:05 -08:00
cmd = {
" PackerClean " ,
" PackerCompile " ,
" PackerInstall " ,
" PackerLoad " ,
" PackerProfile " ,
2022-02-25 11:07:07 -08:00
" PackerSnapshot " ,
" PackerSnapshotDelete " ,
" PackerSnapshotRollback " ,
2022-02-25 11:03:05 -08:00
" PackerStatus " ,
" PackerSync " ,
" PackerUpdate " ,
} ,
config = [[require("plugins")]] ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Colorschemes
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/vim-scripts/wombat256.vim " ,
2022-06-07 09:52:10 -07:00
{
2023-11-10 11:25:03 -08:00
" https://github.com/ViViDboarder/wombat.nvim " ,
2022-06-07 09:52:10 -07:00
requires = {
{
" rktjmp/lush.nvim " ,
tag = utils.map_version_rule ( {
[ " >=0.7.0 " ] = utils.nil_val ,
[ " >=0.5.0 " ] = " v1.0.1 " ,
} ) ,
} ,
} ,
} ,
2023-06-12 09:13:48 -07:00
{
2023-11-10 11:25:03 -08:00
" https://github.com/ViViDboarder/wombuddy.nvim " ,
requires = " https://github.com/tjdevries/colorbuddy.vim " ,
} ,
{
" https://github.com/ishan9299/nvim-solarized-lua " ,
2023-06-12 09:13:48 -07:00
commit = utils.map_version_rule ( {
[ " >=0.7.0 " ] = utils.nil_val ,
[ " <0.7.0 " ] = " faba49b " ,
} ) ,
} ,
2022-02-25 11:03:05 -08:00
{
2023-11-10 11:25:03 -08:00
" https://github.com/folke/tokyonight.nvim " ,
2022-02-25 11:03:05 -08:00
run = ' fish -c \' echo "set --path --prepend fish_themes_path "(pwd)"/extras" > ~/.config/fish/conf.d/tokyonight.fish \' || true ' , -- luacheck: no max line length
} ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Auto and ends to some ifs and dos
2023-11-10 11:25:03 -08:00
use ( " https://github.com/tpope/vim-endwise " )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Unix commands from vim? Yup!
2023-11-10 11:25:03 -08:00
use ( " https://github.com/tpope/vim-eunuch " )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Adds repeats for custom motions
2023-11-10 11:25:03 -08:00
use ( " https://github.com/tpope/vim-repeat " )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Readline shortcuts
2023-11-10 11:25:03 -08:00
use ( " https://github.com/tpope/vim-rsi " )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Surround motions
2023-11-10 11:25:03 -08:00
use ( " https://github.com/tpope/vim-surround " )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Better netrw
2023-11-10 11:25:03 -08:00
use ( " https://github.com/tpope/vim-vinegar " )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Easier jumping to lines
2023-11-10 11:25:03 -08:00
use ( " https://github.com/vim-scripts/file-line " )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Auto ctags generation
2023-11-10 11:25:03 -08:00
use ( " https://github.com/ludovicchabant/vim-gutentags " )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Make it easier to discover some of my keymaps
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/folke/which-key.nvim " ,
2022-02-25 11:03:05 -08:00
config = function ( )
require ( " plugins.whichkey " ) . configure ( )
end ,
2023-06-13 16:07:50 -07:00
tag = " v1.* " ,
2022-02-25 11:03:05 -08:00
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Better commenting
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/tomtom/tcomment_vim " ,
2022-02-25 11:03:05 -08:00
config = function ( )
2023-06-09 12:10:55 -07:00
require ( " utils " ) . keymap_set ( " n " , " // " , " :TComment<CR> " , { desc = " Toggle comment " } )
require ( " utils " ) . keymap_set ( " v " , " // " , " :TCommentBlock<CR> " , { desc = " Toggle comment " } )
2022-02-25 11:03:05 -08:00
end ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Allow wrapping and joining of arguments across multiple lines
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/FooSoft/vim-argwrap " ,
2022-02-25 11:03:05 -08:00
config = function ( )
2023-06-09 12:10:55 -07:00
require ( " utils " ) . keymap_set ( " n " , " <Leader>a " , " <cmd>ArgWrap<CR> " , {
2023-06-07 16:26:46 -07:00
desc = " Wrap or unwrap arguments " ,
} )
2022-02-25 11:03:05 -08:00
end ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Adds git operations to vim
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/tpope/vim-fugitive " ,
2023-09-23 23:10:48 -07:00
tag = utils.map_version_rule ( {
2023-10-20 17:02:52 -07:00
[ " >=0.9.2 " ] = utils.nil_val ,
2023-11-10 11:25:03 -08:00
-- HACK: Pinning to avoid neovim bug https://github.com/neovim/neovim/issues/10121
-- when used in status line.
2023-10-20 17:02:52 -07:00
[ " <0.9.2 " ] = " v3.6 " ,
2023-09-23 23:10:48 -07:00
} ) ,
2022-02-25 11:03:05 -08:00
config = function ( )
2023-06-09 12:10:55 -07:00
require ( " utils " ) . keymap_set ( " n " , " gb " , " <cmd>Git blame<CR> " , { desc = " Git blame " } )
require ( " utils " ) . keymap_set ( " n " , " gc " , " <cmd>Git commit<CR> " , { desc = " Git commit " } )
require ( " utils " ) . keymap_set ( " n " , " gd " , " <cmd>Git diff<CR> " , { desc = " Git diff " } )
require ( " utils " ) . keymap_set ( " n " , " gs " , " <cmd>Git<CR> " , { desc = " Git status " } )
require ( " utils " ) . keymap_set ( " n " , " gw " , " <cmd>Git write<CR> " , { desc = " Git write " } )
2022-02-25 11:03:05 -08:00
end ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Quick toggling of Location and Quickfix lists
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/milkypostman/vim-togglelist " ,
2022-02-25 11:03:05 -08:00
config = function ( )
2023-06-09 12:10:55 -07:00
require ( " utils " ) . keymap_set ( " n " , " <F6> " , " :call ToggleQuickfixList()<CR> " , { desc = " Toggle quickfix " } )
require ( " utils " ) . keymap_set ( " n " , " <F7> " , " :call ToggleLocationList()<CR> " , { desc = " Toggle location list " } )
2022-02-25 11:03:05 -08:00
end ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Find text everywhere!
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/mhinz/vim-grepper " ,
2022-02-25 11:03:05 -08:00
config = function ( )
require ( " plugins.grepper " )
end ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Highlight inline colors
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/norcalli/nvim-colorizer.lua " ,
2022-02-25 11:03:05 -08:00
config = function ( )
require ( " colorizer " ) . setup ( )
end ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Custom status line
2023-06-01 17:11:50 -07:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/SmiteshP/nvim-gps " ,
requires = " https://github.com/nvim-treesitter/nvim-treesitter " ,
2023-06-01 17:11:50 -07:00
disable = vim.fn . has ( " nvim-0.7.0 " ) == 1 ,
} )
-- Replaces gps for 0.7+
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/SmiteshP/nvim-navic " ,
requires = " https://github.com/neovim/nvim-lspconfig " ,
2023-06-01 17:11:50 -07:00
disable = vim.fn . has ( " nvim-0.7.0 " ) ~= 1 ,
} )
2022-02-25 11:03:05 -08:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-lualine/lualine.nvim " ,
2022-02-25 11:03:05 -08:00
config = function ( )
require ( " plugins.lualine " ) . config_lualine ( )
end ,
2023-06-01 17:11:50 -07:00
after = vim.fn . has ( " nvim-0.7.0 " ) == 1 and " nvim-navic " or " nvim-gps " ,
2022-02-25 11:03:05 -08:00
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- On Mac, update colors when dark mode changes
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/cormacrelf/dark-notify " ,
2022-02-25 11:03:05 -08:00
disable = not vim.g . is_mac ,
-- Download latest release on install
run = " curl -s https://api.github.com/repos/cormacrelf/dark-notify/releases/latest | jq '.assets[].browser_download_url' | xargs curl -Ls | tar xz -C ~/.local/bin/ " , -- luacheck: no max line length
2023-11-10 14:54:14 -08:00
config = function ( )
require ( " plugins.darknotify " )
end ,
2023-11-10 11:25:03 -08:00
requires = " https://github.com/nvim-lualine/lualine.nvim " ,
2022-02-25 11:03:05 -08:00
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Custom start screen
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/mhinz/vim-startify " ,
2022-02-25 11:03:05 -08:00
config = function ( )
require ( " utils " ) . require_with_local ( " plugins.startify " )
end ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- LSP
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Configure language servers
2022-08-31 11:45:26 -07:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/neovim/nvim-lspconfig " ,
2022-08-31 11:45:26 -07:00
tag = utils.map_version_rule ( {
2022-11-02 16:57:18 -07:00
-- [">=0.8.0"] = utils.nil_val,
2023-06-13 15:00:42 -07:00
[ " >=0.7.0 " ] = utils.nil_val ,
2022-08-31 11:45:26 -07:00
[ " >=0.6.1 " ] = " v0.1.2 " ,
[ " >=0.6.0 " ] = " v0.1.0 " ,
} ) ,
} )
2021-12-31 17:32:33 -08:00
2023-12-08 11:43:05 -08:00
-- Debug adapter protocol
use ( {
" https://github.com/mfussenegger/nvim-dap " ,
-- TODO: Move to lazy.nvim and allow it to load this only when the required debuggers are loaded
ft = { " python " , " rust " } ,
} )
use ( {
" https://github.com/rcarriga/nvim-dap-ui " ,
requires = { " https://github.com/mfussenegger/nvim-dap " } ,
after = " nvim-dap " ,
config = function ( )
require ( " dapui " ) . setup ( {
icons = {
expanded = " - " ,
collapsed = " + " ,
current_frame = " > " ,
} ,
controls = {
icons = {
disconnect = " disconnect " ,
pause = " pause " ,
play = " play " ,
run_last = " last " ,
step_back = " back " ,
step_into = " into " ,
step_out = " out " ,
step_over = " over " ,
terminate = " term " ,
} ,
} ,
} )
local dap , dapui = require ( " dap " ) , require ( " dapui " )
dap.listeners . after.event_initialized [ " dapui_config " ] = function ( )
dapui.open ( )
end
dap.listeners . before.event_terminated [ " dapui_config " ] = function ( )
dapui.close ( )
end
dap.listeners . before.event_exited [ " dapui_config " ] = function ( )
dapui.close ( )
end
end ,
} )
use ( {
" https://github.com/mfussenegger/nvim-dap-python " ,
requires = { " https://github.com/mfussenegger/nvim-dap " } ,
after = " nvim-dap " ,
config = function ( )
require ( " dap-python " ) . setup ( )
end ,
ft = " python " ,
} )
2022-02-25 11:03:05 -08:00
-- Install language servers
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/williamboman/mason.nvim " ,
2022-09-08 12:23:41 -07:00
requires = {
2023-11-10 11:25:03 -08:00
" https://github.com/neovim/nvim-lspconfig " ,
" https://github.com/williamboman/mason-lspconfig.nvim " ,
2022-09-08 12:23:41 -07:00
} ,
2022-10-14 15:29:01 -07:00
-- Only supports >=0.7.0
disable = vim.fn . has ( " nvim-0.7.0 " ) ~= 1 ,
2022-02-25 11:03:05 -08:00
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Lua dev for vim
2022-09-08 12:23:41 -07:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/folke/neodev.nvim " ,
requires = " https://github.com/neovim/nvim-lspconfig " ,
2022-09-08 12:23:41 -07:00
} )
2022-02-25 11:03:05 -08:00
2023-06-13 14:59:37 -07:00
-- Rust analyzer
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/simrat39/rust-tools.nvim " ,
2023-06-13 14:59:37 -07:00
disable = vim.fn . has ( " nvim-0.7.0 " ) ~= 1 ,
} )
2022-02-25 11:03:05 -08:00
-- Better display of lsp diagnostics
2023-06-12 09:13:48 -07:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/folke/trouble.nvim " ,
2023-06-12 09:13:48 -07:00
tag = utils.map_version_rule ( {
2023-06-13 16:08:07 -07:00
[ " >=0.7.2 " ] = " v2.* " ,
[ " <0.7.2 " ] = " v1.* " ,
2023-06-12 09:13:48 -07:00
} ) ,
} )
2022-02-25 11:03:05 -08:00
2022-06-07 09:52:22 -07:00
-- Incremental lsp rename view
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/smjonas/inc-rename.nvim " ,
2022-06-07 09:52:22 -07:00
config = function ( )
2023-06-13 16:08:42 -07:00
require ( " inc_rename " ) . setup ( {
input_buffer_type = " dressing " ,
} )
2022-06-07 09:52:22 -07:00
end ,
2022-10-14 15:29:01 -07:00
-- Only supports >=0.8.0
2022-08-31 11:22:37 -07:00
disable = vim.fn . has ( " nvim-0.8.0 " ) ~= 1 ,
2022-06-07 09:52:22 -07:00
} )
2022-02-25 11:03:05 -08:00
-- Generic linter/formatters in diagnostics API
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/jose-elias-alvarez/null-ls.nvim " ,
2023-06-01 17:11:50 -07:00
branch = utils.map_version_rule ( {
[ " >=0.8.0 " ] = utils.nil_val ,
[ " >=0.7.0 " ] = " 0.7-compat " ,
2023-06-13 16:47:03 -07:00
[ " <0.7.0 " ] = utils.nil_val , -- use pinned commit
2023-06-01 17:11:50 -07:00
} ) ,
2022-02-25 11:03:05 -08:00
commit = utils.map_version_rule ( {
2023-06-01 17:11:50 -07:00
[ " >=0.8.0 " ] = utils.nil_val ,
[ " >=0.7.0 " ] = utils.nil_val , -- Use pinned branch
2022-10-14 15:29:01 -07:00
[ " >=0.6.0 " ] = " 4b403d2d724f48150ded41189ae4866492a8158b " ,
2022-02-25 11:03:05 -08:00
} ) ,
2023-11-10 11:25:03 -08:00
requires = { " https://github.com/nvim-lua/plenary.nvim " , " https://github.com/neovim/nvim-lspconfig " } ,
2022-02-25 11:03:05 -08:00
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Writing
-- abolish/pencil
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/preservim/vim-pencil " ,
2022-02-25 11:03:05 -08:00
cmd = { " Pencil " } ,
} )
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/preservim/vim-textobj-sentence " ,
requires = " https://github.com/kana/vim-textobj-user " ,
2022-02-25 11:03:05 -08:00
} )
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/junegunn/goyo.vim " ,
2022-02-25 11:03:05 -08:00
cmd = { " Goyo " , " Zen " } ,
config = [[require("plugins.goyo-limelight")]] ,
2023-11-10 11:25:03 -08:00
requires = { " https://github.com/junegunn/limelight.vim " , cmd = " Limelight " } ,
2022-02-25 11:03:05 -08:00
} )
2021-08-24 10:38:14 -07:00
2022-02-25 11:03:05 -08:00
-- Treesitter
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-treesitter/nvim-treesitter " ,
2022-02-25 11:03:05 -08:00
run = " :TSUpdate " ,
2022-06-07 09:52:10 -07:00
commit = utils.map_version_rule ( {
2022-11-02 16:57:18 -07:00
[ " >=0.8.0 " ] = utils.nil_val ,
[ " >=0.7.0 " ] = " 4cccb6f494eb255b32a290d37c35ca12584c74d0 " ,
2023-06-12 09:13:48 -07:00
[ " >=0.6.0 " ] = " bc25a6a5 " ,
2022-06-07 09:52:10 -07:00
} ) ,
2022-02-25 11:03:05 -08:00
config = function ( )
2023-06-01 16:52:12 -07:00
require ( " utils " ) . require_with_local ( " plugins.treesitter " ) . setup ( )
2022-02-25 11:03:05 -08:00
end ,
} )
2023-06-12 09:13:48 -07:00
--[[ TODO: Enable this as an alterantive or fallback for LSPs
2022-02-25 11:03:05 -08:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-treesitter/nvim-treesitter-refactor " ,
requires = " https://github.com/nvim-treesitter/nvim-treesitter " ,
2023-06-12 09:13:48 -07:00
commit = utils.map_version_rule ( {
[ " >=0.7.0 " ] = utils.nil_val ,
[ " <0.7.0 " ] = " 75f5895 " ,
} ) ,
2022-02-25 11:03:05 -08:00
} )
2023-06-12 09:13:48 -07:00
--]]
2022-02-25 11:03:05 -08:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-treesitter/nvim-treesitter-textobjects " ,
requires = " https://github.com/nvim-treesitter/nvim-treesitter " ,
2023-06-12 09:13:48 -07:00
commit = utils.map_version_rule ( {
2023-06-28 04:44:11 +00:00
[ " >=0.8.0 " ] = utils.nil_val ,
[ " >=0.7.0 " ] = " 8673926519ea61069f9c1366d1ad1949316d250e " ,
2023-06-12 09:13:48 -07:00
[ " <0.7.0 " ] = " eca3bf30334f85259d41dc060d50994f8f91ef7d " ,
} ) ,
2022-02-25 11:03:05 -08:00
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Completion
2023-06-12 09:13:48 -07:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/L3MON4D3/LuaSnip " ,
2023-06-12 09:13:48 -07:00
tag = " v1.* " ,
} )
2022-02-25 11:03:05 -08:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/hrsh7th/nvim-cmp " ,
2022-02-25 11:03:05 -08:00
config = function ( )
require ( " plugins.completion " ) . config_cmp ( )
end ,
2022-06-07 09:52:10 -07:00
commit = utils.map_version_rule ( {
[ " >=0.7.0 " ] = utils.nil_val ,
[ " >=0.5.0 " ] = " bba6fb67fdafc0af7c5454058dfbabc2182741f4 " ,
} ) ,
2022-02-25 11:03:05 -08:00
requires = {
2023-06-12 09:13:48 -07:00
{
2023-11-10 11:25:03 -08:00
" https://github.com/hrsh7th/cmp-nvim-lsp " ,
2023-06-12 09:13:48 -07:00
after = " nvim-cmp " ,
commit = utils.map_version_rule ( {
[ " >=0.7.0 " ] = utils.nil_val ,
[ " <0.7.0 " ] = " 3cf38d9c957e95c397b66f91967758b31be4abe6 " ,
} ) ,
} ,
2023-11-10 11:25:03 -08:00
{ " https://github.com/hrsh7th/cmp-buffer " , after = " nvim-cmp " } ,
{ " https://github.com/f3fora/cmp-spell " , after = " nvim-cmp " } ,
2022-06-07 09:52:10 -07:00
{
2023-11-10 11:25:03 -08:00
" https://github.com/saadparwaiz1/cmp_luasnip " ,
2022-06-07 09:52:10 -07:00
after = " nvim-cmp " ,
commit = utils.map_version_rule ( {
[ " >0.7.0 " ] = utils.nil_val ,
[ " >=0.5.0 " ] = " b10829736542e7cc9291e60bab134df1273165c9 " ,
} ) ,
} ,
2023-11-10 11:25:03 -08:00
" https://github.com/L3MON4D3/LuaSnip " ,
2022-02-25 11:03:05 -08:00
} ,
event = " InsertEnter * " ,
} )
2022-02-25 09:09:51 -08:00
2022-02-25 11:03:05 -08:00
-- Add snippets
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/rafamadriz/friendly-snippets " ,
requires = " https://github.com/L3MON4D3/LuaSnip " ,
2022-02-25 11:03:05 -08:00
after = " LuaSnip " ,
config = function ( )
2023-06-13 17:12:45 -07:00
require ( " luasnip.loaders.from_vscode " ) . lazy_load ( )
2022-02-25 11:03:05 -08:00
end ,
} )
2022-03-01 12:27:15 -08:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/ray-x/lsp_signature.nvim " ,
2022-03-01 12:27:15 -08:00
config = function ( )
require ( " lsp_signature " ) . setup ( {
extra_trigger_chars = { " ( " , " , " } ,
auto_close_after = nil ,
-- Toggle these to use hint only
floating_window = true ,
hint_enable = false ,
} )
end ,
} )
2022-02-25 11:03:05 -08:00
-- Fuzzy Finder
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-telescope/telescope.nvim " ,
2022-02-25 11:03:05 -08:00
requires = {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-lua/plenary.nvim " ,
" https://github.com/nvim-lua/popup.nvim " ,
" https://github.com/nvim-telescope/telescope-file-browser.nvim " ,
2022-02-25 11:03:05 -08:00
} ,
tag = utils.map_version_rule ( {
2022-08-31 11:45:26 -07:00
-- Follow stable release tag
2023-11-15 08:07:12 -08:00
[ " >=0.9.0 " ] = " 0.1.* " ,
2024-03-29 12:31:57 -07:00
[ " >=0.7.0 " ] = " 0.1.2 " ,
2022-04-29 12:31:45 -07:00
[ " >=0.6.0 " ] = " nvim-0.6 " ,
2022-02-25 11:03:05 -08:00
[ " <0.6.0 " ] = " nvim-0.5.1 " ,
[ " ==0.5.0 " ] = " nvim-0.5.0 " ,
} ) ,
config = function ( )
require ( " plugins.telescope " )
end ,
} )
2021-08-24 10:38:14 -07:00
2022-02-25 11:03:05 -08:00
-- Filetypes
2023-11-10 11:25:03 -08:00
use ( " https://github.com/ViViDboarder/vim-forcedotcom " )
use ( " https://github.com/hsanson/vim-android " )
2022-02-25 11:03:05 -08:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/sheerun/vim-polyglot " ,
2022-02-25 11:03:05 -08:00
config = function ( )
2023-06-09 12:10:55 -07:00
-- TODO: Replace with api calls when dropping 0.6
2022-02-25 11:03:05 -08:00
vim.cmd ( [ [
2022-02-25 11:10:28 -08:00
augroup polyglot_fts
au BufRead , BufNewFile */ playbooks /* . yml , */ playbooks /* . yaml set filetype = yaml.ansible
au BufRead , BufNewFile go.mod , go.sum set filetype = gomod
augroup end
] ] )
2022-02-25 11:03:05 -08:00
end ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Debuging nvim config
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/tweekmonster/startuptime.vim " ,
2022-02-25 11:03:05 -08:00
cmd = { " StartupTime " } ,
} )
2021-12-16 14:43:02 -08:00
2022-02-25 11:03:05 -08:00
-- Fancy todo highlighting
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/folke/todo-comments.nvim " ,
2022-02-25 11:03:05 -08:00
requires = {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-lua/plenary.nvim " ,
2022-02-25 11:03:05 -08:00
} ,
config = function ( )
require ( " plugins.todo " )
end ,
2023-11-15 08:05:18 -08:00
-- Tag and branch rule because old versions are supported on a branch while latest stable is a moving tag
2023-06-12 09:13:48 -07:00
tag = utils.map_version_rule ( {
2023-11-15 08:07:12 -08:00
[ " >=0.8.0 " ] = " v1.* " ,
2023-06-12 09:13:48 -07:00
[ " <0.8.0 " ] = utils.nil_val ,
} ) ,
branch = utils.map_version_rule ( {
[ " >=0.8.0 " ] = utils.nil_val ,
[ " <0.8.0 " ] = " neovim-pre-0.8.0 " ,
} ) ,
2022-02-25 11:03:05 -08:00
} )
2022-01-02 07:41:55 -08:00
2022-02-25 11:03:05 -08:00
-- Fancy notifications
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/rcarriga/nvim-notify " ,
2022-02-25 11:03:05 -08:00
config = function ( )
2022-10-14 14:41:14 -07:00
require ( " plugins.notify " )
2021-12-16 14:43:02 -08:00
end ,
} )
2022-02-25 11:03:05 -08:00
2023-06-13 16:08:42 -07:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/stevearc/dressing.nvim " ,
2023-06-28 04:44:11 +00:00
branch = utils.map_version_rule ( {
[ " >=0.8.0 " ] = utils.nil_val ,
[ " <0.8.0 " ] = " nvim-0.7 " ,
} ) ,
2023-06-13 16:08:42 -07:00
config = function ( )
require ( " dressing " ) . setup ( { } )
end ,
} )
2023-10-20 16:59:19 -07:00
-- Obsidian notes
2023-11-10 11:24:11 -08:00
-- This loads an Obsidian plugin for better vault interraction as well as auto pulls
-- and commits to my vault git repo. On iOS devices, I use Working Copy to sync the
-- repo and use Shortcuts to automate pulling on open and auto committing and pushing
-- after closing Obsidian.
2023-10-20 16:59:19 -07:00
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/epwalsh/obsidian.nvim " ,
2023-10-20 16:59:19 -07:00
requires = {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-lua/plenary.nvim " ,
2023-11-10 11:24:11 -08:00
{
-- Fork of https://github.com/declancm/git-scripts.nvim is used here
2023-11-15 08:05:18 -08:00
-- because it includes a few small fixes.
2023-11-10 11:24:11 -08:00
" https://github.com/vividboarder/git-scripts.nvim " ,
branch = " dev " ,
config = function ( )
local gs = require ( " git-scripts " )
gs.setup ( {
2023-11-15 08:05:18 -08:00
-- Disable keymaps becasue I only use this for auto pull and auto commit
2023-11-10 11:24:11 -08:00
default_keymaps = false ,
commit_on_save = true ,
} )
gs.async_pull ( )
end ,
after = " obsidian.nvim " ,
} ,
2023-10-20 16:59:19 -07:00
} ,
2023-11-10 11:24:11 -08:00
tag = " v1.* " ,
2023-10-20 16:59:19 -07:00
config = function ( )
2023-11-15 09:53:47 -08:00
vim.g . vim_markdown_frontmatter = 1
2023-10-20 16:59:19 -07:00
require ( " obsidian " ) . setup ( {
workspaces = {
2023-11-10 14:49:19 -08:00
{ name = " personal " , path = " ~/Documents/Obsidian " } ,
2023-10-20 16:59:19 -07:00
} ,
} )
end ,
event = {
" BufRead " .. vim.fn . expand ( " ~ " ) .. " /Documents/Obsidian/**.md " ,
" BufNewFile " .. vim.fn . expand ( " ~ " ) .. " /Documents/Obsidian/**.md " ,
} ,
} )
2023-10-20 16:59:32 -07:00
-- Work things
-- Sourcegraph
use ( {
2023-11-10 11:25:03 -08:00
" https://github.com/sourcegraph/sg.nvim " ,
2023-10-20 16:59:32 -07:00
run = " nvim -l build/init.lua " ,
requires = {
2023-11-10 11:25:03 -08:00
" https://github.com/nvim-lua/plenary.nvim " ,
2023-10-20 16:59:32 -07:00
} ,
2023-11-10 11:25:19 -08:00
config = function ( )
require ( " sg " ) . setup ( {
enable_cody = false ,
2023-11-15 08:05:18 -08:00
-- Empty attach because I dont want to use default keymaps. Maybe I'll remap something later.
2023-11-10 11:25:19 -08:00
on_attach = function ( ) end ,
} )
end ,
cmd = {
" SourcegraphBuild " ,
" SourcegraphDownloadBinaries " ,
" SourcegraphInfo " ,
" SourcegraphLink " ,
" SourcegraphLogin " ,
" SourcegraphSearch " ,
} ,
2024-05-29 12:04:26 -07:00
disable = not vim.g . install_sourcegraph ,
2023-10-20 16:59:32 -07:00
} )
2024-05-29 12:08:16 -07:00
use ( {
" https://github.com/github/copilot.vim " ,
disable = not vim.g . install_copilot ,
2024-06-12 12:36:30 -07:00
config = function ( )
require ( " plugins.copilot " )
end ,
after = " vim-rsi " ,
2024-05-29 12:08:16 -07:00
} )
use ( {
" https://github.com/CopilotC-Nvim/CopilotChat.nvim " ,
disable = not vim.g . install_copilot ,
branch = " canary " ,
config = function ( )
require ( " plugins.copilotchat " ) . setup ( )
end ,
} )
2022-02-25 11:03:05 -08:00
-- Auto sync after bootstrapping on a fresh box
2022-10-25 09:42:59 -07:00
if packer_bootstrap ~= " " then
2022-02-25 11:03:05 -08:00
packer.sync ( )
end