VIM Modality 接口实现
我一直在谷歌和这里搜索有关实现vim之类的模态界面(命令和插入模式)和可能的[演示]命令或击键的任何提示或技巧和技巧。有没有相关的图书馆?
I've been searching on google and here on SO for any hints or tips and tricks on implementing the vim like modality interface (the command and insert modes) and possible [demo] commands or keystrokes. Are there any libraries out there for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,我不这么认为。定义应用程序如何响应键盘是应用程序核心职责的一部分。
模态是你的应用程序如何响应击键的问题,它不是一个可以附加的神奇成分。只需让您的应用程序响应击键,如果您希望通过几次击键在输入和编辑模式(或其他模式)之间切换,则在您的应用程序中定义该功能,将其附加到按键,并可选择让您的应用程序更新状态行或者指示当前处于哪种模式的东西。
No, I don't think so. Defining how the app responds to the keyboard is part of the application's core responsibilities.
Modality is a matter of how your app responds to keystrokes, it's not a magic ingredient that can be bolted on. Just have your app respond to keystrokes, and if you want a couple of keystrokes to switch between input and edit mode (or whatever), then define that functionality in your application, attach it to the key and optionally have your app update a status line or something indicating which mode it's currently in.