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
+13 -9
View File
@@ -16,12 +16,16 @@
-- https://github.com/fedepujol/move.nvim
local opts = { noremap = true, silent = true, }
vim.keymap.set("n", "<A-j>", function () vim.cmd.MoveLine(1) end, opts)
vim.keymap.set("n", "<A-k>", function () vim.cmd.MoveLine(-1) end, opts)
vim.keymap.set("n", "<A-h>", function () vim.cmd.MoveHChar(-1) end, opts)
vim.keymap.set("n", "<A-l>", function () vim.cmd.MoveHChar(1) end, opts)
vim.keymap.set("x", "<A-j>", ":MoveBlock(1)<CR>", opts)
vim.keymap.set("x", "<A-k>", ":MoveBlock(-1)<CR>", opts)
vim.keymap.set("x", "<A-h>", ":MoveHBlock(-1)<CR>", opts)
vim.keymap.set("x", "<A-l>", ":MoveHBlock(1)<CR>", opts)
local function setup()
local opts = { noremap = true, silent = true, }
vim.keymap.set("n", "<A-j>", function () vim.cmd.MoveLine(1) end, opts)
vim.keymap.set("n", "<A-k>", function () vim.cmd.MoveLine(-1) end, opts)
vim.keymap.set("n", "<A-h>", function () vim.cmd.MoveHChar(-1) end, opts)
vim.keymap.set("n", "<A-l>", function () vim.cmd.MoveHChar(1) end, opts)
vim.keymap.set("x", "<A-j>", ":MoveBlock(1)<CR>", opts)
vim.keymap.set("x", "<A-k>", ":MoveBlock(-1)<CR>", opts)
vim.keymap.set("x", "<A-h>", ":MoveHBlock(-1)<CR>", opts)
vim.keymap.set("x", "<A-l>", ":MoveHBlock(1)<CR>", opts)
end
return setup