vscode vim 快捷键汇总

需满足操作:

  1. 上下移动
  2. 按照 word 移动
  3. 选中增删改
  4. 查找字符/变量
  5. 移动、增加、复制、删除 行
  6. 选中多个相同的变量/字符
  7. 屏幕移动
  8. 增加多个光标
  9. 快速注释

上下左右移动

CommandDescription
🔢 hleft (also: CTRL-H, BS, or Left key)
🔢 lright (also: Space or Right key)
0to first character in the line (also: Home key)
^to first non-blank character in the line
🔢 $to the last character in the line (N-1 lines lower) (also: End key)
gmto middle of the screen line
🔢 |to column N (default: 1)
🔢 f{char}to the Nth occurrence of {char} to the right
🔢 kup N lines (also: CTRL-P and Up)
🔢 jdown N lines (also: CTRL-J, CTRL-N, NL, and Down)
🔢 -up N lines, on the first non-blank character
🔢 +down N lines, on the first non-blank character (also: CTRL-M and CR)
🔢 _down N-1 lines, on the first non-blank character
🔢 Ggoto line N (default: last line), on the first non-blank character
🔢 gggoto line N (default: first line), on the first non-blank character

按照word移动

CommandDescription
🔢 wN words forward
🔢 WN blank-separated WORDs forward
🔢 eN words forward to the end of the Nth word
🔢 EN words forward to the end of the Nth blank-separated WORD
🔢 bN words backward
🔢 BN blank-separated WORDs backward
🔢 )N sentences forward
🔢 (N sentences backward
🔢 }N paragraphs forward
🔢 {N paragraphs backward

选中增删改

进入 insert mode 后就和之前的模式一样,快捷键有些是和原理的 vscode 一致,有些不一致。

visual mode

CommandDescription
vstart highlighting characters or stop highlighting
Vstart highlighting linewise or stop highlighting
CTRL-Vstart highlighting blockwise or stop highlighting
oexchange cursor position with start of highlighting

删除

CommandDescription
🔢 xdelete N characters under and after the cursor
🔢 Deldelete N characters under and after the cursor
🔢 Xdelete N characters before the cursor
🔢 d{motion}delete the text that is moved over with {motion}
{visual}ddelete the highlighted text
🔢 dddelete N lines
🔢 Ddelete to the end of the line (and N-1 more lines)
(change = delete text and enter Insert mode)
🔢 c{motion}change the text that is moved over with {motion}
{visual}cchange the highlighted text
🔢 ccchange N lines
🔢 Schange N lines
🔢 Cchange to the end of the line (and N-1 more lines)
🔢 shhchange N characters

复制

CommandDescription
"{char}use register {char} for the next delete, yank, or put
"*use register * to access system clipboard
:regshow the contents of all registers
:reg{arg} show the contents of registers mentioned in {arg}
🔢 y{motion}yank the text moved over with {motion} into a register
{visual}yyank the highlighted text into a register
🔢 yyyank N lines into a register
🔢 Yyank N lines into a register
🔢 pput a register after the cursor position (N times)
🔢 Pput a register before the cursor position (N times)
🔢 ]plike p, but adjust indent to current line
🔢 [plike P, but adjust indent to current line
🔢 gplike p, but leave cursor after the new text
🔢 gPlike P, but leave cursor after the new text

增加

CommandDescription
🔢 aappend text after the cursor (N times)
🔢 Aappend text at the end of the line (N times)
🔢 iinsert text before the cursor (N times) (also: Insert)
🔢 Iinsert text before the first non-blank in the line (N times)
🔢 gIinsert text in column 1 (N times)
giinsert at the end of the last change
🔢 oopen a new line below the current line, append text (N times)
🔢 Oopen a new line above the current line, append text (N times)

查找字符/变量

CommandDescription
🔢 /{pattern}[/[offset]]search forward for the Nth occurrence of {pattern} Currently we only support JavaScript Regex but not Vim’s in-house Regex engine.
🔢 ?{pattern}[?[offset]]search backward for the Nth occurrence of {pattern} Currently we only support JavaScript Regex but not Vim’s in-house Regex engine.
🔢 /repeat last search, in the forward direction {count} is not supported.
🔢 ?repeat last search, in the backward direction {count} is not supported.
🔢 nrepeat last search
🔢 Nrepeat last search, in opposite direction

移动、增加、复制、删除 行

复制行
insert mode
alt + shift up/down
删除行
dd
移动行
insert mode
alt + up/down

选中多个相同的变量/字符

CRTL +D选中目标
shift +a/i 防止 curcor 即可编辑全部目标

屏幕移动

CommandDescription
🔢 CTRL-Ewindow N lines downwards (default: 1)
🔢 CTRL-Dwindow N lines Downwards (default: 1/2 window)
🔢 CTRL-Ywindow N lines upwards (default: 1)
🔢 CTRL-Uwindow N lines Upwards (default: 1/2 window)

增加多个光标

in Visual block mode:

CommandDescription
Iinsert the same text in front of all the selected lines
Aappend the same text after all the selected lines

normal mode

alt + command + up / down
then i or a

快速注释

command + /

切换 file

CTRL + TAB
CTRL + 12345

参考:https://github.com/VSCodeVim/Vim/blob/HEAD/ROADMAP.md

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/650260.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何在Shopee平台上进行宠物类目的选品丨shopee宠物选品

在Shopee平台上进行宠物类目的选品是一个重要的任务,它直接关系到卖家的销售业绩和市场竞争力。为了成功选择适合的宠物用品,在选品过程中,卖家可以遵循以下策略: 先给大家推荐一款shopee知虾数据运营工具知虾免费体验地址&#…

vue3项目中使用Arco Design-Table组件结合h()函数生成表格嵌套表格效果

vue3项目中使用Arco Design-Table组件【点击跳转】结合vue3-h()函数【点击跳转】生成表格嵌套表格效果。 示例效果如下&#xff1a; 【方式一】 给Table组件设置表格的“展开行配置”参数&#xff1a;expandable <a-table :expandable"expandable"></a-t…

ZYNQ程序固化

文章目录 一、简介二、固化操作2.1 生成固化文件2.2 固化到SD卡2.3 固化到Flash 参考 将程序存储在非易失性存储器中&#xff0c;在上电或者复位时让程序自动加载运行。 这个过程需要启动引导程序( Boot Loader)参与&#xff0c;Boot Loader会加载FPGA配置文件&#xff0c;以及…

【异常收集】IDEA启动项目遇到的异常汇总,包括插件异常,版本依赖异常,启动异常等以及对应的解决办法

该文章旨在记录开发中遇到的一些异常&#xff0c;以供遇到似错误进行参考修改 一、项目在多个环境下切换&#xff0c;有一次启动后编译失败&#xff0c;报异常 背景&#xff1a;项目在不同环境下有对应的分支&#xff0c;切换分支后运行项目&#xff0c;报错如下 错误:Kotlin:…

FreeRTOS 任务优先级

FreeRTOS 任务优先级 介绍 在 FreeRTOS 中&#xff0c;任务优先级是一种重要的调度机制&#xff0c;它决定了任务在系统中的执行顺序和调度方式。本文将深入探讨 FreeRTOS 任务优先级的概念、作用以及如何合理地设置任务优先级。 什么是任务优先级&#xff1f; 任务优先级是…

【mac】 配合鼠标放大缩小页面\通过ctrl或cmd键缩放页面

win转mac后&#xff0c;一直苦于页面的操作习惯&#xff0c;终于BBT这个工具可以通过添加滚轮手势来实现快捷键缩放页面 顶部配置触发选择“普通鼠标” 然后设置触发操作

滴滴基于 Ray 的 XGBoost 大规模分布式训练实践

背景介绍 作为机器学习模型的核心代表&#xff0c;XGBoost 在滴滴众多策略算法业务场景中发挥着至关重要的作用。因此&#xff0c;保障并持续提升 XGBoost 模型的离线训练及在线推理稳定性一直是机器学习平台的重点工作。同时&#xff0c;面对多样化的业务场景定制需求和数据规…

ubuntu设置右键打开terminator、code

前言&#xff1a; 这里介绍一种直接右键打开本地目录下的terminator和vscode的方法。 一&#xff1a;右键打开terminator 1.安装terminator sudo apt install terminator 2.安装nautilus-actions filemanager-actions sudo apt-get install nautilus-actions filemanager…

ES6 剩余函数

ES6 引入了剩余参数&#xff08;Rest Parameters&#xff09;的概念&#xff0c;允许函数接受不定数量的参数&#xff0c;这些参数会被捕获成一个数组。剩余参数的语法使用三个点 ... 后跟一个参数名。 以下是一个简单的例子&#xff1a; function sum(...numbers) {return n…

docker-compose Install influxdb1+influxdb2+telegraf

influxd2前言 influxd2 是 InfluxDB 2.x 版本的后台进程,是一个开源的时序数据库平台,用于存储、查询和可视化时间序列数据。它提供了一个强大的查询语言和 API,可以快速而轻松地处理大量的高性能时序数据。 telegraf 是一个开源的代理程序,它可以收集、处理和传输各种不…

Typora 无法导出 pdf 问题的解决

目录 问题描述 解决困难 解决方法 问题描述 Windows 下&#xff0c;以前&#xff08;Windows 11&#xff09; Typora 可以顺利较快地由 .md 导出 .pdf 文件&#xff0c;此功能当然非常实用与重要。 然而&#xff0c;有一次电脑因故重装了系统&#xff08;刷机&#xff09;…

如何获得ICP备案服务码?

服务码获取规则 域名备案需要ICP备案服务码&#xff0c;服务码需要购买服务器获得&#xff0c;阿里云的服务器获取服务码的规则如下。 * 不同类型的服务器可申请的ICP备案服务码数量不同&#xff0c;新增备案一个网站需使用一个ICP备案服务码&#xff0c;注销或取消接入后无法…

QT+VS实现Kmeans聚类算法

1、Kmeans的定义 聚类是一个将数据集中在某些方面相似的数据成员进行分类组织的过程&#xff0c;聚类就是一种发现这种内在结构的技术&#xff0c;聚类技术经常被称为无监督学习。k均值聚类是最著名的划分聚类算法&#xff0c;由于简洁和效率使得他成为所有聚类算法中最广泛使…

访问服务器上的 Jupyter Notebook

文章目录 1、生成秘钥2、修改配置3、启动 Jupyter 安装和基本使用方法可见&#xff1a; https://blog.csdn.net/lovechris00/article/details/123458990 1、生成秘钥 jupyter notebook password输入秘钥后&#xff0c;将生成秘钥文件&#xff0c;进入文件&#xff0c;复制那一…

linux中配置文件目录为什么用etc来命名

在早期的 Unix 系统中&#xff0c;/etc 目录的名称确实来源于单词 “etcetera” 的缩写&#xff0c;最初意味着 “其他”&#xff0c;用来存放杂项或者不属于其他特定目录的文件。然而&#xff0c;随着时间的推移&#xff0c;/etc 目录的用途逐渐演变并专门化。 在现代的 Linux…

Android App开发-简单控件(1)——文本显示

本章介绍了App开发常见的几类简单控件的用法&#xff0c;主要包括&#xff1a;显示文字的文本视图、容纳视图的常用布局、响应点击的按钮控件、显示图片的图像视图等。然后结合本章所涉及的知识&#xff0c;完成一个实战项目“简单计算器”的设计与实现。 1.1 文本显示 本节介绍…

架构篇27:如何设计计算高可用架构?

文章目录 主备主从集群小结计算高可用的主要设计目标是:当出现部分硬件损坏时,计算任务能够继续正常运行。因此计算高可用的本质是通过冗余来规避部分故障的风险,单台服务器是无论如何都达不到这个目标的。所以计算高可用的设计思想很简单:通过增加更多服务器来达到计算高可…

《开始使用PyQT》 第01章 PyQT入门 04 创建第一个桌面应用

04 创建第一个桌面应用 《开始使用PyQT》 第01章 PyQT入门 04 创建第一个桌面应用 A GUI application generally consists of a main window and possibly one or more dialog boxes. The main window is where the user will spend most of their time when using your appl…

【Docker】nacos集群搭建Nginx负载均衡

目录 一、mysql安装与基操 1.1 数据准备 1.2 创建mysql与数据表 二、Nacos集群部署 2.1 创建nacos及配置 2.2 创建Nginx容器 一、mysql安装与基操 1.1 数据准备 拉取mysql docker pull mysql:5.7(版本) 定义挂载目录 mkdir -p /mysql/{conf,data,script} 配置my.c…

第十四届蓝桥杯C组题目 三国游戏

4965. 三国游戏 - AcWing题库 小蓝正在玩一款游戏。 游戏中魏蜀吴三个国家各自拥有一定数量的士兵 X,Y,Z&#xff08;一开始可以认为都为 00&#xff09;。 游戏有 n 个可能会发生的事件&#xff0c;每个事件之间相互独立且最多只会发生一次&#xff0c;当第 i个事件发生时会分…