Skip to content

Instantly share code, notes, and snippets.

@deverebor
Last active May 1, 2023 12:46
Embed
What would you like to do?
PowerShell + Windows Terminal - Personal settings

My settings:

Plugins

  • posh-git (sintax highlight for git)
  • Terminal-Icons (show icons using dir or ls)
  • oh-my-posh (theming)
  • PSReadlines (auto sugestions & auto complete)
  • PSFzf (recursive search)
  • z search (global search using z prefix to access some folder)

Theme

I created one version of spaceship for oh my posh. To use you only need download and put on the same directory of your powershell profile.

Your terminal will look like this

default

image

terminal icons

image

node project

image

java project

image

python project

image

{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "lightYellow",
"properties": {
"macos": "mac"
},
"style": "plain",
"template": "{{ if .WSL }}WSL at {{ end }}{{.Icon}} ",
"type": "os"
},
{
"foreground": "lightYellow",
"style": "plain",
"template": "{{ .UserName }} ",
"type": "session"
},
{
"foreground": "cyan",
"properties": {
"style": "folder"
},
"style": "plain",
"template": "<#ffffff>in</> {{ .Path }} ",
"type": "path"
},
{
"type": "git",
"style": "plain",
"foreground": "#ff94df",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}{{ end }}",
"{{ if gt .Ahead 0 }}{{ end }}",
"{{ if gt .Behind 0 }}{{ end }}"
],
"template": "<#ffffff>on</> {{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }} ",
"properties": {
"fetch_status": true,
"fetch_stash_count": true,
"fetch_upstream_icon": true,
"untracked_modes": {
"/Users/user/Projects/oh-my-posh/": "yes"
}
}
},
{
"foreground": "#ea2d2e",
"style": "powerline",
"template": "<#ffffff>via</> \ue738 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ",
"type": "java"
},
{
"foreground": "#906cff",
"style": "powerline",
"template": "<#ffffff>via</> \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ",
"type": "python"
},
{
"foreground": "#76b367",
"style": "powerline",
"template": "<#ffffff>via</> \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
"type": "node"
}
],
"type": "prompt"
},
{
"alignment": "left",
"newline": false,
"segments": [
{
"foreground": "lightGreen",
"style": "plain",
"template": "\u276f",
"type": "text"
}
],
"type": "prompt"
}
],
"osc99": true,
"final_space": true,
"version": 2
}
"defaults":
{
"colorScheme": "One Dark",
"font":
{
"face": "JetBrains Nerd Font",
"size": 12
},
"padding": "5",
"useAcrylic": true,
"acrylicOpacity": 0.75
},
"schemes":
[
{
"name": "Campbell",
"background": "#0C0C0C",
"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",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"name": "One Dark",
"background": "#1E2127",
"black": "#000000",
"blue": "#61AFEF",
"brightBlack": "#5C6370",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#D19A66",
"cyan": "#56B6C2",
"foreground": "#5C6370",
"green": "#98C379",
"purple": "#C678DD",
"red": "#E06C75",
"white": "#ABB2BF",
"yellow": "#D19A66"
},
{
"name": "One Light",
"background": "#F9F9F9",
"black": "#000000",
"blue": "#4078F2",
"brightBlack": "#383A42",
"brightBlue": "#4078F2",
"brightCyan": "#0184BC",
"brightGreen": "#50A14F",
"brightPurple": "#A626A4",
"brightRed": "#E45649",
"brightWhite": "#FFFFFF",
"brightYellow": "#986801",
"cyan": "#0184BC",
"foreground": "#383A42",
"green": "#50A14F",
"purple": "#A626A4",
"red": "#E45649",
"white": "#A0A1A7",
"yellow": "#986801"
},
{
"name": "MaterialDark",
"background": "#232322",
"black": "#212121",
"blue": "#134EB2",
"brightBlack": "#424242",
"brightBlue": "#54A4F3",
"brightCyan": "#26BBD1",
"brightGreen": "#7ABA3A",
"brightPurple": "#AA4DBC",
"brightRed": "#E83B3F",
"brightWhite": "#D9D9D9",
"brightYellow": "#FFEA2E",
"cursorColor": "#16AFCA",
"cyan": "#0E717C",
"foreground": "#E5E5E5",
"green": "#457B24",
"purple": "#560088",
"red": "#B7141F",
"selectionBackground": "#DFDFDF",
"white": "#EFEFEF",
"yellow": "#F6981E"
},
{
"name": "MaterialDarker",
"background": "#212121",
"black": "#000000",
"blue": "#82AAFF",
"brightBlack": "#545454",
"brightBlue": "#82AAFF",
"brightCyan": "#89DDFF",
"brightGreen": "#C3E88D",
"brightPurple": "#C792EA",
"brightRed": "#FF5370",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFCB6B",
"cursorColor": "#FFFFFF",
"cyan": "#89DDFF",
"foreground": "#EEFFFF",
"green": "#C3E88D",
"purple": "#C792EA",
"red": "#FF5370",
"selectionBackground": "#EEFFFF",
"white": "#FFFFFF",
"yellow": "#FFCB6B"
},
{
"name": "OneDark",
"black": "#1e2127",
"red": "#e06c75",
"green": "#98c379",
"yellow": "#d19a66",
"blue": "#61afef",
"purple": "#c678dd",
"cyan": "#56b6c2",
"white": "#abb2bf",
"brightBlack": "#5c6370",
"brightRed": "#e06c75",
"brightGreen": "#98c379",
"brightYellow": "#d19a66",
"brightBlue": "#61afef",
"brightPurple": "#c678dd",
"brightCyan": "#56b6c2",
"brightWhite": "#ffffff",
"background": "#1e2127",
"foreground": "#abb2bf"
},
{
"name": "OneHalfDark",
"black": "#282c34",
"red": "#e06c75",
"green": "#98c379",
"yellow": "#e5c07b",
"blue": "#61afef",
"purple": "#c678dd",
"cyan": "#56b6c2",
"white": "#dcdfe4",
"brightBlack": "#282c34",
"brightRed": "#e06c75",
"brightGreen": "#98c379",
"brightYellow": "#e5c07b",
"brightBlue": "#61afef",
"brightPurple": "#c678dd",
"brightCyan": "#56b6c2",
"brightWhite": "#dcdfe4",
"background": "#282c34",
"foreground": "#dcdfe4",
"selectionBackground": "#474e5d",
"cursorColor": "#a3b3cc"
},
{
"name": "WarmNeon",
"black": "#000000",
"red": "#e24346",
"green": "#39b13a",
"yellow": "#dae145",
"blue": "#4261c5",
"purple": "#f920fb",
"cyan": "#2abbd4",
"white": "#d0b8a3",
"brightBlack": "#fefcfc",
"brightRed": "#e97071",
"brightGreen": "#9cc090",
"brightYellow": "#ddda7a",
"brightBlue": "#7b91d6",
"brightPurple": "#f674ba",
"brightCyan": "#5ed1e5",
"brightWhite": "#d8c8bb",
"background": "#404040",
"foreground": "#afdab6",
"selectionBackground": "#b0ad21",
"cursorColor": "#30ff24"
}
],
"tabWidthMode": "equal",
"theme": "system"
}
# @author: deverebor
# @version: 2.0
# set PowerShell to UTF-8
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
# Modules used
Import-Module posh-git
Import-Module -Name Terminal-Icons
# Configure starship
Invoke-Expression (&starship init powershell)
# Auto complete, keybinds and command history
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadlineOption -HistorySearchCursorMovesToEnd
# Auto sugestions of PSReadline
Set-PSReadlineOption -ShowToolTips
Set-PSReadlineOption -PredictionViewStyle InlineView
Set-PSReadLineOption -PredictionSource History
# Utilities
# Function for finding the path of a given content.
function which ($command) {
Get-Command -Name $command -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue
}
# Function for create venv
function create-venv {
python '-m' 'venv' '.venv'
& '.\venv\Scripts\activate'
}
# Function to enter into a venv
function venv {
& '.\.venv\Scripts\activate'
}
@deverebor
Copy link
Author

Para escolher o seu tema visite: https://windowsterminalthemes.dev/

 "useAcrylic": true, 
 "acrylicOpacity": 0.75

São responsáveis pela opacidade do seu terminal.

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