Vim 终端中的映射问题
我在尝试在 Vim 终端中映射
时遇到问题。
相同的映射在 MacVim/gVim 中有效,但在终端中无效。我已经在 Terminal.app 和最新版本的 iterm2 中尝试了以下映射,但它无法工作。
由于终端问题,使用
是一个坏主意吗?如果是的话,我不知道(并且找不到任何有关它的信息。
nnoremap <script> <buffer><C-s> :call <sid>MyPrivateFunction()<CR>
请注意,上面的映射在 MacVim/gVim 中有效,但在终端中无效。
我还尝试了以下变体
cmap <script> <buffer><C-s> call <sid>MyPrivateFunction()<CR>
map <script> <buffer><C-s> :call <sid>MyPrivateFunction()<CR>
nnoremap <C-s> :call MyFunction()<CR>
:我做错了什么?再一次,发布这样的映射是一个坏主意吗?
I am having issues trying to map <C-S>
in Vim terminal.
The same mapping works in MacVim/gVim but not in the terminal. I have tried the below mappings in Terminal.app and the latest version of iterm2 and it fails to work.
Is using <C-S>
a bad idea because of terminal issues? If it is I was not aware (and could not find any information about it.
nnoremap <script> <buffer><C-s> :call <sid>MyPrivateFunction()<CR>
Note though that the above mapping works in MacVim/gVim but not in the terminal.
I have also tried the following variations:
cmap <script> <buffer><C-s> call <sid>MyPrivateFunction()<CR>
map <script> <buffer><C-s> :call <sid>MyPrivateFunction()<CR>
nnoremap <C-s> :call MyFunction()<CR>
Am I doing something wrong? And again, is it a bad idea to issue such a mapping? What would be the alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
<C-s> and <C-q> have been used for decades to do software flow control. You'll probably want to avoid mapping those key sequences in general.