1
Fork 0
satellite/dotfiles/neovim/lua/my/helpers.lua

22 lines
421 B
Lua
Raw Normal View History

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)
local cursor = vim.api.nvim_win_get_cursor()
callback()
vim.api.nvim_win_set_cursor(cursor)
end
2022-02-09 21:20:34 +01:00
return M