Format neovim config with stylua using new stylua.toml config

This commit is contained in:
2022-01-22 12:10:28 +03:00
parent 1a29e2858a
commit 8b75b3b1ea
10 changed files with 324 additions and 317 deletions

View File

@@ -1,41 +1,41 @@
local M = {}
local function map(mode, shortcut, command, additional_opts)
local opts = { noremap = true, silent = true }
local opts = { noremap = true, silent = true }
if opts then
opts = vim.tbl_extend("force", opts, additional_opts)
end
if opts then
opts = vim.tbl_extend("force", opts, additional_opts)
end
vim.api.nvim_set_keymap(mode, shortcut, command, opts)
vim.api.nvim_set_keymap(mode, shortcut, command, opts)
end
M.nmap = function(shortcut, command, opts)
opts = opts or {}
opts = opts or {}
map("n", shortcut, command, opts)
map("n", shortcut, command, opts)
end
M.vmap = function(shortcut, command, opts)
opts = opts or {}
opts = opts or {}
map("v", shortcut, command, opts)
map("v", shortcut, command, opts)
end
M.tmap = function(shortcut, command, opts)
opts = opts or {}
opts = opts or {}
map("t", shortcut, command, opts)
map("t", shortcut, command, opts)
end
M.list_includes_item = function(list, item)
for _, value in pairs(list) do
if value == item then
return true
end
end
for _, value in pairs(list) do
if value == item then
return true
end
end
return false
return false
end
return M