Working in vi editor on ec2 server

泪湿孤枕 提交于 2019-12-22 17:54:26

问题


Can you please help me using vi editor for programming

  1. How to close the window, saving the content of opened page. // I use Esc wq: but it keep open the window
  2. Deleting selected content
  3. going to direct line // Esq /. any other way
  4. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!