Updated .zshrc & added ohmyposh

This commit is contained in:
JirR02 2024-06-18 08:02:11 +02:00
parent 706e47cbe4
commit c7a159f28f
2 changed files with 76 additions and 10 deletions

View File

@ -0,0 +1,74 @@
#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version = 2
inal_space = true
console_title_template = '{{ .Shell }} in {{ .Folder }}'
[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true
[[blocks.segments]]
type = 'text'
style = 'plain'
foreground = 'p:white'
template = "{{ .UserName }} in "
[[blocks.segments]]
type = 'path'
style = 'plain'
background = 'transparent'
foreground = 'p:purple'
template = "{{ .Path }}"
[blocks.segments.properties]
style = 'full'
[[blocks]]
type = 'prompt'
alignment = 'right'
[[blocks.segments]]
type = 'git'
style = 'plain'
background = 'transparent'
foreground = 'p:white'
template = "{{ .UpstreamIcon }} {{ .HEAD }}<p:green>{{ if .Working.Added }}  {{ .Working.String }}{{ end }}</><p:red>{{ if .Working.Deleted }} 󰗨 {{ .Working.String }}{{ end }}</><p:orange>{{ if .Working.Modified }}  {{ .Working.String }}{{end}}</><p:yellow>{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }}</>"
[blocks.segments.properties]
branch_icon = ''
fetch_status = true
fetch_upstream_icon = true
[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true
[[blocks.segments]]
type = 'text'
style = 'plain'
background = 'transparent'
foreground_templates = [
"{{if gt .Code 0}}p:red{{end}}",
"{{if eq .Code 0}}p:magenta{{end}}",
]
template = ' '
[transient_prompt]
background = 'transparent'
foreground_templates = [
"{{if gt .Code 0}}p:red{{end}}",
"{{if eq .Code 0}}p:magenta{{end}}",
]
template = ' '
[palette]
purple = "#9580ff"
magenta = "#ff80bf"
white = "#eeeeee"
red = "#ff5555"
green = "#8aff80"
orange = "#ffca80"
yellow = "#f1fa8c"

12
.zshrc
View File

@ -1,6 +1,3 @@
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
@ -8,7 +5,6 @@ export ZSH="$HOME/.oh-my-zsh"
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
@ -99,10 +95,6 @@ export DBUS_SESSION_BUS_ADRESS="unix:path=$DBUS_LAUNCHD_SESSION_BUS_SOCKET"
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
plugins=(zsh-autosuggestions sudo zsh-syntax-highlighting)
# on startup
eval $(thefuck --alias)
@ -267,8 +259,8 @@ function importimg {
done
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Initialize Oh My Posh
eval "$(oh-my-posh init zsh --config ~/.config/ohmyposh/config.toml)"
# Setup fzf key bindings and fuzzy completion
eval "$(fzf --zsh)"