2022-10-17 17:13:31 +02:00
|
|
|
local ensure_packer = function()
|
|
|
|
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
|
|
|
|
fn.system({
|
|
|
|
"git",
|
|
|
|
"clone",
|
|
|
|
"--depth",
|
|
|
|
"1",
|
|
|
|
"https://github.com/wbthomason/packer.nvim",
|
|
|
|
install_path,
|
|
|
|
})
|
|
|
|
vim.cmd([[packadd packer.nvim]])
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
return false
|
2022-10-11 07:40:50 +02:00
|
|
|
end
|
|
|
|
|
2022-10-17 17:13:31 +02:00
|
|
|
local packer_bootstrap = ensure_packer()
|
|
|
|
|
|
|
|
-- auto-compile when lua files in `~/.config/nvim/*` change
|
|
|
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
|
|
|
pattern = "*.lua",
|
|
|
|
callback = function()
|
|
|
|
local cfg_path = vim.fn.resolve(vim.fn.stdpath("config"))
|
|
|
|
vim.defer_fn(function()
|
|
|
|
if vim.fn.expand("%:p"):match(cfg_path) then
|
|
|
|
vim.cmd("silent! PackerCompile")
|
|
|
|
end
|
|
|
|
end, 0)
|
|
|
|
end,
|
2022-07-30 07:17:12 +02:00
|
|
|
})
|
|
|
|
|
2022-10-17 17:13:31 +02:00
|
|
|
return require("packer").startup(function(use)
|
2022-10-11 07:40:50 +02:00
|
|
|
-- Packer managing itself
|
|
|
|
use("wbthomason/packer.nvim")
|
|
|
|
-- startup time or some shit
|
|
|
|
use("lewis6991/impatient.nvim")
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- colour scheme
|
|
|
|
use({
|
|
|
|
"catppuccin/nvim",
|
|
|
|
as = "catppuccin",
|
|
|
|
run = ":CatppuccinCompile",
|
|
|
|
config = function()
|
|
|
|
require("config/catppuccin")
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- git gutter
|
|
|
|
use({
|
|
|
|
"lewis6991/gitsigns.nvim",
|
|
|
|
config = function()
|
|
|
|
require("config/gitsigns")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
-- rainbow indents
|
|
|
|
use({
|
|
|
|
"lukas-reineke/indent-blankline.nvim",
|
|
|
|
config = function()
|
|
|
|
require("indent_blankline").setup({
|
|
|
|
space_char_blankline = " ",
|
|
|
|
show_current_conext = true,
|
|
|
|
char_highlight_list = {
|
|
|
|
"IndentBlanklineIndent1",
|
|
|
|
"IndentBlanklineIndent2",
|
|
|
|
"IndentBlanklineIndent3",
|
|
|
|
"IndentBlanklineIndent4",
|
|
|
|
"IndentBlanklineIndent5",
|
|
|
|
"IndentBlanklineIndent6",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
vim.g.indent_blankline_filetype_exclude = {
|
|
|
|
"dashboard",
|
|
|
|
"help",
|
|
|
|
"neogitstatus",
|
|
|
|
"fugitive",
|
|
|
|
"packer",
|
|
|
|
"NvimTree",
|
|
|
|
"Trouble",
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- top bar
|
|
|
|
use({
|
|
|
|
"akinsho/bufferline.nvim",
|
|
|
|
config = function()
|
|
|
|
require("config/bufferline")
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- bottom bar
|
|
|
|
use({
|
|
|
|
"feline-nvim/feline.nvim",
|
|
|
|
requires = "kyazdani42/nvim-web-devicons",
|
|
|
|
after = { "catppuccin" },
|
|
|
|
config = function()
|
|
|
|
require("config/feline")
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- DJI Osmo
|
|
|
|
use({
|
|
|
|
"luukvbaal/stabilize.nvim",
|
|
|
|
config = function()
|
|
|
|
require("stabilize").setup()
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- syntax
|
|
|
|
use({
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
|
|
|
run = function()
|
|
|
|
require("nvim-treesitter.install").update({ with_sync = true })
|
|
|
|
end,
|
|
|
|
config = function()
|
|
|
|
require("config/treesitter")
|
|
|
|
end,
|
|
|
|
})
|
2022-10-17 17:13:31 +02:00
|
|
|
use({
|
|
|
|
"p00f/nvim-ts-rainbow",
|
|
|
|
requires = "nvim-treesitter/nvim-treesitter",
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- show possible key combos
|
|
|
|
use({
|
|
|
|
"folke/which-key.nvim",
|
|
|
|
config = function()
|
|
|
|
require("which-key").setup({})
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- syntax
|
|
|
|
use("alker0/chezmoi.vim")
|
|
|
|
use("ron-rs/ron.vim")
|
|
|
|
use("elkowar/yuck.vim")
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- tooling
|
|
|
|
use("gpanders/editorconfig.nvim")
|
|
|
|
-- read and write encrypted pgp files
|
|
|
|
use("jamessan/vim-gnupg")
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- additional functionality
|
|
|
|
use({
|
|
|
|
"numToStr/Comment.nvim",
|
|
|
|
config = function()
|
|
|
|
require("Comment").setup()
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({
|
|
|
|
"kylechui/nvim-surround",
|
|
|
|
config = function()
|
|
|
|
require("nvim-surround").setup({})
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use("ggandor/lightspeed.nvim")
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-17 17:13:31 +02:00
|
|
|
use("windwp/nvim-autopairs")
|
2022-10-11 07:40:50 +02:00
|
|
|
use({
|
|
|
|
"windwp/nvim-ts-autotag",
|
|
|
|
config = function()
|
|
|
|
require("nvim-ts-autotag").setup()
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
--
|
|
|
|
-- git
|
|
|
|
use("tpope/vim-fugitive")
|
|
|
|
-- why not both?
|
|
|
|
use({
|
|
|
|
"TimUntersberger/neogit",
|
|
|
|
requires = "nvim-lua/plenary.nvim",
|
|
|
|
config = function()
|
2022-10-17 17:13:31 +02:00
|
|
|
Map("n", "<leader>ng", "<Cmd>Neogit<CR>")
|
2022-10-11 07:40:50 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
use("dhruvasagar/vim-table-mode")
|
|
|
|
use({
|
|
|
|
"kyazdani42/nvim-tree.lua",
|
|
|
|
config = function()
|
|
|
|
require("nvim-tree").setup({ update_cwd = true })
|
2022-10-17 17:13:31 +02:00
|
|
|
Map("n", "<C-n>", ":NvimTreeToggle<CR>")
|
2022-10-11 07:40:50 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({
|
|
|
|
"nvchad/nvim-colorizer.lua",
|
|
|
|
config = function()
|
|
|
|
require("config/colorizer")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({
|
|
|
|
"simrat39/symbols-outline.nvim",
|
|
|
|
config = function()
|
|
|
|
require("symbols-outline").setup()
|
2022-10-17 17:13:31 +02:00
|
|
|
Map("n", "<leader>so", ":SymbolsOutline<CR>")
|
2022-10-11 07:40:50 +02:00
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- databases
|
2022-10-17 17:13:31 +02:00
|
|
|
use("tpope/vim-dadbod")
|
|
|
|
use("kristijanhusak/vim-dadbod-completion")
|
2022-10-11 07:40:50 +02:00
|
|
|
use({
|
|
|
|
"kristijanhusak/vim-dadbod-ui",
|
|
|
|
config = function()
|
2022-10-17 17:13:31 +02:00
|
|
|
Map("n", "<leader>db", ":DBUIToggle<CR>")
|
2022-10-11 07:40:50 +02:00
|
|
|
vim.g.db_ui_use_nerd_fonts = true
|
|
|
|
vim.g.db_ui_win_position = "right"
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- telescope
|
|
|
|
use({
|
|
|
|
"nvim-telescope/telescope.nvim",
|
|
|
|
requires = "nvim-lua/plenary.nvim",
|
|
|
|
config = function()
|
2022-10-17 17:13:31 +02:00
|
|
|
Map("n", "<leader>fr", "<cmd>Telescope asynctasks all<CR>")
|
|
|
|
Map("n", "<leader>fb", "<cmd>Telescope buffers<CR>")
|
|
|
|
Map("n", "<leader>ff", "<cmd>Telescope find_files<CR>")
|
|
|
|
Map("n", "<leader>fg", "<cmd>Telescope live_grep<CR>")
|
|
|
|
Map("n", "<leader>fh", "<cmd>Telescope help_tags<CR>")
|
2022-10-11 07:40:50 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({
|
|
|
|
"nvim-telescope/telescope-fzf-native.nvim",
|
|
|
|
run = "make",
|
|
|
|
requires = "nvim-telescope/telescope.nvim",
|
|
|
|
config = function()
|
|
|
|
local telescope = require("telescope")
|
|
|
|
telescope.setup({
|
|
|
|
extensions = {
|
|
|
|
fzf = {
|
|
|
|
fuzzy = true,
|
|
|
|
override_generic_sorter = true,
|
|
|
|
override_file_sorter = true,
|
|
|
|
case_mode = "smart_case",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
telescope.load_extension("fzf")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({
|
|
|
|
"nvim-telescope/telescope-file-browser.nvim",
|
|
|
|
config = function()
|
|
|
|
require("telescope").load_extension("file_browser")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({
|
|
|
|
"nvim-telescope/telescope-project.nvim",
|
|
|
|
config = function()
|
|
|
|
require("telescope").load_extension("project")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({
|
|
|
|
"nvim-telescope/telescope-packer.nvim",
|
|
|
|
config = function()
|
|
|
|
require("telescope").load_extension("packer")
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
use({
|
|
|
|
"andweeb/presence.nvim",
|
|
|
|
config = function()
|
|
|
|
require("config/presence")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({ "iamcco/markdown-preview.nvim", run = "cd app && yarn install" })
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- external extensions
|
|
|
|
use("williamboman/mason.nvim")
|
|
|
|
-- LSP
|
|
|
|
use("williamboman/mason-lspconfig.nvim")
|
|
|
|
use("neovim/nvim-lspconfig")
|
|
|
|
-- completion
|
|
|
|
use("hrsh7th/nvim-cmp")
|
|
|
|
use("hrsh7th/cmp-buffer")
|
|
|
|
use("hrsh7th/cmp-cmdline")
|
|
|
|
use("hrsh7th/cmp-nvim-lsp")
|
|
|
|
use("hrsh7th/cmp-path")
|
|
|
|
use("hrsh7th/cmp-vsnip")
|
|
|
|
use("hrsh7th/vim-vsnip")
|
|
|
|
use("petertriho/cmp-git")
|
2022-10-17 17:13:31 +02:00
|
|
|
use("rafamadriz/friendly-snippets")
|
|
|
|
use("jose-elias-alvarez/null-ls.nvim")
|
2022-10-11 07:40:50 +02:00
|
|
|
use({
|
|
|
|
"glepnir/lspsaga.nvim",
|
2022-10-17 17:13:31 +02:00
|
|
|
branch = "main",
|
2022-10-11 07:40:50 +02:00
|
|
|
config = function()
|
|
|
|
require("config/lspsaga")
|
|
|
|
end,
|
|
|
|
})
|
2022-10-17 17:13:31 +02:00
|
|
|
|
|
|
|
use("b0o/schemastore.nvim")
|
2022-10-11 07:40:50 +02:00
|
|
|
use({
|
|
|
|
"github/copilot.vim",
|
|
|
|
config = function()
|
2022-10-17 17:13:31 +02:00
|
|
|
local opt = { noremap = true, silent = true, expr = true }
|
|
|
|
Map("i", "<C-J>", "copilot#Accept(<Tab>)", opt)
|
2022-10-11 07:40:50 +02:00
|
|
|
vim.g.copilot_no_tab_map = true
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- organization
|
|
|
|
use({
|
|
|
|
"vimwiki/vimwiki",
|
|
|
|
branch = "dev",
|
|
|
|
config = function()
|
|
|
|
vim.g.vimwiki_global_ext = 0
|
|
|
|
vim.g.vimwiki_list = {
|
|
|
|
{
|
|
|
|
auto_export = 1,
|
|
|
|
path = "~/.local/share/vimwiki/",
|
|
|
|
syntax = "markdown",
|
|
|
|
ext = ".md",
|
|
|
|
path_html = "~/vimwiki/",
|
|
|
|
template_path = "~/.config/vimwiki/templates/",
|
|
|
|
template_default = "default",
|
|
|
|
template_ext = ".tpl",
|
|
|
|
custom_wiki2html = "vimwiki_markdown",
|
|
|
|
html_filename_parameterization = 1,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use("tools-life/taskwiki")
|
2022-10-17 17:13:31 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
use({
|
|
|
|
"skywind3000/asyncrun.vim",
|
|
|
|
config = function()
|
|
|
|
vim.g.asyncrun_open = 6
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
use({ "skywind3000/asynctasks.vim" })
|
|
|
|
use({
|
|
|
|
"GustavoKatel/telescope-asynctasks.nvim",
|
|
|
|
config = function()
|
|
|
|
require("telescope").load_extension("asynctasks")
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- startup
|
|
|
|
use({
|
|
|
|
"glepnir/dashboard-nvim",
|
|
|
|
config = function()
|
|
|
|
require("config/dashboard")
|
|
|
|
end,
|
|
|
|
})
|
2022-07-30 07:17:12 +02:00
|
|
|
|
2022-10-11 07:40:50 +02:00
|
|
|
-- automatic theme switching
|
|
|
|
if vim.fn.has("macunix") then
|
|
|
|
use({
|
|
|
|
"f-person/auto-dark-mode.nvim",
|
|
|
|
config = function()
|
|
|
|
local auto_dark_mode = require("auto-dark-mode")
|
|
|
|
auto_dark_mode.setup({
|
|
|
|
---@diagnostic disable-next-line: assign-type-mismatch
|
|
|
|
update_interval = 1000,
|
|
|
|
set_dark_mode = function()
|
|
|
|
vim.cmd("Catppuccin frappe")
|
|
|
|
end,
|
|
|
|
set_light_mode = function()
|
|
|
|
vim.cmd("Catppuccin latte")
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
auto_dark_mode.init()
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
end
|
2022-10-17 17:13:31 +02:00
|
|
|
|
|
|
|
if packer_bootstrap then
|
|
|
|
require("packer").sync()
|
|
|
|
end
|
2022-07-30 07:17:12 +02:00
|
|
|
end)
|