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: 源码和问题反馈

相关推荐
JiMoKuangXiangQu21 分钟前
Linux 锁 (4) - seqlock
linux·seqlock
xlp666hub38 分钟前
如果操作GPIO可能导致休眠,那么同步机制绝不能采用spinlock
linux·面试
RisunJan1 小时前
Linux命令-mkbootdisk(可建立目前系统的启动盘)
linux·运维·服务器
朽棘不雕2 小时前
Linux工具(上)
linux·运维·服务器
BestOrNothing_20152 小时前
Ubuntu 22.04 下调整 VS Code 界面及字体教程
linux·vscode·ubuntu22.04·界面调整
桌面运维家2 小时前
Windows/Linux云桌面:高校VDisk方案部署指南
linux·运维·windows
mzhan0173 小时前
Linux:intel:Cache Allocation tech
linux·cpu
学机械的鱼鱼3 小时前
【踩坑记录】Linux环境下FreeCAD打开后一新建就崩
linux
小璐资源网3 小时前
UPS电源管理:应对突发断电的应急方案
linux·运维·服务器
grrrr_13 小时前
【工具类】虚拟机 + Ubuntu 安全部署 OpenClaw,联动 Ollama 零成本解锁云端大模型
linux·运维·ubuntu·#openclaw·#小龙虾