Skip to content

Instantly share code, notes, and snippets.

@washopilot
Last active March 12, 2025 20:14
Show Gist options
  • Save washopilot/225385825d726794e1d0788c507db27b to your computer and use it in GitHub Desktop.
Save washopilot/225385825d726794e1d0788c507db27b to your computer and use it in GitHub Desktop.
Configure zsh, antidote and oh-my-posh
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"palette": {
"black": "#262B44",
"blue": "#4B95E9",
"green": "#59C9A5",
"orange": "#F07623",
"red": "#D81E5B",
"white": "#E0DEF4",
"yellow": "#F3AE35"
},
"secondary_prompt": {
"template": "<p:yellow,transparent>\ue0b6</><,p:yellow> > </><p:yellow,transparent>\ue0b0</> ",
"foreground": "p:black",
"background": "transparent"
},
"console_title_template": "{{ .Shell }} in {{ .Folder }}",
"upgrade": {
"source": "cdn",
"interval": "168h",
"auto": false,
"notice": false
},
"blocks": [
{
"type": "prompt",
"alignment": "left",
"newline": true,
"segments": [
{
"leading_diamond": "\ue0b6",
"trailing_diamond": "\ue0b0",
"template": " {{ if .SSHSession }}\ueba9 {{ end }}{{ .UserName }} ",
"foreground": "p:black",
"background": "p:yellow",
"type": "session",
"style": "diamond"
},
{
"properties": {
"style": "folder"
},
"template": " \uea83 {{ path .Path .Location }} ",
"foreground": "p:white",
"powerline_symbol": "\ue0b0",
"background": "p:orange",
"type": "path",
"style": "powerline"
},
{
"properties": {
"branch_template": "{{ trunc 25 .Branch }}",
"fetch_status": true,
"fetch_upstream_icon": true
},
"template": " {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }} ",
"foreground": "p:black",
"powerline_symbol": "\ue0b0",
"background": "p:green",
"type": "git",
"style": "powerline",
"foreground_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}p:black{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:white{{ end }}",
"{{ if gt .Ahead 0 }}p:white{{ end }}"
],
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}p:yellow{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}p:red{{ end }}",
"{{ if gt .Ahead 0 }}#49416D{{ end }}",
"{{ if gt .Behind 0 }}#7A306C{{ end }}"
]
},
{
"template": " \uf0e7 ",
"foreground": "p:white",
"powerline_symbol": "\ue0b0",
"background": "p:yellow",
"type": "root",
"style": "powerline"
},
{
"properties": {
"always_enabled": true
},
"leading_diamond": "<transparent,background>\ue0b0</>",
"trailing_diamond": "\ue0b4",
"template": " {{ if gt .Code 0 }}\uf00d{{ else }}\uf00c{{ end }} ",
"foreground": "p:white",
"background": "p:blue",
"type": "status",
"style": "diamond",
"background_templates": [
"{{ if gt .Code 0 }}p:red{{ end }}"
]
}
]
},
{
"type": "rprompt",
"segments": [
{
"properties": {
"display_mode": "files",
"fetch_package_manager": false,
"home_enabled": false
},
"template": "\ue718 ",
"foreground": "p:green",
"background": "transparent",
"type": "node",
"style": "plain"
},
{
"properties": {
"fetch_version": false
},
"template": "\ue626 ",
"foreground": "p:blue",
"background": "transparent",
"type": "go",
"style": "plain"
},
{
"properties": {
"display_mode": "files",
"fetch_version": false,
"fetch_virtual_env": false
},
"template": "\ue235 ",
"foreground": "p:yellow",
"background": "transparent",
"type": "python",
"style": "plain"
},
{
"template": "in <p:blue><b>{{ .Name }}</b></> ",
"foreground": "p:white",
"background": "transparent",
"type": "shell",
"style": "plain"
},
{
"template": "at <p:blue><b>{{ .CurrentDate | date \"15:04:05\" }}</b></>",
"foreground": "p:white",
"background": "transparent",
"type": "time",
"style": "plain"
}
]
}
],
"tooltips": [
{
"properties": {
"display_default": true
},
"leading_diamond": "\ue0b0",
"trailing_diamond": "\ue0b4",
"template": " \ue7ad {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ",
"foreground": "p:white",
"background": "p:orange",
"type": "aws",
"style": "diamond",
"tips": [
"aws"
]
},
{
"properties": {
"display_default": true
},
"leading_diamond": "\ue0b0",
"trailing_diamond": "\ue0b4",
"template": " \uebd8 {{ .Name }} ",
"foreground": "p:white",
"background": "p:blue",
"type": "az",
"style": "diamond",
"tips": [
"az"
]
}
],
"version": 3,
"final_space": true
}
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"palette": {
"black": "#262B44",
"blue": "#4B95E9",
"green": "#59C9A5",
"orange": "#F07623",
"red": "#D81E5B",
"white": "#E0DEF4",
"yellow": "#F3AE35"
},
"blocks": [
{
"alignment": "left",
"type": "prompt",
"newline": true,
"segments": [
{
"background": "#0C212F",
"foreground": "#FFFFFF",
"leading_powerline_symbol": "\ue0b6",
"style": "powerline",
"template": " {{ .Icon }} ",
"powerline_symbol": "\ue0b0",
"type": "os"
},
{
"background": "#DE2121",
"foreground": "#FFFFFF",
"leading_diamond": "<transparent,#DE2121>\ue0b0</>",
"style": "diamond",
"template": " \uf0e7 ",
"trailing_diamond": "\ue0b0",
"type": "root"
},
{
"background": "#26BDBB",
"foreground": "#0C212F",
"leading_powerline_symbol": "",
"properties": {
"folder_icon": "...",
"folder_separator_icon": "<transparent> \ue0b1 </>",
"home_icon": "\ueb06",
"style": "agnoster_short"
},
"style": "powerline",
"template": " {{ .Path }} ",
"powerline_symbol": "\ue0b0",
"type": "path"
},
{
"background": "#280C2E",
"leading_powerline_symbol": "",
"background_templates": [
"{{ if or (.Working.Changed) (.Staging.Changed) }}#7621DE{{ end }}",
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#7621DE{{ end }}",
"{{ if gt .Ahead 0 }}#7621DE{{ end }}",
"{{ if gt .Behind 0 }}#7621DE{{ end }}"
],
"foreground": "#FFFFFF",
"powerline_symbol": "\ue0b0",
"properties": {
"fetch_stash_count": true,
"fetch_status": true,
"fetch_upstream_icon": true
},
"style": "powerline",
"template": " {{ .UpstreamIcon }} {{ .HEAD }}{{ if .Staging.Changed }} \uf046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
"type": "git"
},
{
"background": "#910000",
"foreground": "#ffffff",
"leading_powerline_symbol": "",
"style": "powerline",
"template": "<transparent> \uf12a</> {{ reason .Code }} ",
"powerline_symbol": "",
"type": "status"
}
]
},
{
"type": "rprompt",
"segments": [
{
"properties": {
"display_mode": "files",
"fetch_package_manager": false,
"home_enabled": false
},
"template": "\ue718 ",
"foreground": "p:green",
"background": "transparent",
"type": "node",
"style": "plain"
},
{
"properties": {
"fetch_version": false
},
"template": "\ue626 ",
"foreground": "p:blue",
"background": "transparent",
"type": "go",
"style": "plain"
},
{
"properties": {
"display_mode": "files",
"fetch_version": false,
"fetch_virtual_env": false
},
"template": "\ue235 ",
"foreground": "p:yellow",
"background": "transparent",
"type": "python",
"style": "plain"
},
{
"template": "in <p:blue><b>{{ .Name }}</b></> ",
"foreground": "p:white",
"background": "transparent",
"type": "shell",
"style": "plain"
},
{
"template": "at <p:blue><b>{{ .CurrentDate | date \"15:04:05\" }}</b></>",
"foreground": "p:white",
"background": "transparent",
"type": "time",
"style": "plain"
}
]
}
],
"console_title_template": "{{if .Root}} \u26a1 {{end}}{{.Folder | replace \"~\" \"🏠\"}} @ {{.HostName}}",
"final_space": true,
"version": 3
}
# Plugins básicos
zsh-users/zsh-syntax-highlighting
zsh-users/zsh-autosuggestions
# Completado para Docker
getantidote/use-omz # handle OMZ dependencies
ohmyzsh/ohmyzsh path:lib # load OMZ's library
ohmyzsh/ohmyzsh path:plugins/docker
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/zsh-interactive-cd # use fzf application
# Cargar antidote
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
# Aplicar los plugins con antidote
antidote load ${ZDOTDIR:-~}/.zsh_plugins.txt
# Cargar oh-my-posh
export PATH=$PATH:/home/washopilot/.local/bin
eval "$(oh-my-posh init zsh --config ~/.theme.omp.json)"

Colocar zsh como shell por defecto

chsh -s $(which zsh)

Instalar antidote

git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote

Generar bundle de antidote

antidote bundle <~/.zsh_plugins.txt >~/.zsh_plugins.zsh

Instalar oh-my-posh

curl -s https://ohmyposh.dev/install.sh | bash -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment