TLDR
1. Basic Substitution: Using `:s` to replace the first occurrence of text on the current line. 2. Replacing Text on Specific Lines: Employing line numbers or ranges (e.g., `:90,110s`) to replace text within defined line ranges. 3. Pattern-based substitutions: Using regular expressions with the substitute command.via the TL;DR App
- Basic Substitution: Using
:s to replace the first occurrence of text on the current line.
- Replacing Text on Specific Lines: Employing
:s with line numbers or ranges (e.g., :90,110s) to replace text within defined line ranges.
- Global Substitution: Utilizing
:s with the g flag (:s/pattern/replacement/g) to replace all occurrences of text on a line or throughout the file.
- Pattern-based Substitution: Using regular expressions with the substitute command. For instance, replacing the first character of each word with its uppercase representation using
:%s/^./\u&/g.
Written by artwalker | Passionate about Crafting Intelligent OS & Pioneering TinyML Applications for Resource-Constrained Devices