vim列编辑模式总结

vim是经常使用的编辑器,但网上教程基本上只覆盖插入和删除,不能满足其他需求。本人于是今天花了一点时间,总结列编辑时可能会遇到的各种情形,并做成了gif动画,希望能帮到有需求的网友。

总的来说,列编辑的操作流程为:

  1. 普通模式ctrl+v 进入 可视块 模式;
  2. 使用 hjkl 移动光标选择要编辑的块;
  3. 执行一些编辑命令;
  4. esc 退出(非必须)。

第三步执行不同的操作,对应不同的使用场景。本人总结出以下场景,并给出操作的gif动画。

1. 光标前插入

第三步按 shift+i,然后输入要插入的内容,编辑完后按 esc,vim会自动补全剩下的列:

2. 光标后插入

第三步按 shift+a,然后输入要插入的内容,编辑完后按 esc,vim会自动补全剩下的列:

3. 删除

第三步按 x 或者 d,无需再按 esc

4. 更改

可以用“删除”和“插入”的组合更改选中内容。也有更简单的操作:第三步按 c,然后输入内容编,辑完后按 esc,vim会自动补全剩下的列。动画演示:

5. 替换

将选中内容用同一个字符替换:第三步先按 r,再按要替换的字符。动画演示:

6. 粘贴

第三步按 p, 寄存器中的内容将粘贴到选中块,同时块内容放到寄存器中。动画演示(动画开始时寄存器中的数据是2):

留言评论

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select * from vps_autoblog_queue where is_running >0

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select count(*) from vps_autoblog_queue where task_id=6 and is_running>0

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select id,fetched,is_running,last_date_time from vps_autoblog_queue where task_id=6 and source_url_key='85f8e27ce55bd78fd33f47d2b1409198'

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
insert into vps_autoblog_queue(task_id,source_url,source_url_key,create_date_time,not_check_stoped,post_interval) values(6,'https://www.hijk.pw/post-sitemap.xml','85f8e27ce55bd78fd33f47d2b1409198',1750365314,0,0)

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select count(*) from vps_autoblog_queue where task_id=4 and is_running>0

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select id,fetched,is_running,last_date_time from vps_autoblog_queue where task_id=4 and source_url_key='54b1dccf98c13c81f546faf82132bc77'

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
insert into vps_autoblog_queue(task_id,source_url,source_url_key,create_date_time,not_check_stoped,post_interval) values(4,'https://ssr.tools/sitemap-posttype-post.2020.xml','54b1dccf98c13c81f546faf82132bc77',1750365314,0,0)

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select count(*) from vps_autoblog_queue where task_id=2 and is_running>0

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select id,fetched,is_running,last_date_time from vps_autoblog_queue where task_id=2 and source_url_key='91372ddcd9e4809b115feaa5b6f00815'

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
insert into vps_autoblog_queue(task_id,source_url,source_url_key,create_date_time,not_check_stoped,post_interval) values(2,'https://tlanyan.me/post-sitemap.xml','91372ddcd9e4809b115feaa5b6f00815',1750365314,0,0)

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select count(*) from vps_autoblog_queue where task_id=7 and is_running>0

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select id,fetched,is_running,last_date_time from vps_autoblog_queue where task_id=7 and source_url_key='569e17863f7693f1afa9e9256af9dcff'

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
insert into vps_autoblog_queue(task_id,source_url,source_url_key,create_date_time,not_check_stoped,post_interval) values(7,'https://aisoa.cn/sitemap.xml','569e17863f7693f1afa9e9256af9dcff',1750365314,0,0)

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select count(*) from vps_autoblog_queue where task_id=9 and is_running>0

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select id,fetched,is_running,last_date_time from vps_autoblog_queue where task_id=9 and source_url_key='cc9416f8df40d8c3a48e66856b1cd6fd'

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
insert into vps_autoblog_queue(task_id,source_url,source_url_key,create_date_time,not_check_stoped,post_interval) values(9,'https://www.v2rayssr.com/sitemap.xml','cc9416f8df40d8c3a48e66856b1cd6fd',1750365314,0,0)

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select count(*) from vps_autoblog_queue where task_id=10 and is_running>0

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select id,fetched,is_running,last_date_time from vps_autoblog_queue where task_id=10 and source_url_key='74714f67855820f0c701ce905b231f27'

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
insert into vps_autoblog_queue(task_id,source_url,source_url_key,create_date_time,not_check_stoped,post_interval) values(10,'https://doubibackup.com/sitemap.xml','74714f67855820f0c701ce905b231f27',1750365314,0,0)

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select id,is_running,last_post_time,post_interval,not_check_stoped from vps_autoblog_queue WHERE is_running>0 and fetched=0 order BY id ASC

WordPress数据库错误: [Table 'ssrvps.vps_autoblog_queue' doesn't exist]
select id,sn_id from vps_autoblog_queue WHERE is_running=0 and fetched=0 order BY id ASC LIMIT 1