refactor: add -L option for install stardict

This commit is contained in:
JuanZoran 2023-03-10 11:35:14 +08:00
parent 8dd538ba60
commit 5457809eef
3 changed files with 6 additions and 8 deletions

View File

@ -87,7 +87,7 @@ _安装之前, 首先需要明确本插件的依赖:_
use {
'JuanZoran/Trans.nvim'
run = function() require('Trans').install() end, -- 自动下载使用的本地词库
requires = { 'kkharji/sqlite.lua', 'nvim-lua/plenary.nvim' },
requires = { 'kkharji/sqlite.lua', },
-- 如果你不需要任何配置的话, 可以直接按照下面的方式启动
config = function ()
require'Trans'.setup{
@ -108,7 +108,7 @@ use {
{ 'n', 'mi' },
},
run = function() require('Trans').install() end, -- 自动下载使用的本地词库
requires = { 'kkharji/sqlite.lua', 'nvim-lua/plenary.nvim' },
requires = { 'kkharji/sqlite.lua', },
config = function()
require("Trans").setup {} -- 启动Trans
vim.keymap.set({"n", 'x'}, "mm", '<Cmd>Translate<CR>', { desc = ' Translate' }) -- 自动判断virtual 还是 normal 模式
@ -134,7 +134,7 @@ use {
-- 目前这个功能的视窗还没有做好可以在配置里将view.i改成hover
{ 'mi', '<Cmd>TranslateInput<CR>', desc = ' Translate From Input' },
},
dependencies = { 'kkharji/sqlite.lua', 'nvim-lua/plenary.nvim' },
dependencies = { 'kkharji/sqlite.lua', },
opts = {
-- your configuration there
}
@ -314,7 +314,7 @@ require'Trans'.setup {
-- success = '#10b981',
-- },
-- },
}
}
```

View File

@ -18,7 +18,7 @@ local check = function()
-- INFO :Check plugin dependencies
local plugin_dependencies = {
'plenary',
-- 'plenary',
'sqlite',
}

View File

@ -7,7 +7,7 @@ curl.get = function(uri, opts)
local output = opts.output
-- INFO :Init Curl command with {s}ilent and {G}et
local cmd = { 'curl', '-Gs' }
local cmd = { 'curl', '-GLs' }
-- INFO :Add headers
if headers then
@ -56,8 +56,6 @@ curl.get = function(uri, opts)
end
end
vim.pretty_print(table.concat(cmd, ' '))
vim.fn.jobstart(table.concat(cmd, ' '), {
stdin = 'null',
on_stdout = on_stdout,