|
|
Editing in Vim Editor - Linux
|
Views : 358
|
|
Tagged in : Linux
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Vim offer several functionalities that improve your editing.
1. Copying a whole line
yy or shift y or :ny
where n is the number of line if n is not specified then copy the current line
2. Copying from current position to end of line.
y$
3. Copying 3 lines after the current position
3yy
4. Copying a range of line
:1,5y or :1y 5
The above example copy 5 lines, from 1 to 5
5. Deleting a whole line (Deleted line is copy to the registers)
dd or :nd
Where n is the number of line if n is not specified then delete the current line
6. Deleting from current position to end of line (Deleted text is copied to the registers)
d$ or shift d
7. Deleting a range of line
:1,5d or :1d 5
The above example remove 5 lines, from 1 to 5 and copy them to a register
8. Put n times a text, previously copied, after the cursor:
np
9. Put n times a text, previously copied, before the cursor
n Shift p
10. Word completion, works in insert mode
1. Ctrl n search forward for next matching
2. Ctrl p search backward for previous matching
11. Put vim in replace mode
Shift r
12. Undo
u
13. Redo
Ctrl r
14. Repeating last change
.
15. Getting help about a topic
:help topic
Note: previous commands work in command mode except 10. |
|
By Rekha, On - 2009-12-22 |
|
|
|