![]() N move to next occurrence of search string ?string search backward for occurrence of string in text string search forward for occurrence of string in text :$ Return or G move cursor to last line in file :0 Return or 1G move cursor to first line in file P paste the line(s) in the buffer into the text after the current lineĠ (zero) move cursor to start of current line (the one with the cursor)ī move cursor back to beginning of preceding word Nyy copy (yank, cut) the next N lines, including the current line, into the buffer Yy copy (yank, cut) the current line into the buffer Ndd delete N lines, beginning with the current line e.g., 5dd deletes 5 lines Nx delete N characters, starting with character under cursorĭw delete the single word beginning with character under cursorĬ change (replace) the characters in the current line, until Esc hitĭ delete the remainder of the line, starting with current cursor position R replace single character under cursor (no Esc needed)Ĭw change the current word with new text,starting with the character under cursor, until Esc hit O open and put text in a new line above current line, until Esc hit O open and put text in a new line below current line, until Esc hit ![]() I insert text at beginning of current line, until Esc hitĪ append text after cursor, until Esc hitĪ append text to end of current line, until Esc hit I insert text before cursor, until Esc hit U undo whatever you just did a simple toggle :q! Return quit vi even though latest changes have not been saved for this vi call :wq Return quit vi, writing out modified file to file named in original invocation :x Return quit vi, writing out modified file to file named in original invocation To deactivate a command in vi: just press EscĪnd then you will get back normal use of your arrow keys: This command allows you to insert text in your file. With vi, when pressing i you activate the command to Insert text.
0 Comments
Leave a Reply. |