2-vim- open and -01- open New File / New File / Open to locate the file specified line

1. Create or open a file

command:

vim filename

  • Vi input at the back to keep up with the file name in the terminal.
  • If the file already exists, it will open the file directly.
  • If the file does not exist, create a new file.

 

2. Open the file and locate the file specified line.

command:

vim filename + line number

Example: Open hello.py file 12 and locate the line.

Note:

If only with + without specifying line numbers, it will be positioned directly to the end of the file.

command:

vim filename +

Example: Open hello.py locate the file and to the end.

 

Guess you like

Origin www.cnblogs.com/summer1019/p/11220852.html