假 Vim

要设置 Vim 风格编辑的首选项,请转至首选项>FakeVim

设置 Vim 行为

要设置 Vim 行为,请转至首选项>FakeVim >General

FakeVim 偏好设置中的常规选项卡

使用预设

  • 要预选为文本编辑器指定的缩进设置,请选择Copy Text Editor Settings
  • 要预选 Qt XML 编码样式,请选择Set Qt Style
  • 要预选简单的缩进样式,请选择Set Plain Style

然后更改预选设置。

模拟插件

Plugin Emulation 中选择流行的 vim 插件进行模拟。

下表描述了可用的插件及其链接。

Vim 插件说明
vim-commentarygc 对代码区域进行注释的操作。例如 , 、gcc gc2j gcip
ReplaceWithRegister
  • [count]["x]gr{motion} 将 替换为寄存器 的内容。motion x
  • ["x]grr 替换当前行。
argtextobj.vim为函数参数定义iaaa 文本对象。
vim-exchangevim 的文本交换操作符。
vim-surround添加用于删除、添加和更改周围环境的映射。

映射 FakeVim 命令

FakeVim 命令行中输入的命令映射到Qt Creator 函数:

  1. 转至首选项>FakeVim >Ex Command Mapping
  2. Filter 字段中输入字符串,查找Qt Creator 函数。

    FakeVim 偏好设置中的 Ex 命令映射选项卡

  3. 在列表中选择一个函数
  4. Regular expression 字段中输入将触发函数的字符串。

    您可以在Ex Trigger Expression 字段中看到触发表达式。

要删除选定的触发表达式,请选择Reset

要重置所有函数的触发表达式,请选择Reset All

映射用户命令

要将用户命令映射到键盘快捷键,请转到首选项>FakeVim >User Command Mapping 。映射到快捷键的用户命令会被 FakeVim 执行,就像你在输入一样(就像重播宏一样)。

用户命令映射选项卡 FakeVim 偏好设置

另请参阅 像在 VimFakeVim 模式和命令中一样编辑

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.