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

  • 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
主站蜘蛛池模板: 抚顺县| 剑河县| 定州市| 千阳县| 塔河县| 鲁山县| 甘洛县| 玛沁县| 甘谷县| 宁晋县| 台南市| 岑溪市| 云阳县| 浮山县| 方山县| 苏尼特左旗| 定日县| 工布江达县| 石景山区| 杨浦区| 新巴尔虎左旗| 孟连| 白水县| 汾阳市| 荣昌县| 衡阳市| 玉环县| 吉木乃县| 隆昌县| 延寿县| 竹北市| 义乌市| 资源县| 呼和浩特市| 通道| 南康市| 山丹县| 方山县| 澄城县| 嫩江县| 尤溪县|