vim 存文本编辑器
Syntax format: VIM "option" "File" vim [options] [file]
Attention:
1.vim command and subsequent options and files, there must be at least one space between each element
2.vim can be divided into three modes: normal mode, edit mode, command mode.
Vim three modes of conversion
Several ways to open vim
1.vim file +n: Open files with cursor at beginning of Nth line, N is natural number
2.vim file +: Open files with cursor at the beginning of the last line
3.vim file +/pattern: Places the cursor at the first pattern-matched string, pattern is any string
Parameter options:
Command |
Description |
/ysg |
Start at the cursor position and look down for a string named Ysg |
? ysg |
Search for a string named YSG starting at the cursor position |
N |
Start from the cursor position and repeat the previous search action down |
N |
Repeat the previous search move up from the cursor position |
I |
Insert text at the current cursor location |
Esc |
Exit edit mode, return to command mode |
: Wq |
Exit and save |
: wq! |
Exit and force save, "!" for mandatory meaning |
: q! |
Force quit, do not save |
Case one:
Open a new folder: There will be a word for [new File]
Vim Ysg.txt
Case TWO:
Enter edit mode, press ESC and save exit
Linux Common Commands--vi/vim