kickstart.nvim/lua/custom/plugins/translation.lua

24 lines
561 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 翻译
-- 选中内容后leader [T]ranslate
-- NOTE: 弹出窗中 `g?` 查看操作帮助
return {
'potamides/pantran.nvim',
config = function()
local pantran = require 'pantran'
pantran.setup {
default_engine = 'google',
engines = {
google = {
fallback = {
default_source = 'auto',
default_target = 'zh',
},
},
},
}
vim.keymap.set('x', '<leader>t', pantran.motion_translate, { noremap = true, silent = true, expr = true, desc = '[T]ranslate' })
end,
}