docs: add keymap desc

This commit is contained in:
JuanZoran 2022-12-21 16:59:26 +08:00
parent 8d1fc8d569
commit 2422be9df5
2 changed files with 13 additions and 4 deletions

View File

@ -109,7 +109,16 @@ require'Trans'.setup{
```
## 快捷键绑定
> TODO
**示例:**
> 示例中展示, 将`mm`映射成快捷键
```lua
-- normal-mode
vim.keymap.set('n', 'mm', '<Cmd>TranslateCurosorWord<CR>')
-- visual-mode
vim.keymap.set('v', 'mm', '<Esc><Cmd>TranslateSelectWord<CR>')
```
## 声明
- 本插件词典基于[ECDICT](https://github.com/skywind3000/ECDICT)

View File

@ -29,6 +29,6 @@ if auto_close then
end
vim.keymap.set('n', 'mm', '<cmd>TranslateCurosorWord<cr>')
vim.keymap.set('v', 'mm', '<Esc><cmd>TranslateSelectWord<cr>')
-- vim.keymap.set('n', 'mm', '<cmd>TranslateCurosorWord<cr>')
-- vim.keymap.set('v', 'mm', '<Esc><cmd>TranslateSelectWord<cr>')
require("Trans.highlight").set_hl()