chore: add misc file

This commit is contained in:
JuanZoran
2023-03-07 21:52:29 +08:00
parent 7dbf3b17be
commit e9f5f7f160
4 changed files with 104 additions and 55 deletions

13
plugin/Trans.lua Normal file
View File

@ -0,0 +1,13 @@
local api = vim.api
local M = require('Trans')
local new_command = api.nvim_create_user_command
new_command('Translate', function() M.translate() end, { desc = ' 单词翻译', })
new_command('TranslateInput', function() M.translate('i') end, { desc = ' 搜索翻译', })
new_command('TransPlay', function()
local word = M.get_word(api.nvim_get_mode().mode)
if word ~= '' and word:isEn() then
word:play()
end
end, { desc = ' 自动发音' })