简体   繁体   English

<C-S>在Vim终端中映射问题

[英]<C-S> mapping in Vim terminal issues

I am having issues trying to map <CS> in Vim terminal. 我在尝试在Vim终端中映射<CS>时遇到问题。

The same mapping works in MacVim/gVim but not in the terminal. 相同的映射在MacVim / gVim中有效,但在终端中无效。 I have tried the below mappings in Terminal.app and the latest version of iterm2 and it fails to work. 我已经在Terminal.app和最新版本的iterm2中尝试了以下映射,但无法正常工作。

Is using <CS> a bad idea because of terminal issues? 由于终端问题,使用<CS>是个坏主意吗? 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. 不过要注意的是,上面的映射中的MacVim / gVim的工作 ,但不是在终端。

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? 有什么选择?

<Cs> and <Cq> have been used for decades to do software flow control . <Cs>和<Cq>已经使用了数十年来进行软件流控制 You'll probably want to avoid mapping those key sequences in general. 通常,您可能要避免映射那些键序列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM