-
-
Save yuchen/00e8ffbdf6cce60471b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Aliasses | |
Set-Alias l ls | |
Set-Alias e explorer | |
# Force coloring of git and npm commands | |
$env:TERM = 'cygwin' # windows-ansi | cygwin | |
$env:LESS = 'FRSX' | |
# | |
# Custom prompt | |
# | |
# bran at ubuntu in ~/Source/techradar on docker node v0.11.12 | |
# $ _ | |
# | |
function prompt | |
{ | |
# Grab git branch | |
$git_string = ""; | |
git branch | foreach { | |
if ($_ -match "^\* (.*)") { | |
$git_string += $matches[1] | |
} | |
} | |
# User (orange) | |
Write-Host ("") | |
Write-Host ([Environment]::UserName) -nonewline -foregroundcolor DarkRed | |
# Host (yellow) | |
Write-Host (" at ") -nonewline -foregroundcolor White | |
Write-Host ([System.Net.Dns]::GetHostName().ToLower()) -nonewline -foregroundcolor DarkYellow | |
# Dir (green) | |
Write-Host (" in ") -nonewline -foregroundcolor White | |
Write-Host ($(get-location)) -nonewline -foregroundcolor DarkGreen | |
# Git (purple) | |
if ($git_string) { | |
Write-Host (" on ") -nonewline -foregroundcolor White | |
Write-Host ($git_string) -nonewline -foregroundcolor Cyan | |
} | |
# Node (cyan) | |
if (Test-Path ".\package.json") { | |
Write-Host (" node ") -nonewline -foregroundcolor White | |
Write-Host (node -v) -nonewline -foregroundcolor Blue | |
} | |
Write-Host ("") | |
Write-Host ("$") -nonewline -foregroundcolor White | |
return " " | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment