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-14 01:57:12 +08:00
|
|
|
vim.api.nvim_create_user_command('Translate', function()
|
2023-01-09 23:20:56 +08:00
|
|
|
require("Trans").translate()
|
2023-01-16 13:23:25 +08:00
|
|
|
end, { desc = ' 单词翻译', })
|
2022-12-20 10:22:28 +08:00
|
|
|
|
2023-01-14 01:57:12 +08:00
|
|
|
vim.api.nvim_create_user_command('TranslateInput', function()
|
2023-01-19 17:06:26 +08:00
|
|
|
require("Trans").translate('i')
|
2023-01-14 01:57:12 +08:00
|
|
|
end, { desc = ' 搜索翻译' })
|
|
|
|
|
2023-01-19 17:06:26 +08:00
|
|
|
-- vim.api.nvim_create_user_command('TranslateLast', function()
|
|
|
|
-- require("Trans").translate('last')
|
|
|
|
-- end, { desc = ' 显示上一次查询的内容' })
|
2023-01-14 17:16:49 +08:00
|
|
|
|
2023-01-19 17:06:26 +08:00
|
|
|
local hls = {
|
2023-01-14 01:57:12 +08:00
|
|
|
TransWord = {
|
|
|
|
fg = '#7ee787',
|
|
|
|
bold = true,
|
|
|
|
},
|
|
|
|
TransPhonetic = {
|
|
|
|
link = 'Linenr'
|
|
|
|
},
|
2023-01-14 10:29:01 +08:00
|
|
|
TransTitle = {
|
|
|
|
fg = '#0f0f15',
|
|
|
|
bg = '#75beff',
|
2023-01-14 14:22:25 +08:00
|
|
|
bold = true,
|
2023-01-14 10:29:01 +08:00
|
|
|
},
|
|
|
|
TransTitleRound = {
|
2023-01-14 01:57:12 +08:00
|
|
|
fg = '#75beff',
|
|
|
|
},
|
|
|
|
TransTag = {
|
|
|
|
fg = '#e5c07b',
|
|
|
|
},
|
|
|
|
TransExchange = {
|
|
|
|
link = 'TransTag',
|
|
|
|
},
|
|
|
|
TransPos = {
|
|
|
|
link = 'TransTag',
|
|
|
|
},
|
|
|
|
TransTranslation = {
|
|
|
|
link = 'TransWord',
|
|
|
|
},
|
|
|
|
TransDefinition = {
|
|
|
|
link = 'Moremsg',
|
|
|
|
},
|
2023-01-14 19:35:13 +08:00
|
|
|
TransWin = {
|
2023-01-14 01:57:12 +08:00
|
|
|
link = 'Normal',
|
|
|
|
},
|
2023-01-14 19:35:13 +08:00
|
|
|
TransBorder = {
|
2023-01-14 01:57:12 +08:00
|
|
|
link = 'FloatBorder',
|
2023-01-14 10:29:01 +08:00
|
|
|
},
|
|
|
|
TransCollins = {
|
|
|
|
fg = '#faf743',
|
|
|
|
bold = true,
|
|
|
|
},
|
2023-01-16 13:23:25 +08:00
|
|
|
TransFailed = {
|
2023-01-14 14:22:25 +08:00
|
|
|
fg = '#7aa89f',
|
|
|
|
},
|
2023-01-14 01:57:12 +08:00
|
|
|
}
|
2023-01-09 23:20:56 +08:00
|
|
|
|
2023-01-19 17:06:26 +08:00
|
|
|
for hl, opt in pairs(hls) do
|
|
|
|
vim.api.nvim_set_hl(0, hl, opt)
|
2023-01-04 22:22:52 +08:00
|
|
|
end
|