Initial conversion of plugins to dynamic system, plugin specs loaded by Lazy from plugins directory

This commit is contained in:
Evie Litherland-Smith 2023-02-20 11:09:53 +00:00
parent 638d1e18f1
commit edb827889a
33 changed files with 286 additions and 295 deletions

View file

@ -12,9 +12,8 @@ if not vim.loop.fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
local plugins = require "plugins" vim.g.mapleader = " "
local opts = require "config.lazy" require("lazy").setup("plugins")
require("lazy").setup(plugins, opts)
-- Set vim options -- Set vim options
require "options" require "options"

View file

@ -1,11 +0,0 @@
vim.opt.fillchars:append {
horiz = "",
horizup = "",
horizdown = "",
vert = "",
vertleft = "",
vertright = "",
verthoriz = "",
}
require "config.catppuccin"
vim.cmd "colorscheme catppuccin"

View file

@ -1,22 +0,0 @@
require("catppuccin").setup {
flavour = "macchiato",
transparent_background = true,
term_colors = true,
integrations = {
gitsigns = true,
indent_blankline = {
enabled = true,
colored_indent_levels = true,
},
cmp = true,
native_lsp = {
enabled = true,
},
notify = true,
nvimtree = true,
treesitter = true,
treesitter_context = true,
telescope = true,
lsp_trouble = true,
},
}

View file

@ -1,6 +0,0 @@
require("diffview").setup {
enhanced_diff_hl = true,
file_panel = {
listing_style = "list",
},
}

View file

@ -1,2 +0,0 @@
local components = require("config.catppuccin_feline").get()
require("feline").setup { components = components }

View file

@ -1,45 +0,0 @@
require("gitsigns").setup {
signcolumn = true,
numhl = true,
linehl = false,
current_line_blame = true,
word_diff = false,
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map("n", "]c", function()
if vim.wo.diff then return "]c" end
vim.schedule(function() gs.next_hunk() end)
return "<Ignore>"
end, { expr = true })
map("n", "[c", function()
if vim.wo.diff then return "[c" end
vim.schedule(function() gs.prev_hunk() end)
return "<Ignore>"
end, { expr = true })
-- Actions
map({ "n", "v" }, "<leader>hs", ":Gitsigns stage_hunk<CR>")
map({ "n", "v" }, "<leader>hr", ":Gitsigns reset_hunk<CR>")
map("n", "<leader>hS", gs.stage_buffer)
map("n", "<leader>hu", gs.undo_stage_hunk)
map("n", "<leader>hR", gs.reset_buffer)
map("n", "<leader>hp", gs.preview_hunk)
map("n", "<leader>hb", function() gs.blame_line { full = true } end)
map("n", "<leader>tb", gs.toggle_current_line_blame)
map("n", "<leader>hd", gs.diffthis)
map("n", "<leader>hD", function() gs.diffthis "~" end)
map("n", "<leader>td", gs.toggle_deleted)
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
end,
}

View file

@ -1,12 +0,0 @@
require("indent_blankline").setup {
show_current_context = true,
show_current_context_start = false,
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
"IndentBlanklineIndent3",
"IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
},
}

View file

@ -1,10 +0,0 @@
local M = {
install = {
colorscheme = {
"catppuccin",
"habamax",
"default",
},
},
}
return M

View file

@ -1,21 +0,0 @@
vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]]
require("neo-tree").setup {
close_if_last_window = true,
filesystem = {
filtered_items = {
hide_dotfiles = false,
},
group_empty_dirs = true,
},
buffers = {
follow_current_file = true,
group_empty_dirs = true,
},
git_status = {
group_empty_dirs = true,
},
source_selector = {
winbar = true,
statusline = false,
},
}

View file

@ -1,6 +0,0 @@
require("nvim-test").setup {
termOpts = {
direction = "horizontal",
keep_one = true,
},
}

View file

@ -1,5 +0,0 @@
require("onedarkpro").setup {
options = {
transparency = true,
},
}

View file

@ -1,31 +0,0 @@
require "telescope.actions"
local trouble = require "trouble.providers.telescope"
require("telescope").setup {
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
},
aerial = {
show_nesting = {
["_"] = false,
python = true,
json = true,
yaml = true,
},
},
},
defaults = {
mappings = {
i = { ["<c-t>"] = trouble.open_with_trouble },
n = { ["<c-t>"] = trouble.open_with_trouble },
},
},
}
require("telescope").load_extension "fzf"
require("telescope").load_extension "notify"

View file

@ -1,7 +0,0 @@
require("nvim-treesitter.configs").setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
disable = { "fortran" },
},
}

View file

@ -1,7 +0,0 @@
require("trouble").setup {
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
auto_open = false, -- automatically open the list when you have diagnostics
auto_close = false, -- automatically close the list when you have no diagnostics
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
auto_jump = { "lsp_definitions", "lsp_references", "lsp_implementations" }, -- for the given modes, automatically jump if there is only a single result
}

View file

@ -1,109 +1,3 @@
local M = { return {
{ "folke/lazy.nvim", cmd = "Lazy" }, { "folke/lazy.nvim", cmd = "Lazy" },
{
"catppuccin/nvim",
name = "catppuccin",
lazy = false,
priority = 1000,
config = function() require "colours" end,
},
{ "stevearc/dressing.nvim" },
{
"feline-nvim/feline.nvim",
config = function() require "config.feline" end,
},
{
"rcarriga/nvim-notify",
config = function()
require("notify").setup {
background_colour = "#000000",
}
vim.notify = require "notify"
end,
},
{
"neovim/nvim-lspconfig",
dependencies = {
{ "hrsh7th/nvim-cmp" },
{ "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-cmdline" },
{ "f3fora/cmp-spell" },
{ "petertriho/cmp-git" },
{ "Dosx001/cmp-commit" },
{ "kdheepak/cmp-latex-symbols" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
{ "rafamadriz/friendly-snippets" },
{ "windwp/nvim-autopairs" },
{ "jose-elias-alvarez/null-ls.nvim" },
{ "folke/neodev.nvim" },
},
config = function()
require "config.lsp"
require "config.cmp"
end,
},
{
"nvim-treesitter/nvim-treesitter",
config = function() require "config.treesitter" end,
},
{
"lewis6991/gitsigns.nvim",
config = function() require "config.gitsigns" end,
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
cmd = "Neotree",
config = function() require "config.neotree" end,
},
{
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
},
cmd = "Telescope",
config = function() require "config.telescope" end,
},
{
"folke/trouble.nvim",
dependencies = "nvim-tree/nvim-web-devicons",
cmd = "TroubleToggle",
config = function() require "config.trouble" end,
},
{
"lukas-reineke/indent-blankline.nvim",
config = function() require "config.indent_blankline" end,
},
{
"numToStr/Navigator.nvim",
config = function() require("Navigator").setup() end,
},
{
"klen/nvim-test",
config = function() require "config.nvim-test" end,
},
{
"numToStr/Comment.nvim",
name = "Comment",
config = function() require "Comment" end,
},
{
"sindrets/diffview.nvim",
dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" },
config = function() require "config.diffview" end,
},
} }
return M

View file

@ -0,0 +1,40 @@
return {
"catppuccin/nvim",
name = "catppuccin",
lazy = false,
priority = 1000,
config = function()
vim.opt.fillchars:append {
horiz = "",
horizup = "",
horizdown = "",
vert = "",
vertleft = "",
vertright = "",
verthoriz = "",
}
require("catppuccin").setup {
flavour = "macchiato",
transparent_background = true,
term_colors = true,
integrations = {
gitsigns = true,
indent_blankline = {
enabled = true,
colored_indent_levels = true,
},
cmp = true,
native_lsp = {
enabled = true,
},
notify = true,
nvimtree = true,
treesitter = true,
treesitter_context = true,
telescope = true,
lsp_trouble = true,
},
}
vim.cmd "colorscheme catppuccin"
end,
}

View file

@ -0,0 +1,12 @@
return {
"sindrets/diffview.nvim",
dependencies = { "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons" },
config = function()
require("diffview").setup {
enhanced_diff_hl = true,
file_panel = {
listing_style = "list",
},
}
end,
}

View file

@ -0,0 +1 @@
return { "stevearc/dressing.nvim" }

View file

@ -0,0 +1,8 @@
return {
"feline-nvim/feline.nvim",
dependencies = "catppuccin/nvim",
config = function()
local components = require("ui.catppuccin_feline").get()
require("feline").setup { components = components }
end,
}

View file

@ -0,0 +1,50 @@
return {
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup {
signcolumn = true,
numhl = true,
linehl = false,
current_line_blame = true,
word_diff = false,
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map("n", "]c", function()
if vim.wo.diff then return "]c" end
vim.schedule(function() gs.next_hunk() end)
return "<Ignore>"
end, { expr = true })
map("n", "[c", function()
if vim.wo.diff then return "[c" end
vim.schedule(function() gs.prev_hunk() end)
return "<Ignore>"
end, { expr = true })
-- Actions
map({ "n", "v" }, "<leader>hs", ":Gitsigns stage_hunk<CR>")
map({ "n", "v" }, "<leader>hr", ":Gitsigns reset_hunk<CR>")
map("n", "<leader>hS", gs.stage_buffer)
map("n", "<leader>hu", gs.undo_stage_hunk)
map("n", "<leader>hR", gs.reset_buffer)
map("n", "<leader>hp", gs.preview_hunk)
map("n", "<leader>hb", function() gs.blame_line { full = true } end)
map("n", "<leader>tb", gs.toggle_current_line_blame)
map("n", "<leader>hd", gs.diffthis)
map("n", "<leader>hD", function() gs.diffthis "~" end)
map("n", "<leader>td", gs.toggle_deleted)
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
end,
}
end,
}

View file

@ -0,0 +1,17 @@
return {
"lukas-reineke/indent-blankline.nvim",
config = function()
require("indent_blankline").setup {
show_current_context = true,
show_current_context_start = false,
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
"IndentBlanklineIndent3",
"IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
},
}
end,
}

View file

@ -0,0 +1,25 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{ "hrsh7th/nvim-cmp" },
{ "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-cmdline" },
{ "f3fora/cmp-spell" },
{ "petertriho/cmp-git" },
{ "Dosx001/cmp-commit" },
{ "kdheepak/cmp-latex-symbols" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
{ "rafamadriz/friendly-snippets" },
{ "windwp/nvim-autopairs" },
{ "jose-elias-alvarez/null-ls.nvim" },
{ "folke/neodev.nvim" },
},
config = function()
require "lsp.init"
require "lsp.cmp"
end,
}

View file

@ -0,0 +1,5 @@
return {
"numToStr/Navigator.nvim",
name = "Navigator",
config = function() require("Navigator").setup() end,
}

View file

@ -0,0 +1,33 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
cmd = "Neotree",
config = function()
vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]]
require("neo-tree").setup {
close_if_last_window = true,
filesystem = {
filtered_items = {
hide_dotfiles = false,
},
group_empty_dirs = true,
},
buffers = {
follow_current_file = true,
group_empty_dirs = true,
},
git_status = {
group_empty_dirs = true,
},
source_selector = {
winbar = true,
statusline = false,
},
}
end,
}

View file

@ -0,0 +1,9 @@
return {
"rcarriga/nvim-notify",
config = function()
require("notify").setup {
background_colour = "#000000",
}
vim.notify = require "notify"
end,
}

View file

@ -0,0 +1,11 @@
return {
"klen/nvim-test",
config = function()
require("nvim-test").setup {
termOpts = {
direction = "horizontal",
keep_one = true,
},
}
end,
}

View file

@ -0,0 +1,46 @@
return {
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
{ "rcarriga/nvim-notify" },
},
cmd = "Telescope",
config = function()
require "telescope.actions"
local trouble = require "trouble.providers.telescope"
require("telescope").setup {
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
},
aerial = {
show_nesting = {
["_"] = false,
python = true,
json = true,
yaml = true,
},
},
},
defaults = {
mappings = {
i = { ["<c-t>"] = trouble.open_with_trouble },
n = { ["<c-t>"] = trouble.open_with_trouble },
},
},
}
require("telescope").load_extension "fzf"
require("telescope").load_extension "notify"
end,
}

View file

@ -0,0 +1,12 @@
return {
"nvim-treesitter/nvim-treesitter",
config = function()
require("nvim-treesitter.configs").setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
disable = { "fortran" },
},
}
end,
}

View file

@ -0,0 +1,14 @@
return {
"folke/trouble.nvim",
dependencies = "nvim-tree/nvim-web-devicons",
cmd = "TroubleToggle",
config = function()
require("trouble").setup {
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
auto_open = false, -- automatically open the list when you have diagnostics
auto_close = false, -- automatically close the list when you have no diagnostics
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
auto_jump = { "lsp_definitions", "lsp_references", "lsp_implementations" }, -- for the given modes, automatically jump if there is only a single result
}
end,
}