Make all plugin configs return a function
Simplifies writing the `config = ...` field for each plugin
This commit is contained in:
+43
-39
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user