Make all plugin configs return a function

Simplifies writing the `config = ...` field for each plugin
This commit is contained in:
2023-09-25 16:08:06 +02:00
parent 7739ec5591
commit ac35b77c87
33 changed files with 747 additions and 618 deletions
+43 -39
View File
@@ -16,44 +16,48 @@
-- https://github.com/rcarriga/nvim-dap-ui
require("dapui").setup({
icons = { expanded = "", collapsed = "", },
mappings = {
-- Use a table to apply multiple mappings
expand = { "<CR>", "<2-LeftMouse>", },
open = "o",
remove = "d",
edit = "e",
repl = "r",
toggle = "t",
},
layouts = {
{
elements = {
"scopes",
"breakpoints",
"stacks",
"watches",
},
size = 40,
position = "left",
},
{
elements = {
"repl",
"console",
},
size = 10,
position = "bottom",
},
},
floating = {
max_height = nil, -- These can be integers or a float between 0 and 1.
max_width = nil, -- Floats will be treated as percentage of your screen.
border = "single", -- Border style. Can be "single", "double" or "rounded"
local function setup()
require("dapui").setup({
icons = { expanded = "", collapsed = "", },
mappings = {
close = { "q", "<Esc>", },
-- Use a table to apply multiple mappings
expand = { "<CR>", "<2-LeftMouse>", },
open = "o",
remove = "d",
edit = "e",
repl = "r",
toggle = "t",
},
},
windows = { indent = 1, },
})
layouts = {
{
elements = {
"scopes",
"breakpoints",
"stacks",
"watches",
},
size = 40,
position = "left",
},
{
elements = {
"repl",
"console",
},
size = 10,
position = "bottom",
},
},
floating = {
max_height = nil, -- These can be integers or a float between 0 and 1.
max_width = nil, -- Floats will be treated as percentage of your screen.
border = "single", -- Border style. Can be "single", "double" or "rounded"
mappings = {
close = { "q", "<Esc>", },
},
},
windows = { indent = 1, },
})
end
return setup