dev-resources.site
for different kinds of informations.
Vim Regex Tricks - Capitalize Every First Letter
Published at
12/2/2024
Categories
vim
neovim
regex
productivity
Author
gokayburuc
Author
10 person written this
gokayburuc
open
Capitalize the First Letter of Every Word Using Vim Regex
To capitalize the first letter of each word in a sentence, use the following Vim command:
:s/\<\w/\u&/g
Explanation of the Command
-
:s/
starts the substitution command in Vim, which is used to find a pattern and replace it with a specified value. -
\<
matches the beginning of a word. In Vim, a word is defined as a sequence of letters, digits, or underscores. -
\w
matches any word character (letters, digits, or underscores). -
\u
is a replacement flag in Vim that converts the next character in the replacement string to uppercase. -
&
represents the entire matched text from the search pattern (in this case, the first character of each word). -
/g
applies the substitution globally, ensuring every matching occurrence in the line is processed rather than just the first one.
By running this command, Vim will capitalize the first letter of each word in the specified text.
regex Article's
30 articles in total
Here are 7 Regex tools that can save your life from hell π₯
read article
What are the benefits of using bounded quantifiers in regex
read article
Understanding Regex in Python: A Practical Example
read article
Coding challenge: Design and Implement an Advanced Text Search System
read article
Automating Email Validation with Python: A Step-by-Step Tutorial
read article
Streaming regex scanner β regexpscanner
read article
Unraveling the Magic of Regular Expressions: The Ultimate Guide to Mastering Sed, Gawk, and POSIX Patternsπ
read article
Masking confidential data in prompts using Regex and spaCy
read article
Regular Expressions for Highlighting Comments in PyCharm
read article
Regex lookahead
read article
Easy to follow Regular Expression Cheatsheet
read article
π Cross-Post Project Update: Regex, Bug Fixes, and More Regex!
read article
How to work with regular expressions
read article
Advent of Code 2024 - Day 3: Mull it Over
read article
Vim Regex Tricks - Capitalize Every First Letter
currently reading
Finally figured out a whole bunch of Nginx regex. It's more confusing than normal regex somehow
read article
From Regex Rampage to Lazy Bliss: My rjq Performance Adventure
read article
Regular Expressions
read article
Building a Regex Engine in Go: Introducing MatchGo
read article
Build up your confidence with Regex: 5 Techniques to make it STICK
read article
Mastering Regular Expressions: A Semantic Approach to Regex
read article
Regex for a Java Software Engineer
read article
Intro to Regular Expressions
read article
Intro to Regular Expressions
read article
The importance of the environment in Regex pattern matching
read article
js / ts - expressΓ£o regular
read article
A Guide to Splitting Strings in JavaScript by Regex
read article
Taming the Regex Beast: A Beginner's Guide to Regular Expressions
read article
The JS string replace() method
read article
Learn Enough Regex Without Losing Your Mind
read article
Featured ones: