Convert Hex color values to uppercase/lowercase with Vim
Here's a useful tip I use to keep my CSS files up to Drupal coding standards.
The following will convert all hex code color values (either #FFF or #FFFFFF) to lowercase.
:%s/#[0-9a-f]{3,6}/\L&/gi
If you want to convert to all uppercase, try this.
:%s/#[0-9a-f]{3,6}/\U&/gi
Written by algorgeous
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#