vi switch from command modeTo start typing in vi editor, you have to be in insert mode. There are different commands in vi editor through which you can start typing at different locations in insert mode. They are defined below. i The i command allows us to write before the current character. Example: Look at the above snapshot, our cursor is at e. We forgot to write word command before word example. Hence, here we can use i command. Look at the above snapshot, after pressing i, we wrote word command. I The command I allows us to write at the start of the current line. Example: Look at the above snapshot, we want to write word Hello at the starting of the line. Look at the above snapshot, after pressing I, we have typed Hello at the starting of the line. A The Example: Look at the above snapshot, we want to move at the end of the current line. Look at the above snapshot, after pressing A, we have written one more line. o The o command allows us to start typing a new line after the current line. Example: Look at the above snapshot, we are at the middle of the line and want to start a new line. Look at the above snapshot, after pressing o, we arrived at next line and typed there. O The O command allows us to start typing on a new line before the current line. Example: Look at the above snapshot, we are at the middle of the line and want to write before the current line. Look at the above snapshot, after pressing O, we have written in a new line before the current line. Next TopicLinux vi move |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India