Neovim插入模式,注入预定义文本(Elixir Pipe Operator)
我想在插入模式下复制Rstudio的“插入管道操作员”热键。 当点击< cm>
时,我希望要输入以下符号:|>
。
这可能吗?
我尝试了以下内容:
# Keybind function
local function map(mode, lhs, rhs, opts)
local options = {noremap = true}
if opts then options = vim.tbl_extend('force', options, opts) end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
# Not working
map('i', '<C-M>', '|>')
I would like to replicate RStudio's "insert pipe operator" hotkey in insert mode.
When hitting <C-M>
, I would like the following symbols to be typed: |>
.
Is this possible?
I have tried the following:
# Keybind function
local function map(mode, lhs, rhs, opts)
local options = {noremap = true}
if opts then options = vim.tbl_extend('force', options, opts) end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
# Not working
map('i', '<C-M>', '|>')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的示例的问题是Neovim已经在使用
&lt; cm&gt;
。以下工作:
The issue with my example was that
<C-m>
is already in use by neovim.The following works: