Skip to content

Instantly share code, notes, and snippets.

@rafma0
Last active October 28, 2022 09:57
Show Gist options
  • Save rafma0/ba70b41e3a100b88307703408dd7a795 to your computer and use it in GitHub Desktop.
Save rafma0/ba70b41e3a100b88307703408dd7a795 to your computer and use it in GitHub Desktop.
# Based on https://gist.github.com/DavidZidar/1cfef361ff659aef68cef25ebd547fa9
# Using colors from https://github.com/devblackops/Terminal-Icons/blob/main/Terminal-Icons/Data/colorThemes/devblackops.psd1
# Enable-ExperimentalFeature PSANSIRenderingFileInfo
$PSStyle.FileInfo.Directory = $PSStyle.Foreground.FromRgb('0x3EC669')
$PSStyle.FileInfo.SymbolicLink = $PSStyle.Foreground.FromRgb('0x7373ff')
$PSStyle.FileInfo.Executable = $PSStyle.Foreground.FromRgb('0x00FA9A')
$colorMap = @{
# WellKnown
'.gitattributes' = '0xFF4500'
'.gitconfig' = '0xFF4500'
'.gitignore' = '0xFF4500'
'.gitmodules' = '0xFF4500'
'.gitkeep' = '0xFF4500'
'.DS_Store' = '0x696969'
'.tsbuildinfo' = '0xF4A460'
'.jscsrc' = '0xF4A460'
'.jshintrc' = '0xF4A460'
'.jsbeautifyrc' = '0xF4A460'
'.esformatter' = '0xF4A460'
'.htaccess' = '0x9ACD32'
'.jshintignore' = '0x87CEEB'
'.buildignore' = '0x87CEEB'
'.mrconfig' = '0x87CEEB'
'.yardopts' = '0x87CEEB'
'.clang-format' = '0x87CEEB'
'.clang-tidy' = '0x87CEEB'
'.jenkinsfile' = '0x6495ED'
# Firebase
'.firebaserc' = '0xFFA500'
# Bower
'.bowerrc' = '0xCD5C5C'
# NodeJS
'.nvmrc' = '0x6B8E23'
'.esmrc' = '0x6B8E23'
# NPM
'.nmpignore' = '0x00BFFF'
'.npmrc' = '0x00BFFF'
# Archive files
'.7z' = '0xDAA520'
'.bz' = '0xDAA520'
'.tar' = '0xDAA520'
'.zip' = '0xDAA520'
'.gz' = '0xDAA520'
'.xz' = '0xDAA520'
'.br' = '0xDAA520'
'.bzip2' = '0xDAA520'
'.gzip' = '0xDAA520'
'.brotli' = '0xDAA520'
'.rar' = '0xDAA520'
'.tgz' = '0xDAA520'
# Executable things
'.bat' = '0x008000'
'.cmd' = '0x008000'
'.exe' = '0x00FA9A'
'.pl' = '0x8A2BE2'
'.sh' = '0xFF4500'
# App Packages
'.msi' = '0xFFC77A'
'.msix' = '0xFFC77A'
'.msixbundle' = '0xFFC77A'
'.appx' = '0xFFC77A'
'.AppxBundle' = '0xFFC77A'
'.deb' = '0xFFC77A'
'.rpm' = '0xFFC77A'
# PowerShell
'.ps1' = '0x00BFFF'
'.psm1' = '0x00BFFF'
'.psd1' = '0x00BFFF'
'.ps1xml' = '0x00BFFF'
'.psc1' = '0x00BFFF'
'.pssc' = '0x00BFFF'
# Javascript
'.js' = '0xF0E68C'
'.esx' = '0xF0E68C'
'.mjs' = '0xF0E68C'
# Java
'.java' = '0xF89820'
'.jar' = '0xF89820'
'.gradle' = '0x39D52D'
# Python
'.py' = '0x4B8BBE'
'.ipynb' = '0x4B8BBE'
# React
'.jsx' = '0x20B2AA'
'.tsx' = '0x20B2AA'
# Typescript
'.ts' = '0xF0E68C'
# Not-executable code files
'.dll' = '0x87CEEB'
# Importable Data files
'.clixml' = '0x00BFFF'
'.csv' = '0x9ACD32'
'.tsv' = '0x9ACD32'
# Settings
'.ini' = '0x6495ED'
'.dlc' = '0x6495ED'
'.config' = '0x6495ED'
'.conf' = '0x6495ED'
'.properties' = '0x6495ED'
'.prop' = '0x6495ED'
'.settings' = '0x6495ED'
'.option' = '0x6495ED'
'.reg' = '0x6495ED'
'.props' = '0x6495ED'
'.toml' = '0x6495ED'
'.prefs' = '0x6495ED'
'.sln.dotsettings' = '0x6495ED'
'.sln.dotsettings.user' = '0x6495ED'
'.cfg' = '0x6495ED'
# Source Files
'.c' = '0xA9A9A9'
'.cpp' = '0xA9A9A9'
'.go' = '0x20B2AA'
'.php' = '0x6A5ACD'
# Visual Studio
'.csproj' = '0xEE82EE'
'.ruleset' = '0xEE82EE'
'.sln' = '0xEE82EE'
'.slnf' = '0xEE82EE'
'.suo' = '0xEE82EE'
'.vb' = '0xEE82EE'
'.vbs' = '0xEE82EE'
'.vcxitems' = '0xEE82EE'
'.vcxitems.filters' = '0xEE82EE'
'.vcxproj' = '0xEE82EE'
'.vsxproj.filters' = '0xEE82EE'
# CSharp
'.cs' = '0x7B68EE'
'.csx' = '0x7B68EE'
# Haskell
'.hs' = '0x9932CC'
# XAML
'.xaml' = '0x87CEFA'
# Rust
'.rs' = '0xFF4500'
# Database
'.pdb' = '0xFFD700'
'.sql' = '0xFFD700'
'.pks' = '0xFFD700'
'.pkb' = '0xFFD700'
'.accdb' = '0xFFD700'
'.mdb' = '0xFFD700'
'.sqlite' = '0xFFD700'
'.pgsql' = '0xFFD700'
'.postgres' = '0xFFD700'
'.psql' = '0xFFD700'
# Source Control
'.patch' = '0xFF4500'
# Project files
'.user' = '0x00BFFF'
'.code-workspace' = '0x00BFFF'
# Text data files
'.log' = '0xF0E68C'
'.txt' = '0x00CED1'
# Subtitle files
'.srt' = '0x00CED1'
'.lrc' = '0x00CED1'
'.ass' = '0xC50000'
# HTML/css
'.html' = '0xCD5C5C'
'.htm' = '0xCD5C5C'
'.xhtml' = '0xCD5C5C'
'.html_vm' = '0xCD5C5C'
'.asp' = '0xCD5C5C'
'.css' = '0x87CEFA'
'.sass' = '0xFF00FF'
'.scss' = '0xFF00FF'
'.less' = '0x6B8E23'
# Markdown
'.md' = '0x00BFFF'
'.markdown' = '0x00BFFF'
'.rst' = '0x00BFFF'
# Handlebars
'.hbs' = '0xE37933'
# JSON
'.json' = '0xFFD700'
# YAML
'.yml' = '0xFF6347'
'.yaml' = '0xFF6347'
# LUA
'.lua' = '0x87CEFA'
# Clojure
'.clj' = '0x00FF7F'
'.cljs' = '0x00FF7F'
'.cljc' = '0x00FF7F'
# Groovy
'.groovy' = '0x87CEFA'
# Vue
'.vue' = '0x20B2AA'
# Dart
'.dart' = '0x4682B4'
# Elixir
'.ex' = '0x8B4513'
'.exs' = '0x8B4513'
'.eex' = '0x8B4513'
'.leex' = '0x8B4513'
# Erlang
'.erl' = '0xFF6347'
# Elm
'.elm' = '0x9932CC'
# Applescript
'.applescript' = '0x4682B4'
# XML
'.xml' = '0x98FB98'
'.plist' = '0x98FB98'
'.xsd' = '0x98FB98'
'.dtd' = '0x98FB98'
'.xsl' = '0x98FB98'
'.xslt' = '0x98FB98'
'.resx' = '0x98FB98'
'.iml' = '0x98FB98'
'.xquery' = '0x98FB98'
'.tmLanguage' = '0x98FB98'
'.manifest' = '0x98FB98'
'.project' = '0x98FB98'
# Documents
'.chm' = '0x87CEEB'
'.pdf' = '0xCD5C5C'
# Excel
'.xls' = '0x9ACD32'
'.xlsx' = '0x9ACD32'
# PowerPoint
'.pptx' = '0xDC143C'
'.ppt' = '0xDC143C'
'.pptm' = '0xDC143C'
'.potx' = '0xDC143C'
'.potm' = '0xDC143C'
'.ppsx' = '0xDC143C'
'.ppsm' = '0xDC143C'
'.pps' = '0xDC143C'
'.ppam' = '0xDC143C'
'.ppa' = '0xDC143C'
# Word
'.doc' = '0x00BFFF'
'.docx' = '0x00BFFF'
'.rtf' = '0x00BFFF'
# Audio
'.mp3' = '0xDB7093'
'.flac' = '0xDB7093'
'.m4a' = '0xDB7093'
'.wma' = '0xDB7093'
'.aiff' = '0xDB7093'
'.wav' = '0xDB7093'
'.aac' = '0xDB7093'
'.opus' = '0xDB7093'
# Images
'.png' = '0x20B2AA'
'.jpeg' = '0x20B2AA'
'.jpg' = '0x20B2AA'
'.gif' = '0x20B2AA'
'.ico' = '0x20B2AA'
'.tif' = '0x20B2AA'
'.tiff' = '0x20B2AA'
'.psd' = '0x20B2AA'
'.psb' = '0x20B2AA'
'.ami' = '0x20B2AA'
'.apx' = '0x20B2AA'
'.bmp' = '0x20B2AA'
'.bpg' = '0x20B2AA'
'.brk' = '0x20B2AA'
'.cur' = '0x20B2AA'
'.dds' = '0x20B2AA'
'.dng' = '0x20B2AA'
'.eps' = '0x20B2AA'
'.exr' = '0x20B2AA'
'.fpx' = '0x20B2AA'
'.gbr' = '0x20B2AA'
'.jbig2' = '0x20B2AA'
'.jb2' = '0x20B2AA'
'.jng' = '0x20B2AA'
'.jxr' = '0x20B2AA'
'.pbm' = '0x20B2AA'
'.pgf' = '0x20B2AA'
'.pic' = '0x20B2AA'
'.raw' = '0x20B2AA'
'.webp' = '0x20B2AA'
'.svg' = '0xF4A460'
# Video
'.webm' = '0xFFA500'
'.mkv' = '0xFFA500'
'.flv' = '0xFFA500'
'.vob' = '0xFFA500'
'.ogv' = '0xFFA500'
'.ogg' = '0xFFA500'
'.gifv' = '0xFFA500'
'.avi' = '0xFFA500'
'.mov' = '0xFFA500'
'.qt' = '0xFFA500'
'.wmv' = '0xFFA500'
'.yuv' = '0xFFA500'
'.rm' = '0xFFA500'
'.rmvb' = '0xFFA500'
'.mp4' = '0xFFA500'
'.mpg' = '0xFFA500'
'.mp2' = '0xFFA500'
'.mpeg' = '0xFFA500'
'.mpe' = '0xFFA500'
'.mpv' = '0xFFA500'
'.m2v' = '0xFFA500'
# Email
'.ics' = '0x00CED1'
# Certifactes
'.cer' = '0xFF6347'
'.cert' = '0xFF6347'
'.crt' = '0xFF6347'
'.pfx' = '0xFF6347'
# Keys
'.pem' = '0x66CDAA'
'.pub' = '0x66CDAA'
'.key' = '0x66CDAA'
'.asc' = '0x66CDAA'
'.gpg' = '0x66CDAA'
# Fonts
'.woff' = '0xDC143C'
'.woff2' = '0xDC143C'
'.ttf' = '0xDC143C'
'.eot' = '0xDC143C'
'.suit' = '0xDC143C'
'.otf' = '0xDC143C'
'.bmap' = '0xDC143C'
'.fnt' = '0xDC143C'
'.odttf' = '0xDC143C'
'.ttc' = '0xDC143C'
'.font' = '0xDC143C'
'.fonts' = '0xDC143C'
'.sui' = '0xDC143C'
'.ntf' = '0xDC143C'
'.mrg' = '0xDC143C'
# Ruby
'.rb' = '0xFF0000'
'.erb' = '0xFF0000'
'.gemfile' = '0xFF0000'
# FSharp
'.fs' = '0x00BFFF'
'.fsx' = '0x00BFFF'
'.fsi' = '0x00BFFF'
'.fsproj' = '0x00BFFF'
# Docker
'.dockerignore' = '0x4682B4'
'.dockerfile' = '0x4682B4'
# VSCode
'.vscodeignore' = '0x6495ED'
'.vsixmanifest' = '0x6495ED'
'.vsix' = '0x6495ED'
'.code-workplace' = '0x6495ED'
# Sublime
'.sublime-project' = '0xF4A460'
'.sublime-workspace' = '0xF4A460'
'.lock' = '0xDAA520'
# Terraform
'.tf' = '0x948EEC'
'.tfvars' = '0x948EEC'
'.auto.tfvars' = '0x948EEC'
# Disk Image
'.vmdk' = '0xE1E3E6'
'.vhd' = '0xE1E3E6'
'.vhdx' = '0xE1E3E6'
'.img' = '0xE1E3E6'
'.iso' = '0xE1E3E6'
# R language
'.R' = '0x276DC3'
'.Rmd' = '0x276DC3'
'.Rproj' = '0x276DC3'
# Julia language
'.jl' = '0x9259a3'
# Vim
'.vim' = '0x019833'
}
$PSStyle.FileInfo.Extension.clear()
foreach ($item in $colorMap.GetEnumerator()) {
$PSStyle.FileInfo.Extension.add($item.Name, $PSStyle.Foreground.FromRgb($item.Value))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment