vi WordsIn command mode, you can move one word forward or backward with w and b command respectively. w The w command allows us to move one word forward. To move more than one word forward, you can type number before w command. Example: 9w ![]() Look at the above snapshot, from the current word we want to move 9 words ahead. ![]() Look at the above snapshot, we have moved 9 words forward. Note: Word we'll is counted as three words (we, ' , and ll) b The b command allows us to move one word backward. To move more than one word backward, you can type number before b command. Example: 9b ![]() Look at the above snapshot, from the current word we want to move 9 words backwards. ![]() Look at the above snapshot, we have moved 9 words backward. dw The dw command is used to delete one word. But remember, to delete one complete word cursor should be placed at the starting letter of the word. Example 1: ![]() Look at the above snapshot, we want to delete word example. Our cursor is placed at the starting letter e. ![]() Look at the above snapshot, after pressing dw command, word example is deleted. Example 2: ![]() Look at the above snapshot, here also we want to delete word example. But this time our cursor is placed somewhere at the middle of the word. ![]() Look at the above snapshot, after pressing dw command, word example is not completely deleted. Only the letters starting from the cursor to the end of the word (including the space) are deleted. Example 3: 5dw ![]() Look at the above snapshot, here we want to delete five letters after the current word. ![]() Look at the above snapshot, after typing 5dw, five words after the cursor are deleted. yw The command yw is used to copy one word. Here also cursor has to be placed at the starting to copy a complete word. Example: ![]() Look at the above snapshot, we want to copy word example. ![]() Look at the above snapshot, after pressing yw key, move the cursor at place where you want to copy the word. Here, we have copied it at the last with p command.
Next TopicLinux Searching
|