Step 1: Enter vim editor
vim /etc/ssh/ssh_config
Step 2: Search method
Method 1: Quick search (exact string match, case sensitive)
Format: / + keyword or ? + keywords
/Port #按回车键搜索 从上到下查找
?Port #按回车键搜索 从下到上查找
Advantages: quickly locate the keyword
After pressing Enter, press n
to search for the next matching result that appears, and press uppercase N
to search for the next matching result that appears in reverse.
Method 2: Whole word search
Format: / + \< + keyword + \>
/\<Iden\>
After pressing Enter, press *
to search forward or #
backward.
Step 3: Search History
Format: / + up and down arrow keys
press enter after selection
Step 4: Case Sensitive
By default, searches are case sensitive. Searching for "YES" will not match "yes".
:set ignorecase
To ignore case, enter or on the Vim command line :set ic
. You can also add a default option to your ~/.vimrc
file to ignore case.
To change back to case-sensitive, enter :set noignorecase
or :set noic
.
Another way to force case to be ignored is to add it after the search pattern \c
. For example, /Linux\c
case sensitivity will be ignored when searching. Adding uppercase after the search style \C
will force case sensitivity.