From fdd4f2318172c4c2802f113a007958bec86aa03f Mon Sep 17 00:00:00 2001 From: JuanZoran <1430359574@qq.com> Date: Sat, 14 Jan 2023 10:37:21 +0800 Subject: [PATCH] docs: change the setup exmaple --- README.md | 132 +++++++++++++++++++----------------------------------- 1 file changed, 46 insertions(+), 86 deletions(-) diff --git a/README.md b/README.md index 783b830..e5cdf7a 100644 --- a/README.md +++ b/README.md @@ -96,102 +96,62 @@ use { ## 配置 ```lua -require'Trans'.setu{ - style = { - ui = { - input = 'float', - n = 'cursor', - v = 'cursor' +require'Trans'.setup { + view = { + input = 'hover', + n = 'hover', + v = 'hover', + }, + window = { + border = 'rounded', + hover = { + width = 36, + height = 23, }, - window = { - cursor = { - border = 'rounded', - width = 50, -- 最大宽高 - height = 50, - }, - float = { - border = 'rounded', - width = 0.9, -- 相对宽高 - height = 0.8, - }, - limit = nil, + float = { + width = 0.8, + height = 0.8, }, }, + order = { - offline = { - 'Title', - 'Tag', - 'Pos', - 'Exchange', - 'Translation', - -- NOTE :如果你想限制某个组件的行数,可以设置max_size - -- { 'Definition', max_size = 4 }, -- TODO : better format - }, + -- offline = { + 'title', + 'tag', + 'pos', + 'exchange', + 'translation', + -- NOTE :如果你想限制某个组件的行数,可以设置max_size + -- { 'Definition', max_size = 4 }, + 'definition', + -- }, -- online = { -- -- TODO -- }, }, - ui = { - highlight = { - TransWord = { - fg = '#7ee787', - bold = true, - }, - TransPhonetic = { - link = 'Linenr' - }, - 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, - }, + icon = { + star = '', + notfound = '', + yes = '', + no = '' + -- star = '⭐', + -- notfound = '❔', + -- yes = '✔️', + -- no = '❌' }, - base = { - db_path = '$HOME/.vim/dict/ultimate.db', - auto_close = true, - engine = { - -- TODO - 'offline', - } - }, - -- map = { + db_path = '$HOME/.vim/dict/ultimate.db', + -- TODO : + -- engine = { -- -- TODO - -- }, + -- 'offline', + -- } + map = { + -- TODO + hover = { + pageup = '', + pagedown = '', + }, + }, -- history = { -- -- TOOD -- }