官术网_书友最值得收藏!

  • Mastering Vim
  • Ruslan Osipov
  • 196字
  • 2021-06-10 18:51:31

Jumping into insert mode

You've already learned to enter insert mode using i, which puts you in insert mode at the position of the cursor.

There are a few more convenient shortcuts for entering insert mode:

  • a places you in insert mode after the cursor

  • A places you in insert mode at the end of the line (equivalent of $a)

  • I places you in insert mode at the beginning of the line, but after indentation (equivalent of _i)

  • o adds a new line below the cursor before entering insert mode
  • O adds a new line above the cursor before entering insert mode
  • gi places you in insert mode where you last exited it

You've also learned how to enter insert mode after deleting some code with the change command (c). Here are more ways to chain change commands:

  • C deletes text to the right of the cursor (until the end of the line) before entering insert mode
  • cc or S deletes the contents of the line before entering insert mode, while preserving indentation
  • s deletes a single character (prefix by a number to delete multiple) before placing you in insert mode
主站蜘蛛池模板: 宜川县| 达日县| 廊坊市| 浦江县| 渭南市| 嘉善县| 墨竹工卡县| 丹东市| 金乡县| 五河县| 沈阳市| 辰溪县| 桂阳县| 宁河县| 罗源县| 萨嘎县| 五大连池市| 资源县| 乌拉特中旗| 兴义市| 桃源县| 安泽县| 湖南省| 巴林左旗| 上栗县| 社旗县| 韶关市| 三原县| 尉犁县| 额尔古纳市| 外汇| 东方市| 华阴市| 长春市| 瑞昌市| 旌德县| 枝江市| 和硕县| 米脂县| 普定县| 沁源县|