nvim/lua/G.lua

40 lines
655 B
Lua
Raw Normal View History

2023-01-24 22:27:07 +08:00
local G = {}
2023-10-02 22:05:38 +08:00
G.g = vim.g
G.b = vim.b
G.o = vim.o
G.fn = vim.fn
G.api = vim.api
G.opt = vim.opt
2023-03-19 00:22:18 +08:00
G.loop = vim.loop
2023-10-02 22:05:38 +08:00
G.lb = vim.lsp.buf
2023-10-04 17:04:01 +08:00
G.dic = vim.diagnostic
G.cgp = vim.nvim_create_augroup
2023-01-24 22:27:07 +08:00
function G.map(maps)
for _,map in pairs(maps) do
2023-10-09 16:48:02 +08:00
vim.keymap.set(map[1], map[2], map[3], map[4])
--G.api.nvim_set_keymap(map[1], map[2], map[3], map[4])
2023-01-24 22:27:07 +08:00
end
end
function G.cmd(cmd)
G.api.nvim_command(cmd)
end
function G.exec(c)
G.api.nvim_exec(c)
end
function G.eval(c)
return G.api.nvim_eval(c)
end
2023-10-09 17:01:31 +08:00
function G.au(even, opts)
return G.api.nvim_create_autocmd(even, opts)
2023-01-28 15:59:16 +08:00
end
2023-01-28 15:11:37 +08:00
G.g.mapleader = ' '
2023-01-24 22:27:07 +08:00
return G