Cutting and copying in visual modes:
- y - yanks (copies) the selected text
- d - deletes (cuts) the selected text
Cutting, copying, and pasting in normal mode
- :y or yy or Y - yanks the current line
- :ny - yanks line number n
- :n,my - yanks line numbers n through m, inclusive
- :d or dd - deletes the current line
- D - deletes from the current cursor position to the end of the line
- :nd - deletes line number n
- :n,md - deletes from line number n through m, inclusive
- p - puts (pastes) text from the clip board starting to the right of the cursor, or below the cursor if putting entire lines of text
- P - puts text from the clip board starting to the left of the cursor, or above the cursor if putting entire lines of text
Another important thing when you are editing anything is to know how to undo and redo changes made. This is really easy to do in Vim:
- u - undo the most recent change
- U - undo all of the most recent changes to the current line
- Ctrl + r - redo the last undone change
That pretty much does it for this post. See you next time
No comments:
Post a Comment