首页 > 其他分享 >[Tools] VIm cheat sheet

[Tools] VIm cheat sheet

时间:2024-07-12 15:01:04浏览次数:7  
标签:CHAR search sheet cheat PATTERN current line Tools delete

vim cheat sheet

Keep this handy as you experiment with vim:

http://www.fprintf.net/vimCheatSheet.html

Here is another guide that covers the commands incrementally:

http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/

 

moving around - hjkl

In insert mode, the arrow keys do work, but you should practice not using them!

Instead, in command mode:

  • h - moves left one character
  • j - moves down one line
  • k - moves up one line
  • l - moves right one character

 

moving around - even more!

You can move all kinds of places quickly in command mode:

  • ^ or 0 - move to the start of the current line
  • $ - move to the end of the current line
  • gg - jump to the beginning of the file
  • G - jump to the end of the file

 

delete

There are so many ways to delete!

  • x - delete the character under the cursor
  • dd - delete the current line
  • d$ or D - delete from the cursor to the end of the current line
  • d0 or d^ - delete from the cursor to the start of the current line

You'll notice that we've already seen 0 and $ before! You can repurpose each of the moving around commands to delete text. These all work:

  • dG - delete from the current position to the end of the file
  • dgg - delete from the current position to the start of the file
  • dj - delete the current line and the line below
  • dk - delete the current line and the line above
  • 2dd, 3dd etc - delete the next N lines

Even dl and dh work!

Remember that vim is a language!

 

searching

You can search for text using regular expressions.

  • /PATTERN - search forward for PATTERN
  • ?PATTERN - search backward for PATTERN

Press:

  • n - jump to the next match
  • N - jump to the previous match

PATTERN is a regular expression, but you can just treat it as an ordinary text match for the most part.

You can combine searching with deleting too:

  • d/PATTERN - delete to the next match of PATTERN
  • d?PATTERN - delete to the previous match of PATTERN
  • dn - delete to the next already matched pattern
  • dN - delete to the previous already matched pattern

 

jumping

You can also skip ahead to individual characters in a simple way on the current line:

  • f + CHAR - search forward on the current line to CHAR
  • t + CHAR - search forward on the current line to the character before CHAR
  • F + CHAR - search backward on the current line to CHAR
  • T + CHAR - search backward on the current line to the character after CHAR

 

标签:CHAR,search,sheet,cheat,PATTERN,current,line,Tools,delete
From: https://www.cnblogs.com/Answer1215/p/18298345

相关文章

  • Keep Spreadsheets Responsive During Calculations
    KeepSpreadsheetsResponsiveDuringCalculationsSpreadJS17.1.0introducesincrementalcomputationwhichhelpsmaintainspreadsheetperformanceduringeventhemostcomplexdataprocessing.SpreadJSbyMESCIUSisaJavaScriptlibraryofferingaco......
  • 如何通过SRA Tools处理从NCBI获得的SRA数据
    1.安装SRATools通过SRAToolkit可以方便的从NCBI下载SRA数据,但是速度较慢,Aspera虽然快,但是难点在于找NCBI的源文件地址,而且SRAToolkit好像可以调用Aspera(虽然还没找到方法)具体操作可以参考这个帖子,下载安装很容易,主要是配置环境要配置好,不然用不了https://blog.csdn.net/m0_6......
  • Luckysheet 的使用以及踩坑
    最近在项目中遇到了需要实现一个类似于excel功能的需求,同时需要实现excel的导入导出以及打印功能。接下来介绍一下使用luckysheet的过程以及过程中遇到的一些问题以及解决方案。1.使用1.1引入lucky是一个比较老的项目,所以引入方式建议使用全局方式引入。虽然也有npm包,但是......
  • SSRF CheatSheet
    1.SSRF定义SSRF(Server-SideRequestForgery:服务器端请求伪造)是一种由攻击者构造形成由服务端发起请求的一个安全漏洞。一般情况下,SSRF攻击的目标是从外网无法访问的内部系统。(正是因为它是由服务端发起的,所以它能够请求到与它相连而与外网隔离的内部系统)2.漏洞原理SSRF......
  • Kutools-for-Excel学习版下载
    一、软件介绍在处理Excel文件时,经常会遇到一些繁琐但又不可避免的操作,严重影响到文档编辑效率。KutoolsforExcel与Excel2007/2010/2013/Microsoft365的界面完美融合,超过300+的功能都提供了详细操作提示,即使是从未接触过的功能,也能立马上手使用,是你使用Excel......
  • Kutools for Word v9.0学习版下载
    概述KutoolsforWordv9.0是一款功能强大的MicrosoftWord插件,旨在提高用户的工作效率和文档处理能力,是Word用户的得力助手。主要功能:增强功能:为Word添加了300多个高级功能,大大扩展了Word的基础功能。界面集成:完美集成到Word界面中,使用起来自然流畅。文档管理......
  • 算法金 | 推导式、生成器、向量化、map、filter、reduce、itertools,再见 for 循环
    大侠幸会,在下全网同名「算法金」0基础转AI上岸,多个算法赛Top「日更万日,让更多人享受智能乐趣」不要轻易使用For循环For循环,老铁们在编程中经常用到的一个基本结构,特别是在处理列表、字典这类数据结构时。但是,这东西真的是个双刃剑。虽然看起来挺直白,一用就上手,但是......
  • Franka Emika Datasheet(技术参数)
    任何人均可随时随地实现自动化。 FrankaEmika是德国慕尼黑的一家深科技公司,该公司致力于创造全新的机器人平台技术,提高性能,改善每个人的访问便捷性,从而克服现代社会面临的最大难题之一,让整整一代人摆脱枯燥乏味、存在潜在危险且极其耗时的劳动和工作。为了实现高性能和易用......
  • 生成多个Sheet页的表格
    packagecom.cqbb.common.utils.poi;importorg.apache.poi.hssf.usermodel.*;importorg.apache.poi.ss.usermodel.HorizontalAlignment;importorg.apache.poi.ss.usermodel.VerticalAlignment;importorg.springframework.http.MediaType;importjavax.servlet.http.HttpSe......
  • C# WinForm给ToolStrip工具栏扩展一个CheckBox单选框类型按钮的方法
    [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip)]publicpartialclassToolStripCheckBox:ToolStripItem{privateboolIsChecked=false;publicboolHasChecked{get......