105 lines
3.2 KiB
Lua
Raw Normal View History

local title
if vim.fn.has('nvim-0.9') == 1 then
title = {
{ '', 'TransTitleRound' },
{ ' Trans', 'TransTitle' },
{ '', 'TransTitleRound' },
}
end
2023-03-09 19:42:41 +08:00
return {
dir = os.getenv('HOME') .. '/.vim/dict',
2023-03-12 09:56:31 +08:00
strategy = {
default = {
frontend = 'hover',
backend = '*',
},
2023-03-09 19:42:41 +08:00
},
2023-03-12 09:56:31 +08:00
backend = {
default = {
timeout = 2000,
},
2023-03-09 19:42:41 +08:00
},
2023-03-12 09:56:31 +08:00
frontend = {
default = {
auto_play = true,
border = 'rounded',
animation = {
open = 'slid', -- 'fold', 'slid'
close = 'slid',
interval = 12,
},
title = title, -- need nvim-0.9
2023-03-12 09:56:31 +08:00
},
hover = {
width = 37,
height = 27,
keymap = {
2023-03-12 09:56:31 +08:00
play = '_',
pageup = '[[',
pagedown = ']]',
pin = '<leader>[',
close = '<leader>]',
toggle_entry = '<leader>;',
},
auto_close_events = {
'InsertEnter',
'CursorMoved',
'BufLeave',
},
order = {
'title',
'tag',
'pos',
'exchange',
'translation',
'definition',
},
spinner = 'dots', -- see: /lua/Trans/style/spinner
fallback_message = '翻译超时或没有找到相关的翻译' -- TODO :support replace with {{special word}}
},
2023-03-09 19:42:41 +08:00
},
2023-03-12 09:56:31 +08:00
style = {
-- see lua/Trans/style/theme.lua
theme = 'default', -- default | tokyonight | dracula
-- or use emoji
icon = {
star = '', -- ⭐
notfound = '', -- ❔
yes = '', -- ✔️
no = '', -- ❌
cell = '', -- ■ | □ | ▇ | ▏ ▎ ▍ ▌ ▋ ▊ ▉ █
},
2023-03-09 19:42:41 +08:00
},
}
-- TODO :
-- float = {
-- width = 0.8,
-- height = 0.8,
-- border = 'rounded',
-- keymap = {
-- quit = 'q',
-- },
-- animation = {
-- open = 'fold',
-- close = 'fold',
-- interval = 10,
-- },
-- tag = {
-- wait = '#519aba',
-- fail = '#e46876',
-- success = '#10b981',
-- },
-- },
2023-03-09 19:42:41 +08:00
-- local title = {
-- "████████╗██████╗ █████╗ ███╗ ██╗███████╗",
-- "╚══██╔══╝██╔══██╗██╔══██╗████╗ ██║██╔════╝",
-- " ██║ ██████╔╝███████║██╔██╗ ██║███████╗",
-- " ██║ ██╔══██╗██╔══██║██║╚██╗██║╚════██║",
-- " ██║ ██║ ██║██║ ██║██║ ╚████║███████║",
-- " ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝",
--}