Matching Patterns and Literals

This post extracts some knowledge from Practical Vim Chapter 12 -- Matching Patterns and Literals.

[!TIP] Tune the Case Sensitivity of Search Patterns

:set ignorecase
" Ignore case
\c  
" Force case
\C

[!TIP] Use the \v Pattern Switch for Regex Searches

[!TIP] Use the \V Literal Switch for Verbatim Searches

As a general rule, if you want to search for a regular expression, use the \v pattern switch, and if you want to search for verbatim text, use the \V literal switch.


原文链接:https://zhuang.dev/reading/practical-vim/12-matching-patterns-and-literals/

posted @ 2026-07-12 22:50  neozhuang  阅读(6)  评论(0)    收藏  举报