Split plugin configuration options into config directory, keep spec in plugin directory
This commit is contained in:
parent
1447abb240
commit
04ff522a0c
24
config/nvim/lua/config/catppuccin.lua
Normal file
24
config/nvim/lua/config/catppuccin.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
flavour = "macchiato",
|
||||
transparent_background = true,
|
||||
term_colors = true,
|
||||
integrations = {
|
||||
dashboard = true,
|
||||
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,
|
||||
which_key = true,
|
||||
},
|
||||
}
|
31
config/nvim/lua/config/dashboard.lua
Normal file
31
config/nvim/lua/config/dashboard.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
return {
|
||||
theme = "hyper",
|
||||
config = {
|
||||
week_header = {
|
||||
enable = true,
|
||||
},
|
||||
shortcut = {
|
||||
{ desc = " Update", group = "@property", action = "Lazy update", key = "u" },
|
||||
{
|
||||
icon = " ",
|
||||
icon_hl = "@variable",
|
||||
desc = "Files",
|
||||
group = "Label",
|
||||
action = "Telescope find_files",
|
||||
key = "f",
|
||||
},
|
||||
{
|
||||
desc = " Apps",
|
||||
group = "DiagnosticHint",
|
||||
action = "Telescope app",
|
||||
key = "a",
|
||||
},
|
||||
{
|
||||
desc = " dotfiles",
|
||||
group = "Number",
|
||||
action = "Telescope dotfiles",
|
||||
key = "d",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
6
config/nvim/lua/config/diffview.lua
Normal file
6
config/nvim/lua/config/diffview.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
enhanced_diff_hl = true,
|
||||
file_panel = {
|
||||
listing_style = "list",
|
||||
},
|
||||
}
|
2
config/nvim/lua/config/feline.lua
Normal file
2
config/nvim/lua/config/feline.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
local components = require("ui.feline_components").get()
|
||||
return { components = components }
|
45
config/nvim/lua/config/gitsigns.lua
Normal file
45
config/nvim/lua/config/gitsigns.lua
Normal file
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
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,
|
||||
}
|
12
config/nvim/lua/config/indent_blankline.lua
Normal file
12
config/nvim/lua/config/indent_blankline.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
show_current_context = true,
|
||||
show_current_context_start = false,
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
"IndentBlanklineIndent3",
|
||||
"IndentBlanklineIndent4",
|
||||
"IndentBlanklineIndent5",
|
||||
"IndentBlanklineIndent6",
|
||||
},
|
||||
}
|
20
config/nvim/lua/config/neotree.lua
Normal file
20
config/nvim/lua/config/neotree.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
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,
|
||||
},
|
||||
}
|
3
config/nvim/lua/config/notify.lua
Normal file
3
config/nvim/lua/config/notify.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
background_colour = "#000000",
|
||||
}
|
6
config/nvim/lua/config/nvim_test.lua
Normal file
6
config/nvim/lua/config/nvim_test.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
termOpts = {
|
||||
direction = "horizontal",
|
||||
keep_one = true,
|
||||
},
|
||||
}
|
17
config/nvim/lua/config/telescope.lua
Normal file
17
config/nvim/lua/config/telescope.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
local trouble = require "trouble.providers.telescope"
|
||||
return {
|
||||
defaults = {
|
||||
layout_strategy = "flex",
|
||||
mappings = {
|
||||
i = { ["<c-t>"] = trouble.open_with_trouble },
|
||||
n = { ["<c-t>"] = trouble.open_with_trouble },
|
||||
},
|
||||
},
|
||||
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
|
||||
},
|
||||
},
|
||||
}
|
7
config/nvim/lua/config/treesitter.lua
Normal file
7
config/nvim/lua/config/treesitter.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
disable = { "fortran" },
|
||||
},
|
||||
}
|
7
config/nvim/lua/config/trouble.lua
Normal file
7
config/nvim/lua/config/trouble.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
mode = "workspace_diagnostics",
|
||||
auto_open = false,
|
||||
auto_close = false,
|
||||
auto_preview = true,
|
||||
auto_jump = { "lsp_definitions", "lsp_references", "lsp_implementations" },
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
local M = {}
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
@ -13,39 +15,33 @@ for type, icon in pairs(signs) do
|
|||
end
|
||||
|
||||
require("neodev").setup()
|
||||
|
||||
local on_attach = require "lsp.attach"
|
||||
local lsp_flags = require "lsp.flags"
|
||||
local lspconfig = require "lspconfig"
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
M.on_attach = require "lsp.attach"
|
||||
M.lsp_flags = require "lsp.flags"
|
||||
M.capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
lspconfig.pyright.setup {
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
on_attach = M.on_attach,
|
||||
flags = M.lsp_flags,
|
||||
capabilities = M.capabilities,
|
||||
}
|
||||
|
||||
lspconfig.fortls.setup {
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
on_attach = M.on_attach,
|
||||
flags = M.lsp_flags,
|
||||
capabilities = M.capabilities,
|
||||
}
|
||||
|
||||
lspconfig.lua_ls.setup {
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
on_attach = M.on_attach,
|
||||
flags = M.lsp_flags,
|
||||
capabilities = M.capabilities,
|
||||
}
|
||||
|
||||
lspconfig.texlab.setup {
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
require("null-ls").setup {
|
||||
sources = require "lsp.null_ls_sources",
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
on_attach = M.on_attach,
|
||||
flags = M.lsp_flags,
|
||||
capabilities = M.capabilities,
|
||||
}
|
||||
return M
|
|
@ -3,36 +3,12 @@ return {
|
|||
name = "catppuccin",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
init = function()
|
||||
vim.opt.termguicolors = true
|
||||
require "ui.fillchars"
|
||||
require("catppuccin").setup {
|
||||
flavour = "macchiato",
|
||||
-- transparent_background = true,
|
||||
term_colors = true,
|
||||
dim_inactive = {
|
||||
enabled = true,
|
||||
},
|
||||
integrations = {
|
||||
dashboard = true,
|
||||
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,
|
||||
which_key = true,
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function()
|
||||
require("catppuccin").setup(require "config.catppuccin")
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,38 +1,6 @@
|
|||
return {
|
||||
"glepnir/dashboard-nvim",
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
require("dashboard").setup {
|
||||
theme = "hyper",
|
||||
config = {
|
||||
week_header = {
|
||||
enable = true,
|
||||
},
|
||||
shortcut = {
|
||||
{ desc = " Update", group = "@property", action = "Lazy update", key = "u" },
|
||||
{
|
||||
icon = " ",
|
||||
icon_hl = "@variable",
|
||||
desc = "Files",
|
||||
group = "Label",
|
||||
action = "Telescope find_files",
|
||||
key = "f",
|
||||
},
|
||||
{
|
||||
desc = " Apps",
|
||||
group = "DiagnosticHint",
|
||||
action = "Telescope app",
|
||||
key = "a",
|
||||
},
|
||||
{
|
||||
desc = " dotfiles",
|
||||
group = "Number",
|
||||
action = "Telescope dotfiles",
|
||||
key = "d",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
dependencies = { { "nvim-tree/nvim-web-devicons" } },
|
||||
config = function() require("dashboard").setup(require "config.dashboard") end,
|
||||
}
|
||||
|
|
|
@ -5,12 +5,5 @@ return {
|
|||
"DiffviewOpen",
|
||||
"DiffviewFileHistory",
|
||||
},
|
||||
config = function()
|
||||
require("diffview").setup {
|
||||
enhanced_diff_hl = true,
|
||||
file_panel = {
|
||||
listing_style = "list",
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function() require("diffview").setup(require "config.diffview") end,
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
return {
|
||||
"feline-nvim/feline.nvim",
|
||||
dependencies = { require "plugins.catppuccin" },
|
||||
config = function()
|
||||
local components = require("ui.feline_components").get()
|
||||
require("feline").setup { components = components }
|
||||
end,
|
||||
config = function() require("feline").setup(require "config.feline") end,
|
||||
}
|
||||
|
|
|
@ -1,51 +1,5 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
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,
|
||||
config = function() require("gitsigns").setup(require "config.gitsigns") end,
|
||||
}
|
||||
|
|
|
@ -1,18 +1,5 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
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,
|
||||
config = function() require("indent_blankline").setup(require "config.indent_blankline") end,
|
||||
}
|
||||
|
|
|
@ -19,7 +19,13 @@ return {
|
|||
{ "folke/neodev.nvim" },
|
||||
},
|
||||
config = function()
|
||||
require "lsp.init"
|
||||
local config = require "lsp.config"
|
||||
require("null-ls").setup {
|
||||
sources = require "lsp.null_ls_sources",
|
||||
on_attach = config.on_attach,
|
||||
flags = config.lsp_flags,
|
||||
capabilities = config.capabilities,
|
||||
}
|
||||
require "lsp.cmp"
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -9,25 +9,6 @@ return {
|
|||
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,
|
||||
},
|
||||
}
|
||||
require("neo-tree").setup(require "config.neotree")
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
return {
|
||||
"rcarriga/nvim-notify",
|
||||
config = function()
|
||||
require("notify").setup {
|
||||
background_colour = "#000000",
|
||||
}
|
||||
require("notify").setup(require "config.notify")
|
||||
vim.notify = require "notify"
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -9,12 +9,5 @@ return {
|
|||
"TestVisit",
|
||||
"TestInfo",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-test").setup {
|
||||
termOpts = {
|
||||
direction = "horizontal",
|
||||
keep_one = true,
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function() require("nvim-test").setup(require "config.nvim_test") end,
|
||||
}
|
|
@ -12,25 +12,7 @@ return {
|
|||
cmd = "Telescope",
|
||||
config = function()
|
||||
require "telescope.actions"
|
||||
local trouble = require "trouble.providers.telescope"
|
||||
|
||||
require("telescope").setup {
|
||||
defaults = {
|
||||
layout_strategy = "cursor",
|
||||
mappings = {
|
||||
i = { ["<c-t>"] = trouble.open_with_trouble },
|
||||
n = { ["<c-t>"] = trouble.open_with_trouble },
|
||||
},
|
||||
},
|
||||
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
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("telescope").setup(require "config.telescope")
|
||||
require("telescope").load_extension "fzf"
|
||||
require("telescope").load_extension "notify"
|
||||
end,
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup {
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
disable = { "fortran" },
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = function() require("nvim-treesitter.configs").setup(require "config.treesitter") end,
|
||||
}
|
||||
|
|
|
@ -2,13 +2,5 @@ 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,
|
||||
config = function() require("trouble").setup(require "config.trouble") end,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue