# translate.nvim **Repository Path**: uchenily/translate.nvim ## Basic Information - **Project Name**: translate.nvim - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-14 - **Last Updated**: 2024-04-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # translate.nvim 学习目的: 体验neovim使用lua开发插件流程 `:h lua-guide` plugin目录: 启动时自动加载 lua目录: 运行时通过require按需加载 怎样重新加载一个lua模块? ```lua package.loaded['myluamodule'] = nil require('myluamodule') -- read and execute the module again from disk ``` `vim.opt` vs `vim.o` ```lua vim.opt.listchars = { space = '_', tab = '>~' } -- 等价于vimscript: -- set listchars=space:_,tab:>~ ``` 提供append/prepend/remove等方法(分别对应 :set+=, :set^=, :set-=), 但是这样做的代价就是没法直接通过 vim.opt.xxx 直接得到值, 只能使用: `:lua vim.print(vim.opt.listchars:get())` 但`vim.o` 就像一个直接变量一样能直接访问: `:lua vim.print(vim.o.listchars)` `vim.o.listchars = 'space:_,tab:>~'` **参考** [原始项目](https://github.com/JuanZoran/Trans.nvim.git)