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

Changing text

By default you're in Vim's normal mode, meaning that every key press corresponds to a particular command. Hit i on your keyboard to enter an insert mode. This will display -- INSERT -- in a status line (at the bottom), (and, if you're using gVim, it will change the cursor from a block to a vertical line), as can be seen in the following example:

The insert mode behaves just like any other modeless editor. Normally, we wouldn't spend a lot of time in insert mode except for adding new text.

You've already encountered three of Vim's modes: command-line mode, normal mode, and insert mode. This book will cover more modes, see Chapter 3,  Follow the Leader – Plugin Management  for details and explanation.

Let's create our Python application by typing in the following code. We'll be navigating this little snippet throughout this chapter:

To get back to normal mode in Vim, hit Esc on your keyboard. You'll see that -- INSERT -- has disappeared from the status line. Now, Vim is ready to take commands from you again!

The preceding code is not showing Python  best  practices and is provided to illustrate some of Vim's capabilities.
主站蜘蛛池模板: 南昌市| 龙海市| 湟中县| 宜阳县| 张家川| 天门市| 永靖县| 新巴尔虎左旗| 湟中县| 日喀则市| 新晃| 江北区| 德清县| 牡丹江市| 桓台县| 蚌埠市| 眉山市| 三台县| 阿拉善右旗| 辉南县| 英德市| 明水县| 三门县| 石渠县| 秭归县| 长治县| 美姑县| 精河县| 通渭县| 白水县| 盐源县| 龙口市| 财经| 麻江县| 上杭县| 任丘市| 河源市| 许昌县| 桂东县| 公主岭市| 逊克县|