PracticalVim Tip72 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 72: Tune the Case Sensitivity of Search Patterns

Return to the top: <>

Setting Case Sensitivity Globally

  • enabling the 'ignorecase' setting.

Setting Case Sensitivity per Search

  • `\c`: ignore case
  • `\C`: force case sensitivity

Enabling Smarter Default Case Sensitivity

  • enabling the 'smartcase' option.

References:

Example: | Pattern | 'ignorecase' | 'smartcase' | Matches | | foo | off | - | foo | | foo | on | - | foo Foo FOO | | foo | on | on | foo Foo FOO | | Foo | on | on | Foo | | Foo | on | off | foo Foo FOO | | \cfoo | - | - | foo Foo FOO | | foo\C | - | - | foo |

⚠️ **GitHub.com Fallback** ⚠️