Indenting a bunch of lines in Vim

后端 未结 5 1781
挽巷
挽巷 2020-12-24 14:36

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 selec

5条回答
  •  时光取名叫无心
    2020-12-24 14:53

    You can select a set of lines with visual line mode (via Shift + V), and then type

    >

    and, to dedent,

    <

    You can also add numeric arguments. Find out you didn't indent enough? Hit gv to re-select your previous selection.

    While typing in normal mode, try out Ctrl + T or Ctrl + D to indent or dedent.

提交回复
热议问题