Second Brain: Crafted, Curated, Connected, Compounded on 10月02日 21:18
Vim快速递增数字列
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文介绍了如何在Vim编辑器中使用VISUAL BLOCK模式快速递增一列数字。

See a video of it:
Quickly increment column of numbers with Vim

# step by step

First, move the cursor to the top 0 (I use [] to signify cursor location).

123456789
<div class="test">[0]</div><div class="test">0</div><div class="test">0</div><div class="test">0</div><div class="test">0</div><div class="test">0</div><div class="test">0</div><div class="test">0</div><div class="test">0</div>

Using VISUAL BLOCK mode (<C-v>), go down 8 times (<C-v>8j) to visually select all 0’s.

123456789
<div class="test">[0]</div><div class="test">[0]</div><div class="test">[0]</div><div class="test">[0]</div><div class="test">[0]</div><div class="test">[0]</div><div class="test">[0]</div><div class="test">[0]</div><div class="test">[0]</div>

Now type g <C-a>. Voila!

123456789
<div class="test">1</div><div class="test">2</div><div class="test">3</div><div class="test">4</div><div class="test">5</div><div class="test">6</div><div class="test">7</div><div class="test">8</div><div class="test">9</div>

Origin: Quick vim tips to generate and increment numbers
References: vim
Created 2022-11-18

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Vim 编辑器 数字递增
相关文章