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

相关推荐
dessler1 小时前
Kubernetes(k8s)-集群监控(Prometheus)
linux·运维·kubernetes
一夜沐白1 小时前
Linux用户管理
linux·运维·服务器·笔记
ykjhr_3d1 小时前
展销编辑器在未来的发展前景
编辑器
PLUS_WAVE1 小时前
【Tools】chezmoi 跨多台不同的机器管理 dotfiles 的工具
linux·服务器·软件工程·工具·chezmoi
唐青枫3 小时前
Linux man 命令使用教程
linux
珹洺3 小时前
Linux红帽:RHCSA认证知识讲解(十 四)分区管理、交换分区,创建逻辑卷与调整逻辑卷的大小
linux·运维·服务器
威桑3 小时前
解决Ubuntu下使用CLion构建Qt项目时找不到已安装的模块的问题
linux·运维·ubuntu
2301_787552873 小时前
AI-Browser适用于 ChatGPT、Gemini、Claude、DeepSeek、Grok的客户端开源应用程序,集成了 Monaco 编辑器。
人工智能·chatgpt·自动化·编辑器·deepseek
PLUS_WAVE4 小时前
【SSH 端口转发】通过SSH端口转发实现访问远程服务器的 tensorboard
linux·服务器·ssh·软件工程·端口转发·tensorboard
珹洺5 小时前
Linux操作系统从入门到实战(四)Linux基础指令(下)
linux·运维·服务器