user1788542
user1788542

Reputation:

Working in vi editor on ec2 server

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

Upvotes: 2

Views: 5007

Answers (1)

slayedbylucifer
slayedbylucifer

Reputation: 23512

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.

Upvotes: 1

Related Questions