Skip to content

Instantly share code, notes, and snippets.

@RalkeyOfficial
Last active July 15, 2022 11:23
Show Gist options
  • Save RalkeyOfficial/3f2b2da6d3abd5c5cca9a6de083d0f5c to your computer and use it in GitHub Desktop.
Save RalkeyOfficial/3f2b2da6d3abd5c5cca9a6de083d0f5c to your computer and use it in GitHub Desktop.
The Config i use for my terminal
# oh-my-posh init pwsh --config $env:POSH_THEMES_PATH\tiwahu.omp.json | Invoke-Expression
Invoke-Expression (&starship init powershell)
# Import the Chocolatey Profile that contains the necessary code to enable
# tab-completions to function for `choco`.
# Be aware that if you are missing these lines from your profile, tab completion
# for `choco` will not function.
# See https://ch0.co/tab-completion for details.
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
# use bat as replacement for cat
function btfl([string]$File) {
if ($file -eq "") {
write-error("enter a file")
} else {
bat --paging=never $File
}
}
set-alias cat btfl
# create alias for Start-Process called "open"
# this is used to open files using the default method of opening said file
set-alias open Start-Process
# create alias for gci (get-childitem) called "find"
# this is used to find files in current directory
# usage: find 'desired directory' -r -fi 'file regex'
# example: find . -r -fi '*.ps1'
# [.] acts as the current directory | [*.ps1] means any file name that MUST end on .ps1
# [-r] means recursive | [-fi] means find files that match the regex
set-alias find gci
# Shows navigable menu of all options when hitting Tab
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
# set alias for WSL htop. htop is a resource monitor
function startHtop() {
wsl htop
}
set-alias htop startHtop
# set alias to use nano from the WSL
function startNano([string]$File) {
wsl nano $File
}
set-alias nano startNano
# set alias for fcrackzip to crack zip files
function startFcrackzip([string]$File) {
wsl fcrackzip $File
}
set-alias fcrackzip startFcrackzip
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command": "paste",
"keys": "ctrl+v"
},
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"keys": "alt+shift+d"
}
],
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"initialCols": 130,
"initialRows": 40,
"profiles":
{
"defaults":
{
"colorScheme": "xcad_tdl",
"experimental.retroTerminalEffect": false,
"font":
{
"face": "CaskaydiaCove NF"
}
},
"list":
[
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"commandline": "pwsh.exe -nologo",
"source": "Windows.Terminal.PowershellCore"
},
{
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": true,
"name": "Windows PowerShell"
},
{
"commandline": "%SystemRoot%\\System32\\cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "Command Prompt"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": true,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{8cc65dfb-9c4a-5be5-a2f6-2686cd9453f3}",
"hidden": true,
"name": "Developer Command Prompt for VS 2022",
"source": "Windows.Terminal.VisualStudio"
},
{
"guid": "{e02fe882-0852-5908-a632-caa46a419303}",
"hidden": true,
"name": "Developer PowerShell for VS 2022",
"source": "Windows.Terminal.VisualStudio"
},
{
"guid": "{51855cb2-8cce-5362-8f54-464b92b32386}",
"hidden": false,
"name": "Ubuntu",
"source": "CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc"
}
]
},
"schemes":
[
{
"background": "#080808",
"black": "#0A0A0A",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#012456",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell Powershell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#282C34",
"black": "#282C34",
"blue": "#61AFEF",
"brightBlack": "#5A6374",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#DCDFE4",
"brightYellow": "#E5C07B",
"cursorColor": "#FFFFFF",
"cyan": "#56B6C2",
"foreground": "#DCDFE4",
"green": "#98C379",
"name": "One Half Dark",
"purple": "#C678DD",
"red": "#E06C75",
"selectionBackground": "#FFFFFF",
"white": "#DCDFE4",
"yellow": "#E5C07B"
},
{
"background": "#FAFAFA",
"black": "#383A42",
"blue": "#0184BC",
"brightBlack": "#4F525D",
"brightBlue": "#61AFEF",
"brightCyan": "#56B5C1",
"brightGreen": "#98C379",
"brightPurple": "#C577DD",
"brightRed": "#DF6C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#E4C07A",
"cursorColor": "#4F525D",
"cyan": "#0997B3",
"foreground": "#383A42",
"green": "#50A14F",
"name": "One Half Light",
"purple": "#A626A4",
"red": "#E45649",
"selectionBackground": "#FFFFFF",
"white": "#FAFAFA",
"yellow": "#C18301"
},
{
"background": "#002B36",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#FFFFFF",
"cyan": "#2AA198",
"foreground": "#839496",
"green": "#859900",
"name": "Solarized Dark",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#FDF6E3",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#002B36",
"cyan": "#2AA198",
"foreground": "#657B83",
"green": "#859900",
"name": "Solarized Light",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#FFFFFF",
"cyan": "#06989A",
"foreground": "#D3D7CF",
"green": "#4E9A06",
"name": "Tango Dark",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#FFFFFF",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#000000",
"cyan": "#06989A",
"foreground": "#555753",
"green": "#4E9A06",
"name": "Tango Light",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#300A24",
"black": "#171421",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#08458F",
"brightCyan": "#2C9FB3",
"brightGreen": "#26A269",
"brightPurple": "#A347BA",
"brightRed": "#C01C28",
"brightWhite": "#F2F2F2",
"brightYellow": "#A2734C",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#FFFFFF",
"green": "#26A269",
"name": "Ubuntu-ColorScheme",
"purple": "#881798",
"red": "#C21A23",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#A2734C"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#000080",
"brightBlack": "#808080",
"brightBlue": "#0000FF",
"brightCyan": "#00FFFF",
"brightGreen": "#00FF00",
"brightPurple": "#FF00FF",
"brightRed": "#FF0000",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFFF00",
"cursorColor": "#FFFFFF",
"cyan": "#008080",
"foreground": "#C0C0C0",
"green": "#008000",
"name": "Vintage",
"purple": "#800080",
"red": "#800000",
"selectionBackground": "#FFFFFF",
"white": "#C0C0C0",
"yellow": "#808000"
},
{
"background": "#111927",
"black": "#000000",
"blue": "#004CFF",
"brightBlack": "#666666",
"brightBlue": "#5CB2FF",
"brightCyan": "#5CECC6",
"brightGreen": "#C5F467",
"brightPurple": "#AE81FF",
"brightRed": "#FF8484",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFCC5C",
"cursorColor": "#FFFFFF",
"cyan": "#2EE7B6",
"foreground": "#D4D4D4",
"green": "#9FEF00",
"name": "xcad_hackthebox",
"purple": "#BC3FBC",
"red": "#FF3E3E",
"selectionBackground": "#FFFFFF",
"white": "#FFFFFF",
"yellow": "#FFAF00"
},
{
"background": "#1A1A1A",
"black": "#121212",
"blue": "#2B4FFF",
"brightBlack": "#2F2F2F",
"brightBlue": "#5C78FF",
"brightCyan": "#5AC8FF",
"brightGreen": "#905AFF",
"brightPurple": "#5EA2FF",
"brightRed": "#BA5AFF",
"brightWhite": "#FFFFFF",
"brightYellow": "#685AFF",
"cursorColor": "#FFFFFF",
"cyan": "#28B9FF",
"foreground": "#F1F1F1",
"green": "#7129FF",
"name": "xcad_tdl",
"purple": "#2883FF",
"red": "#A52AFF",
"selectionBackground": "#FFFFFF",
"white": "#F1F1F1",
"yellow": "#3D2AFF"
},
{
"background": "#0F0F0F",
"black": "#000000",
"blue": "#2878FF",
"brightBlack": "#2F2F2F",
"brightBlue": "#5E99FF",
"brightCyan": "#5AD6FF",
"brightGreen": "#FFB15A",
"brightPurple": "#935CFF",
"brightRed": "#FF755A",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFD25A",
"cursorColor": "#FFFFFF",
"cyan": "#28C8FF",
"foreground": "#F1F1F1",
"green": "#FF9A28",
"name": "xcad_tdl_colorful",
"purple": "#732BFF",
"red": "#FF4C27",
"selectionBackground": "#FFFFFF",
"white": "#F1F1F1",
"yellow": "#FFC72A"
},
{
"background": "#0F0F0F",
"black": "#000000",
"blue": "#184AE8",
"brightBlack": "#5F5F5F",
"brightBlue": "#4771F5",
"brightCyan": "#31C1FF",
"brightGreen": "#FFD631",
"brightPurple": "#7631FF",
"brightRed": "#FF3190",
"brightWhite": "#FFFFFF",
"brightYellow": "#FF9731",
"cursorColor": "#FFFFFF",
"cyan": "#008DCB",
"foreground": "#D9D9D9",
"green": "#CBA300",
"name": "xcad_tdl_old",
"purple": "#4300CB",
"red": "#CB005F",
"selectionBackground": "#FFFFFF",
"white": "#CFCFCF",
"yellow": "#CB6600"
},
{
"background": "#282C34",
"black": "#000000",
"blue": "#007ACC",
"brightBlack": "#75715E",
"brightBlue": "#11A8CD",
"brightCyan": "#11A8CD",
"brightGreen": "#0DBC79",
"brightPurple": "#AE81FF",
"brightRed": "#DD6B65",
"brightWhite": "#F8F8F2",
"brightYellow": "#E6DB74",
"cursorColor": "#FFFFFF",
"cyan": "#11A8CD",
"foreground": "#D4D4D4",
"green": "#0DBC79",
"name": "xcad_vscode",
"purple": "#BC3FBC",
"red": "#F4423A",
"selectionBackground": "#FFFFFF",
"white": "#F8F8F2",
"yellow": "#E5E510"
}
]
}
# ~/.config/starship.toml
# Inserts a blank line between shell prompts
add_newline = true
# Change command timeout from 500 to 1000 ms
command_timeout = 1000
# Change the default prompt format
format = """\
[╭╴](238)$env_var\
$all[╰─](238)$character"""
#
# Change the default prompt characters
[character]
success_symbol = "[](238)"
error_symbol = "[](238)"
# Shows an icon that should be included by zshrc script based on the distribution or os
[env_var.STARSHIP_DISTRO]
format = '[$env_value](white)'
variable = "STARSHIP_DISTRO"
disabled = false
# Shows the username
[username]
style_user = "white"
style_root = "white"
format = "[$user]($style) "
disabled = false
show_always = true
[hostname]
ssh_only = false
format = "on [$hostname](bold yellow) "
disabled = false
[directory]
truncation_length = 3
truncation_symbol = "…/"
home_symbol = " ~"
read_only_style = "197"
read_only = "  "
format = "at [$path]($style)[$read_only]($read_only_style) "
[git_branch]
symbol = " "
format = "via [$symbol$branch]($style) "
truncation_length = 4
truncation_symbol = "…/"
style = "bold green"
[git_status]
format = '[\($all_status$ahead_behind\)]($style) '
style = "bold green"
conflicted = "🏳"
up_to_date = " "
untracked = " "
ahead = "⇡${count}"
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
behind = "⇣${count}"
stashed = " "
modified = " "
staged = '[++\($count\)](green)'
renamed = "襁 "
deleted = " "
[terraform]
format = "via [ terraform $version]($style) 壟 [$workspace]($style) "
[vagrant]
format = "via [ vagrant $version]($style) "
[docker_context]
format = "via [ $context](bold blue) "
[helm]
format = "via [ $version](bold purple) "
[python]
symbol = " "
python_binary = "python3"
[nodejs]
format = "via [ $version](bold green) "
disabled = true
[ruby]
format = "via [ $version]($style) "
[kubernetes]
format = 'via [ﴱ $context\($namespace\)](bold purple) '
disabled = false
[kubernetes.context_aliases]
"do-fra1-prod-k8s-clcreative" = " lgcy-1"
"infra-home-kube-prod-1" = " prod-1"
"infra-home-kube-prod-2" = " prod-2"
"infra-cloud-kube-prod-1" = " prod-1"
"infra-cloud-kube-test-1" = " test-1"

this is for powershell on windows

install nerdfonts - Caskaydia Cove Nerd Font https://www.nerdfonts.com/font-downloads

starship https://starship.rs/

if you dont like starship install oh-my-posh https://ohmyposh.dev/docs/installation/windows

install chocolatey https://chocolatey.org/install

install bat (better cat) choco install bat


open the powershell profile you can see the profile directory by typing $profile

if it returns nothing type New-Item -Path $profile -Type File -Force

and repeat the step

paste or replace the profile with my profile config


open the starship configuration .config/starship.toml

paste or replace the starship.toml file with my file


open the Terminal configuration open terminal -> settings -> open JSON file

and paste my configuration in there

after that go to the default profile in terminal settings -> appearance change the color scheme to xcad_tdl change font face to CaskaydiaCove NF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment