diff --git a/README.md b/README.md index 4b90469..9aa93b6 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,23 @@ - 本地词库单词量: `430w` ## 屏幕截图 +### 演示 https://user-images.githubusercontent.com/107862700/213752097-2eee026a-ddee-4531-bf80-ba2cbc8b44ef.mp4 +### 主题 +> 如果你有更美观或者更适合的配色, 欢迎提PR +> 主题配色在: `lua/theme.lua`文件中,你只需要添加你主题的表就可以了 + + +- `default` +![default](./theme/default.png) + +- `dracula` +![dracula](./theme/dracula.png) + +- `tokyonight` +![tokyonight](./theme/tokyonight.png) + ## 安装 *安装之前, 首先需要明确本插件的依赖:* @@ -255,7 +270,6 @@ require'Trans'.setup { **示例:** > 示例中展示, 将`mm`映射成快捷键 ```lua --- normal-mode vim.keymap.set({'n', 'v'}, 'mm', 'Translate') vim.keymap.set('n', 'mi', 'TranslateInput') diff --git a/lua/Trans/view/float.lua b/lua/Trans/view/float.lua index 650335a..44862c8 100644 --- a/lua/Trans/view/float.lua +++ b/lua/Trans/view/float.lua @@ -3,7 +3,6 @@ local m_window local m_result local m_content - local engine_map = { ['本地'] = 'offline', ['百度'] = 'baidu', diff --git a/lua/Trans/window.lua b/lua/Trans/window.lua index 99f6c2a..c544ef4 100644 --- a/lua/Trans/window.lua +++ b/lua/Trans/window.lua @@ -264,7 +264,9 @@ return function(entry, option) win:bufset('buftype', 'nofile') api.nvim_win_set_hl_ns(win.winid, win.hl) - win:set('winhl', 'Normal:TransWin,FloatBorder:TransBorder,NormalFloat:TransBorder') + win:set_hl('Normal', { link = 'TransWin' }) + win:set_hl('FloatBorder', { link = 'TransBorder' }) + win:set_hl('NormalFloat', { link = 'TransBorder' }) ---@diagnostic disable-next-line: return-type-mismatch return win end diff --git a/theme/default.png b/theme/default.png new file mode 100644 index 0000000..c66ec92 Binary files /dev/null and b/theme/default.png differ diff --git a/theme/dracula.png b/theme/dracula.png new file mode 100644 index 0000000..80e7257 Binary files /dev/null and b/theme/dracula.png differ diff --git a/theme/tokyonight.png b/theme/tokyonight.png new file mode 100644 index 0000000..a2e3328 Binary files /dev/null and b/theme/tokyonight.png differ