nvim-macrotool/lua/macrotool/init.lua

31 lines
622 B
Lua

local M = {}
local api = vim.api
local keystrokes = {}
-- Only for debugging
if vim == nil then
vim = {}
end
function Macrochain()
-- vim.print(table.concat(keystrokes, ""))
vim.print("Hello world")
end
-- @name record_keystroke
-- @param mapped_key
-- @param raw_key
-- @short Add mapped_key to keystrokes
local record_keystroke = function(mapped_key)
table.insert(keystrokes, mapped_key)
-- if #keystrokes > 60 then
-- local temp_keystrokes = {}
-- for i = 31, #keystrokes do
-- table.insert(temp_keystrokes, keystrokes[i])
-- end
-- keystrokes = temp_keystrokes
-- end
end
vim.on_key(record_keystroke)