vi Start and End of a lineIn command mode, 0 and caret ^ sign will bring you at the start of the current line while $ sign will bring you at the end of the current line. These signs can be added to another command to perform certain functions. For example, d0 will delete characters between current character and start of the line. And d$ will delete characters between current character and end of the line. 0 The 0 sign bring you to the start of the current line. Example: Look at the above snapshot, currently our cursor is at the middle of the second line. Look at the above snapshot, after pressing key 0, we're at the starting of second line. ^ The ^ sign also bring you at the start of the current line. $ The $ sign will bring you to the end of the current line. Example: Look at the above snapshot, currently our cursor is at the middle of the second line. Look at the above snapshot, after pressing $ key, we are at the end of the current line. d0 Combining sign 0 with d command enables us to delete start of a line from current character. Example: Look at the above snapshot, position of the cursor is somewhere in the middle of the line. Look at the above snapshot, letters from starting to the current character are deleted. d$ Combining sign $ with d command enables us to delete from current character to the end of the line. Example: Look at the above snapshot, position of the cursor is somewhere in the middle of the line. Look at the above snapshot, letters from current character to the end of the line are deleted. Next TopicLinux vi Join |
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