Trans.nvim/lua/Trans/setup.lua
2022-12-19 22:23:12 +08:00

18 lines
475 B
Lua

local db = require("Trans").db
-- local conf = require("Trans").conf
local group = vim.api.nvim_create_augroup('closedb', { clear = true })
vim.api.nvim_create_autocmd('VimLeave', {
group = group,
pattern = '*',
callback = function()
if db:isopen() then
db:close()
end
end,
})
vim.api.nvim_create_user_command('TranslateCurosorWord', require("Trans").query_cursor, {})
-- TODO: set command to close preview window automatically