diff --git a/lua/data/keys.lua b/lua/data/keys.lua index 5269225..3419bd2 100644 --- a/lua/data/keys.lua +++ b/lua/data/keys.lua @@ -295,6 +295,17 @@ M.iconpicker = { }, } +M.indentor = { + { -- Indentor + "", + function() + require("utils.indentor").insert_previous_line_indentation() + end, + "Insert Previous Line Indentation", + { "i", "n" }, + }, +} + M.lazygit = { { -- LazyGit "lg", diff --git a/lua/utils/indentor.lua b/lua/utils/indentor.lua index 47379a3..a9da137 100644 --- a/lua/utils/indentor.lua +++ b/lua/utils/indentor.lua @@ -41,20 +41,10 @@ function M.insert_previous_line_indentation() end end --- Create a keymap to trigger the function using native mappings --- vim.api.nvim_set_keymap( --- { "i", "n" }, --- "", --- "lua require('indentor').insert_previous_line_indentation()", --- { noremap = true, silent = true } --- ) - --- Create a keymap to trigger the function using Rootiest utils -require("data").func.add_keymap( - "", - M.insert_previous_line_indentation, - "Indent Line", - { "i", "n" } -) +-- Create a keymap to trigger the function +local data = require("data") +for _, map in ipairs(data.keys.indentor) do + data.func.add_keymap(map[1], map[2], map[3], map[4]) +end return M