问题
Can you please help me using vi editor for programming
- How to close the window, saving the content of opened page. // I use Esc wq: but it keep open the window
- Deleting selected content
- going to direct line // Esq /. any other way
- Opening new file in same window without closing older one
回答1:
How to close the window, saving the content of opened page. // I use Esc wq: but it keep open the window
ESC + :wq
Deleting selected content
how do you select content in VI ? to delete a line, press dd
. To delete 2 lines, press 2dd
... so on and so forth
going to direct line // Esq /. any other way
ESC + :120
above combination will take you to line no. 120. OR run below command:
vi +120 file_name
Opening new file in same window without closing older one
ESC + :split new_file_name
sorry for the formatting of this post.
来源:https://stackoverflow.com/questions/19911747/working-in-vi-editor-on-ec2-server