2022-02-09 21:20:34 +01:00
|
|
|
local M = {}
|
|
|
|
|
2022-05-10 14:28:36 +02:00
|
|
|
function M.global(name, value) vim.g[name] = value end
|
2022-02-09 21:20:34 +01:00
|
|
|
|
2022-03-09 19:03:04 +01:00
|
|
|
function M.mergeTables(t1, t2)
|
|
|
|
local t3 = {}
|
|
|
|
|
2022-05-10 14:28:36 +02:00
|
|
|
if t1 ~= nil then for k, v in pairs(t1) do t3[k] = v end end
|
2022-03-09 19:44:21 +01:00
|
|
|
|
2022-05-10 14:28:36 +02:00
|
|
|
if t2 ~= nil then for k, v in pairs(t2) do t3[k] = v end end
|
2022-03-09 19:03:04 +01:00
|
|
|
|
|
|
|
return t3
|
|
|
|
end
|
|
|
|
|
2022-05-10 14:28:36 +02:00
|
|
|
function M.saveCursor(callback)
|
2022-05-10 15:11:08 +02:00
|
|
|
local cursor = vim.api.nvim_win_get_cursor(0)
|
2022-05-10 14:28:36 +02:00
|
|
|
callback()
|
2022-05-10 15:11:08 +02:00
|
|
|
vim.api.nvim_win_set_cursor(0, cursor)
|
2022-05-10 14:28:36 +02:00
|
|
|
end
|
|
|
|
|
2022-02-09 21:20:34 +01:00
|
|
|
return M
|