| /word | Search “word” from top to bottom |
| ?word | Search “word” from bottom to top |
| /jo[ha]n | Search “john” or “joan” |
| /\< the | Search “the”, “theatre” or “then” |
| /the\> | Search “the” or “breathe” |
| /\< the\> | Search “the” |
| /\< ….\> | Search all words of 4 letters |
| /\/ | Search “fred” but not “alfred” or “frederick” |
| /fred\|joe | Search “fred” or “joe” |
| /\<\d\d\d\d\> | Search exactly 4 digits |
| /^\n\{3} | Find 3 empty lines |
| :bufdo /searchstr/ | Search in all open files |
Showing posts with label commands. Show all posts
Showing posts with label commands. Show all posts
23.11.09
VIM commands. Part 2
Search
VIM Editor Commands, with examples. Part 1
Vim is an editor to create or edit a text file. There are two modes in vim. One is the command mode and another is the insert mode.
In the command mode, user can move around the file, delete text, etc.
In the insert mode, user can insert text.
Changing mode from one to another
From command mode to insert mode type a/A/i/I/o/O ( see details below)
From insert mode to command mode type Esc (escape key)
Some useful commands for VIM
Text Entry Commands (Used to start text entry)
a Append text following current cursor position
A Append text to the end of current line
i Insert text before the current cursor position
I Insert text at the beginning of the cursor line
o Open up a new line following the current line and add text there
O Open up a new line in front of the current line and add text there
In the command mode, user can move around the file, delete text, etc.
In the insert mode, user can insert text.
Changing mode from one to another
From command mode to insert mode type a/A/i/I/o/O ( see details below)
From insert mode to command mode type Esc (escape key)
Some useful commands for VIM
Text Entry Commands (Used to start text entry)
a Append text following current cursor position
A Append text to the end of current line
i Insert text before the current cursor position
I Insert text at the beginning of the cursor line
o Open up a new line following the current line and add text there
O Open up a new line in front of the current line and add text there
Subscribe to:
Posts (Atom)