VIM怎么添加CTRL+/为快捷键
高洛峰
高洛峰 2017-05-16 16:40:45
[PhpStudy讨论组]

我想使用ctrl+/作为当前行注释的快捷键
添加nmap <C-/> ,cc无效,但是反斜杠\是可以的
希望大家帮我看看

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

全部回复(1)
PHP中文网

vim中不能使用 ctrl+/ 作为快捷键.

You can't map Ctrl-/ in Vim because the only "Ctrl+printable key" characters which can be reliably mapped in Vim are those defined by the (already rather old) ASCII standard, which means the only printable keys which have a Ctrl counterpart are 0x3F to 0x5F plus the lowercase letters, as follows:

Ctrl+? (0x3F) = DEL (0x7F)
Ctrl+(key 0x40-0x5F) = subtract 0x40 from the printable character
Ctrl+lowercase = Ctrl+ the corresponding uppercase.

Nothing else. No Ctrl+digit and no Ctrl+slash (where / = 0x2F).

BTW, the above also explains why Vim cannot discriminate between

Ctrl-I and Tab (both 0x09, HT)
Ctrl-M and Enter (both 0x0D, CR)
Ctrl-[ and Esc (both 0x1B, ESC)

懒得翻译了,来自这里.

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号