Auto generate docs
This commit is contained in:
parent
35807247ff
commit
a5164bf052
@ -1,4 +1,4 @@
|
|||||||
*Trans.txt* For NVIM v0.8.0 Last change: 2023 March 09
|
*Trans.txt* For NVIM v0.8.0 Last change: 2023 March 10
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *Trans-table-of-contents*
|
Table of Contents *Trans-table-of-contents*
|
||||||
@ -93,7 +93,7 @@ _安装之前, 首先需要明确本插件的依赖:_
|
|||||||
|
|
||||||
|
|
||||||
- ECDICT <https://github.com/skywind3000/ECDICT>: 插件所用的离线单词数据库
|
- ECDICT <https://github.com/skywind3000/ECDICT>: 插件所用的离线单词数据库
|
||||||
- sqlite.lua: 操作数据库所用的库
|
- sqlite.lua <https://github.com/kkharji/sqlite.lua>: 操作数据库所用的库
|
||||||
- sqlite3: 数据库
|
- sqlite3: 数据库
|
||||||
|
|
||||||
Packer.nvim ~
|
Packer.nvim ~
|
||||||
@ -101,8 +101,8 @@ Packer.nvim ~
|
|||||||
>lua
|
>lua
|
||||||
use {
|
use {
|
||||||
'JuanZoran/Trans.nvim'
|
'JuanZoran/Trans.nvim'
|
||||||
run = 'bash ./install.sh',
|
run = function() require('Trans').install() end, -- 自动下载使用的本地词库
|
||||||
requires = 'kkharji/sqlite.lua',
|
requires = { 'kkharji/sqlite.lua', 'nvim-lua/plenary.nvim' },
|
||||||
-- 如果你不需要任何配置的话, 可以直接按照下面的方式启动
|
-- 如果你不需要任何配置的话, 可以直接按照下面的方式启动
|
||||||
config = function ()
|
config = function ()
|
||||||
require'Trans'.setup{
|
require'Trans'.setup{
|
||||||
@ -122,8 +122,8 @@ Packer.nvim ~
|
|||||||
{ {'n', 'x'}, 'mk' },
|
{ {'n', 'x'}, 'mk' },
|
||||||
{ 'n', 'mi' },
|
{ 'n', 'mi' },
|
||||||
},
|
},
|
||||||
run = 'bash ./install.sh', -- 自动下载使用的本地词库
|
run = function() require('Trans').install() end, -- 自动下载使用的本地词库
|
||||||
requires = 'kkharji/sqlite.lua',
|
requires = { 'kkharji/sqlite.lua', 'nvim-lua/plenary.nvim' },
|
||||||
config = function()
|
config = function()
|
||||||
require("Trans").setup {} -- 启动Trans
|
require("Trans").setup {} -- 启动Trans
|
||||||
vim.keymap.set({"n", 'x'}, "mm", '<Cmd>Translate<CR>', { desc = ' Translate' }) -- 自动判断virtual 还是 normal 模式
|
vim.keymap.set({"n", 'x'}, "mm", '<Cmd>Translate<CR>', { desc = ' Translate' }) -- 自动判断virtual 还是 normal 模式
|
||||||
@ -146,7 +146,7 @@ Lazy.nvim ~
|
|||||||
-- 目前这个功能的视窗还没有做好,可以在配置里将view.i改成hover
|
-- 目前这个功能的视窗还没有做好,可以在配置里将view.i改成hover
|
||||||
{ 'mi', '<Cmd>TranslateInput<CR>', desc = ' Translate From Input' },
|
{ 'mi', '<Cmd>TranslateInput<CR>', desc = ' Translate From Input' },
|
||||||
},
|
},
|
||||||
dependencies = { 'kkharji/sqlite.lua', lazy = true },
|
dependencies = { 'kkharji/sqlite.lua', 'nvim-lua/plenary.nvim' },
|
||||||
opts = {
|
opts = {
|
||||||
-- your configuration there
|
-- your configuration there
|
||||||
}
|
}
|
||||||
@ -178,8 +178,8 @@ Lazy.nvim ~
|
|||||||
其他操作系统
|
其他操作系统
|
||||||
- 需要确保安装了`nodejs`
|
- 需要确保安装了`nodejs`
|
||||||
- 进入插件的`tts`目录运行`npm install`
|
- 进入插件的`tts`目录运行`npm install`
|
||||||
> 如果`install.sh`运行正常则自动安装,如果安装失败,请尝试手动安装
|
> 如果`install`运行正常则自动安装,如果安装失败,请尝试手动安装
|
||||||
- `title`的配置,只对`neovim 0.9`版本有效
|
- `title`的配置,只对`neovim 0.9+`版本有效
|
||||||
|
|
||||||
Festival配置(仅针对linux用户) ~
|
Festival配置(仅针对linux用户) ~
|
||||||
|
|
||||||
@ -224,7 +224,11 @@ Festival配置(仅针对linux用户) ~
|
|||||||
width = 37,
|
width = 37,
|
||||||
height = 27,
|
height = 27,
|
||||||
border = 'rounded',
|
border = 'rounded',
|
||||||
title = title,
|
title = vim.fn.has('nvim-0.9') == 1 and {
|
||||||
|
{ '', 'TransTitleRound' },
|
||||||
|
{ ' Trans', 'TransTitle' },
|
||||||
|
{ '', 'TransTitleRound' },
|
||||||
|
} or nil,
|
||||||
keymap = {
|
keymap = {
|
||||||
pageup = '[[',
|
pageup = '[[',
|
||||||
pagedown = ']]',
|
pagedown = ']]',
|
||||||
@ -246,32 +250,10 @@ Festival配置(仅针对linux用户) ~
|
|||||||
'BufLeave',
|
'BufLeave',
|
||||||
},
|
},
|
||||||
auto_play = true,
|
auto_play = true,
|
||||||
timeout = 3000,
|
timeout = 2000,
|
||||||
spinner = 'dots', -- 查看所有样式: /lua/Trans/util/spinner
|
spinner = 'dots', -- 查看所有样式: /lua/Trans/util/spinner
|
||||||
-- spinner = 'moon'
|
-- spinner = 'moon'
|
||||||
},
|
},
|
||||||
float = {
|
|
||||||
width = 0.8,
|
|
||||||
height = 0.8,
|
|
||||||
border = 'rounded',
|
|
||||||
title = title,
|
|
||||||
keymap = {
|
|
||||||
quit = 'q',
|
|
||||||
},
|
|
||||||
animation = {
|
|
||||||
open = 'fold',
|
|
||||||
close = 'fold',
|
|
||||||
interval = 10,
|
|
||||||
},
|
|
||||||
tag = {
|
|
||||||
wait = '#519aba',
|
|
||||||
fail = '#e46876',
|
|
||||||
success = '#10b981',
|
|
||||||
},
|
|
||||||
engine = {
|
|
||||||
'本地',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
order = { -- only work on hover mode
|
order = { -- only work on hover mode
|
||||||
'title',
|
'title',
|
||||||
'tag',
|
'tag',
|
||||||
@ -285,8 +267,8 @@ Festival配置(仅针对linux用户) ~
|
|||||||
notfound = ' ',
|
notfound = ' ',
|
||||||
yes = '✔',
|
yes = '✔',
|
||||||
no = '',
|
no = '',
|
||||||
-- --- char: ■ | □ | ▇ | ▏ ▎ ▍ ▌ ▋ ▊ ▉ █
|
-- --- char: ■ | □ | ▇ | ▏ ▎ ▍ ▌ ▋ ▊ ▉ █
|
||||||
-- --- ◖■■■■■■■◗▫◻ ▆ ▆ ▇⃞ ▉⃞
|
-- --- ◖■■■■■■■◗▫◻ ▆ ▆ ▇⃞ ▉⃞
|
||||||
cell = '■',
|
cell = '■',
|
||||||
-- star = '⭐',
|
-- star = '⭐',
|
||||||
-- notfound = '❔',
|
-- notfound = '❔',
|
||||||
@ -294,30 +276,26 @@ Festival配置(仅针对linux用户) ~
|
|||||||
-- no = '❌'
|
-- no = '❌'
|
||||||
},
|
},
|
||||||
theme = 'default',
|
theme = 'default',
|
||||||
-- theme = 'dracula',
|
dir = vim.fn.expand('$HOME/.vim/dict'),
|
||||||
-- theme = 'tokyonight',
|
-- float = {
|
||||||
|
-- width = 0.8,
|
||||||
db_path = '$HOME/.vim/dict/ultimate.db',
|
-- height = 0.8,
|
||||||
|
-- border = 'rounded',
|
||||||
engine = {
|
-- keymap = {
|
||||||
-- baidu = {
|
-- quit = 'q',
|
||||||
-- appid = '',
|
-- },
|
||||||
-- appPasswd = '',
|
-- animation = {
|
||||||
-- },
|
-- open = 'fold',
|
||||||
-- -- youdao = {
|
-- close = 'fold',
|
||||||
-- appkey = '',
|
-- interval = 10,
|
||||||
-- appPasswd = '',
|
-- },
|
||||||
-- },
|
-- tag = {
|
||||||
},
|
-- wait = '#519aba',
|
||||||
|
-- fail = '#e46876',
|
||||||
-- TODO :
|
-- success = '#10b981',
|
||||||
-- register word
|
-- },
|
||||||
-- history = {
|
-- },
|
||||||
-- -- TOOD
|
}
|
||||||
-- }
|
|
||||||
|
|
||||||
-- TODO :add online translate engine
|
|
||||||
}
|
|
||||||
<
|
<
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user