Merge pull request #11 from JuanZoran/experimental

增加了主题的演示
This commit is contained in:
Zoran 2023-01-25 17:23:16 +08:00 committed by GitHub
commit a86cf3e9f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 3 deletions

View File

@ -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', '<Cmd>Translate<CR>')
vim.keymap.set('n', 'mi', '<Cmd>TranslateInput<CR>')

View File

@ -3,7 +3,6 @@ local m_window
local m_result
local m_content
local engine_map = {
['本地'] = 'offline',
['百度'] = 'baidu',

View File

@ -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

BIN
theme/default.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
theme/dracula.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
theme/tokyonight.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB