Using Vim to Convert HTML Tags from Uppercase to LowercaseSeptember 3, 2009 Sometimes, a good tip is worth sharing. As I was making some edits to some HTML pages using Vim, I wanted to find a quick way to convert uppercase tag and attribute names to lowercase. I found this tip somewhere on the Internet and it worked so well, I thought it might be worth repeating. To convert HTML tags from uppercase to lowercase, use this command in Vim: %s/<\/\?\zs\(\w\+\)\ze[ >]/\L\1/g To convert HTML attributes from uppercase to lowercase, use this command in Vim: %s/\(<[^>]*\)\@<=\<\(\a*\)\ze=['"]/\L\2/g
|
![]() Contact Social Media |