Trans.nvim/lua/Trans/setup.lua

26 lines
694 B
Lua
Raw Normal View History

2023-01-05 16:24:50 +08:00
if vim.fn.executable('sqlite3') ~= 1 then
error('Please check out sqlite3')
end
2022-12-20 10:22:28 +08:00
2023-01-09 23:20:56 +08:00
vim.api.nvim_create_user_command('Translate', function ()
require("Trans").translate()
end, {
desc = ' 单词翻译',
})
2022-12-20 10:22:28 +08:00
2023-01-09 23:20:56 +08:00
vim.api.nvim_create_user_command('TranslateInput', function ()
require("Trans").translate {
method = 'input',
}
end, {desc = ' 搜索翻译'})
2023-01-09 23:20:56 +08:00
-- TODO
-- vim.api.nvim_create_user_command('TranslateHistory', require("Trans.core").query_input, {
-- desc = '翻译输入的单词',
-- })
local highlights = require("Trans.conf.loader").loaded_conf.ui.highlight
2023-01-04 22:22:52 +08:00
for highlight, opt in pairs(highlights) do
2023-01-09 23:20:56 +08:00
vim.api.nvim_set_hl(0, highlight, opt)
2023-01-04 22:22:52 +08:00
end