docs: change the setup exmaple

This commit is contained in:
JuanZoran 2023-01-14 10:37:21 +08:00
parent 6cff1713cb
commit fdd4f23181

132
README.md
View File

@ -96,102 +96,62 @@ use {
## 配置 ## 配置
```lua ```lua
require'Trans'.setu{ require'Trans'.setup {
style = { view = {
ui = { input = 'hover',
input = 'float', n = 'hover',
n = 'cursor', v = 'hover',
v = 'cursor' },
window = {
border = 'rounded',
hover = {
width = 36,
height = 23,
}, },
window = { float = {
cursor = { width = 0.8,
border = 'rounded', height = 0.8,
width = 50, -- 最大宽高
height = 50,
},
float = {
border = 'rounded',
width = 0.9, -- 相对宽高
height = 0.8,
},
limit = nil,
}, },
}, },
order = { order = {
offline = { -- offline = {
'Title', 'title',
'Tag', 'tag',
'Pos', 'pos',
'Exchange', 'exchange',
'Translation', 'translation',
-- NOTE :如果你想限制某个组件的行数可以设置max_size -- NOTE :如果你想限制某个组件的行数可以设置max_size
-- { 'Definition', max_size = 4 }, -- TODO : better format -- { 'Definition', max_size = 4 },
}, 'definition',
-- },
-- online = { -- online = {
-- -- TODO -- -- TODO
-- }, -- },
}, },
ui = { icon = {
highlight = { star = '',
TransWord = { notfound = '',
fg = '#7ee787', yes = '',
bold = true, no = ''
}, -- star = '⭐',
TransPhonetic = { -- notfound = '❔',
link = 'Linenr' -- yes = '✔️',
}, -- no = '❌'
TransRef = {
fg = '#75beff',
bold = true,
},
TransTag = {
fg = '#e5c07b',
},
TransExchange = {
link = 'TransTag',
},
TransPos = {
link = 'TransTag',
},
TransTranslation = {
link = 'TransWord',
},
TransDefinition = {
-- fg = '#bc8cff',
link = 'Moremsg',
},
TransCursorWin = {
link = 'Normal',
},
TransCursorBorder = {
link = 'FloatBorder',
}
},
icon = {
star = '⭐',
isOxford = '✔',
notOxford = ''
},
display = {
phnoetic = true,
collins = true,
oxford = true,
-- TODO
-- history = false,
},
}, },
base = { db_path = '$HOME/.vim/dict/ultimate.db',
db_path = '$HOME/.vim/dict/ultimate.db', -- TODO :
auto_close = true, -- engine = {
engine = {
-- TODO
'offline',
}
},
-- map = {
-- -- TODO -- -- TODO
-- }, -- 'offline',
-- }
map = {
-- TODO
hover = {
pageup = '<C-u>',
pagedown = '<C-d>',
},
},
-- history = { -- history = {
-- -- TOOD -- -- TOOD
-- } -- }