vim常用命令

vim常用命令

移动光标
复制代码
# hjkl
# 2w 向前移动两个单词
# 3e 向前移动到第 3 个单词的末尾
# 0 移动到行首
# $ 当前行的末尾
# gg 文件第一行
# G 文件最后一行
# 行号+G 指定行
# <ctrl>+o 跳转回之前的位置
# <ctrl>+i 返回跳转之前的位置
退出
复制代码
# <esc> 进入正常模式
# :q! 不保存退出
# :wq 保存后退出
删除
复制代码
# x 删除当前字符
# dw 删除至当前单词末尾
# de 删除至当前单词末尾,包括当前字符
# d$ 删除至当前行尾
# dd 删除整行
# 2dd 删除两行
修改
复制代码
# i 插入文本
# A 当前行末尾添加
# r 替换当前字符
# o 打开新的一行并进入插入模式
撤销
复制代码
# u 撤销
# <ctrl>+r 取消撤销
复制粘贴剪切
# v 进入可视模式
# y 复制
# p 粘贴
# yy 复制当前行
# dd 剪切当前行
状态
复制代码
#<ctrl>+g 显示当前行以及文件信息
查找
# / 正向查找(n:继续查找,N:相反方向继续查找)
# ? 逆向查找
# % 查找配对的 {,[,(
# :set ic 忽略大小写
# :set noic 取消忽略大小写
# :set hls 匹配项高亮显示
# :set is 显示部分匹配
替换
复制代码
# :s/old/new 替换该行第一个匹配串
# :s/old/new/g 替换全行的匹配串
# :%s/old/new/g 替换整个文件的匹配串
折叠
复制代码
# zc 折叠
# zC 折叠所有嵌套
# zo 展开折叠
# zO 展开所有折叠嵌套

How To Enable:

auto-switch feature is disabled by default

enable the feature with the commands below, input in normal mode:
:set keep-english-in-normal enable auto-switch feature restore input method when return insert mode
:set nokeep-english-in-normal-and-restore-in-insert keep auto-switch feature, but doesn't restore input method when return insert mode
:set nokeep-english-in-normal disable auto-switch feature

You can also addset keep-english-in-normal[-and-restore-in-insert]to the~/.ideavimrc` file and restart IDE to enable the feature.

Notice:

The plugin support MacOS and Windows and Linux(with fcitx)

MacOS need enable en_US OR ABC keyboard Windows need enable en_US keyboard Linux need fcitx-remote

GitHub RepositorySource and Feedback

为IdeaVim插件增加自动切换为英文输入法的功能

输入法自动切换功能不会默认启用

编辑器中normal模式下输入输入下面的指令以启用自动切换输入法功能:

:set keep-english-in-normal 开启输入法自动切换功能

:set keep-english-in-normal-and-restore-in-insert 回到insert模式时恢复输入法

:set nokeep-english-in-normal-and-restore-in-insert 保留输入法自动切换功能,但是回到insert模式不恢复输入法

:set nokeep-english-in-normal 关闭输入法自动切换功能

也可以通过将set keep-english-in-normal[-and-restore-in-insert]加入到~/.ideavimrc文件中并重启IDE来启用插件功能。

注意:支持MacOS和Windows, 通过fcitx-remote支持Linux

MacOS需要开启英语美国键盘或ABC键盘 Windows需要开启英语美国键盘 Linux需要使用fcitx输入法,通过fcitx-remote切换

GitHub Repository: 源码和问题反馈

相关推荐
bubiyoushang8882 小时前
Windows11 WSL2 Ubuntu编译安装perf工具
linux·运维·ubuntu
行云流水剑3 小时前
【学习记录】使用 Kali Linux 与 Hashcat 进行 WiFi 安全分析:合法的安全测试指南
linux·学习·安全
xuanwojiuxin3 小时前
linux panic-propagation
linux·运维·服务器
achene_ql6 小时前
select、poll、epoll 与 Reactor 模式
linux·服务器·网络·c++
藥瓿亭6 小时前
K8S认证|CKS题库+答案| 9. 网络策略 NetworkPolicy
linux·运维·docker·云原生·容器·kubernetes·cks
千千寰宇6 小时前
[数据传输/网络传输/序列化/计算机组成原理] 字节序/大小端
linux·计算机组成原理/硬件/半导体
LFloyue6 小时前
Linux离线(zip方式)安装docker
linux·docker
Blue桃之夭夭6 小时前
深入理解Optional:处理空指针异常
linux·windows·microsoft
什么半岛铁盒7 小时前
Linux线程与进程关系及底层实现
java·linux·运维
kooboo china.7 小时前
Tailwind CSS 实战:基于 Kooboo 构建 AI 对话框页面(八):异步处理逻辑详解
前端·css·人工智能·编辑器·html·交互