在Vim中缩进一排线 [英] Indenting a bunch of lines in Vim

查看:59
本文介绍了在Vim中缩进一排线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以像在文本编辑器中那样在Vim中缩进选定的行,就像我们在文本编辑器中那样,选择一堆行并按Tab(或shift键)来缩进/取消缩进选定的行?

Is there a way to indent a selection of lines in Vim, like we have in text editors where we select a bunch of lines and press tab (or shift tab) to indent/unindent the selected lines?

我说的是普通缩进,与代码缩进无关.

I am talking about general indentation and not related to code indentation.

推荐答案

使用可视模式

Use visual mode as Peter suggests. You can also use X>> where X is the number of lines you want to indent. E.g. 5>> indents five lines from current line and down.

这篇关于在Vim中缩进一排线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆