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

相关推荐
活跃的煤矿打工人18 分钟前
【星海saul随笔】Ubuntu基础知识
linux·运维·ubuntu
fasewer1 小时前
第五章 linux实战-挖矿 二
linux·运维·服务器
楚灵魈1 小时前
[Linux]从零开始的网站搭建教程
linux·运维·服务器
小小不董1 小时前
《Linux从小白到高手》理论篇:深入理解Linux的网络管理
linux·运维·服务器·数据库·php·dba
这可就有点麻烦了2 小时前
强化学习笔记之【TD3算法】
linux·笔记·算法·机器学习
DY009J2 小时前
深度探索Kali Linux的精髓与实践应用
linux·运维·服务器
程序员-珍2 小时前
虚拟机ip突然看不了了
linux·网络·网络协议·tcp/ip·centos
码农小白3 小时前
linux驱动:(22)中断节点和中断函数
linux·运维·服务器
4647的码农历程3 小时前
Linux网络编程 -- 网络基础
linux·运维·网络
C++忠实粉丝4 小时前
Linux环境基础开发工具使用(2)
linux·运维·服务器