diff --git a/.config/ohmyposh/zen.toml b/.config/ohmyposh/zen.toml index 536540d..e101282 100644 --- a/.config/ohmyposh/zen.toml +++ b/.config/ohmyposh/zen.toml @@ -1,176 +1,6 @@ -version = 2 -final_space = true console_title_template = '{{ .Shell }} in {{ .Folder }}' - -[[blocks]] - type = 'prompt' - alignment = 'left' - newline = true - - [[blocks.segments]] - type = 'session' - style = 'diamond' - leading_diamond = '' - trailing_diamond = '' - template = ' {{ if .SSHSession }} {{ end }}{{ .UserName }} ' - background = 'p:yellow' - foreground = 'p:black' - - [[blocks.segments]] - type = 'path' - style = 'powerline' - powerline_symbol = '' - template = '  {{ path .Path .Location }} ' - background = 'p:orange' - foreground = 'p:white' - - [blocks.segments.properties] - style = 'folder' - - [[blocks.segments]] - type = 'git' - style = 'powerline' - powerline_symbol = '' - 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 = ' {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }} ' - background = 'p:green' - foreground = 'p:black' - - [blocks.segments.properties] - branch_max_length = 25 - fetch_status = true - fetch_upstream_icon = true - - [[blocks.segments]] - type = 'root' - style = 'powerline' - powerline_symbol = '' - template = '  ' - background = 'p:yellow' - foreground = 'p:white' - - [[blocks.segments]] - type = 'status' - style = 'diamond' - background_templates = ['{{ if gt .Code 0 }}p:red{{ end }}'] - leading_diamond = '' - trailing_diamond = '' - template = ' {{ if gt .Code 0 }}{{ else }}{{ end }} ' - background = 'p:blue' - foreground = 'p:white' - - [blocks.segments.properties] - always_enabled = true - -[[blocks]] - type = 'prompt' - alignment = 'left' - newline = true - - [[blocks.segments]] - type = 'text' - style = 'plain' - foreground_templates = [ - "{{if gt .Code 0}}red{{end}}", - "{{if eq .Code 0}}magenta{{end}}", - ] - background = 'transparent' - template = '❯' - -[[blocks]] - type = 'rprompt' - - [[blocks.segments]] - type = 'node' - style = 'plain' - template = ' ' - background = 'transparent' - foreground = 'p:green' - - [blocks.segments.properties] - display_mode = 'files' - fetch_package_manager = false - home_enabled = false - - [[blocks.segments]] - type = 'go' - style = 'plain' - template = ' ' - background = 'transparent' - foreground = 'p:blue' - - [blocks.segments.properties] - fetch_version = false - - [[blocks.segments]] - type = 'python' - style = 'plain' - template = ' ' - background = 'transparent' - foreground = 'p:yellow' - - [blocks.segments.properties] - display_mode = 'files' - fetch_version = false - fetch_virtual_env = false - - [[blocks.segments]] - type = 'shell' - style = 'plain' - template = 'in {{ .Name }} ' - background = 'transparent' - foreground = 'p:white' - - [[blocks.segments]] - type = 'time' - style = 'plain' - template = 'at {{ .CurrentDate | date "15:04:05" }}' - background = 'transparent' - foreground = 'p:white' - - [[blocks.segments]] - type = 'executiontime' - style = 'plain' - foreground = 'yellow' - background = 'transparent' - template = ' ({{ .FormattedMs }})' - -[[tooltips]] - type = 'aws' - tips = ['aws'] - style = 'diamond' - leading_diamond = '' - trailing_diamond = '' - template = '  {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ' - background = 'p:orange' - foreground = 'p:white' - - [tooltips.properties] - display_default = true - -[[tooltips]] - type = 'az' - tips = ['az'] - style = 'diamond' - leading_diamond = '' - trailing_diamond = '' - template = '  {{ .Name }} ' - background = 'p:blue' - foreground = 'p:white' - - [tooltips.properties] - display_default = true - -[transient_prompt] - template = '<,p:yellow> {{ .Folder }}  ' - background = 'transparent' - foreground = 'p:black' - -[secondary_prompt] - template = '<,p:yellow> >  ' - background = 'transparent' - foreground = 'p:black' +version = 3 +final_space = true [palette] black = '#262B44' @@ -180,3 +10,194 @@ console_title_template = '{{ .Shell }} in {{ .Folder }}' red = '#D81E5B' white = '#E0DEF4' yellow = '#F3AE35' + +[secondary_prompt] + template = '<,p:yellow> >  ' + foreground = 'p:black' + background = 'transparent' + +[transient_prompt] + template = '<,p:yellow> {{ .Folder }}  ' + foreground = 'p:black' + background = 'transparent' + +[[blocks]] + type = 'prompt' + alignment = 'left' + newline = true + + [[blocks.segments]] + leading_diamond = '' + trailing_diamond = '' + template = ' {{ if .SSHSession }} {{ end }}{{ .UserName }} ' + foreground = 'p:black' + background = 'p:yellow' + type = 'session' + style = 'diamond' + + [blocks.segments.properties] + cache_duration = 'none' + + [[blocks.segments]] + template = '  {{ path .Path .Location }} ' + foreground = 'p:white' + powerline_symbol = '' + background = 'p:orange' + type = 'path' + style = 'powerline' + + [blocks.segments.properties] + cache_duration = 'none' + style = 'folder' + + [[blocks.segments]] + template = ' {{ if .UpstreamURL }}{{ url .UpstreamIcon .UpstreamURL }} {{ end }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }}  {{ .Working.String }}{{ end }}{{ if .Staging.Changed }}  {{ .Staging.String }}{{ end }} ' + foreground = 'p:black' + powerline_symbol = '' + 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 }}'] + + [blocks.segments.properties] + branch_max_length = 25 + cache_duration = 'none' + fetch_status = true + fetch_upstream_icon = true + + [[blocks.segments]] + template = '  ' + foreground = 'p:white' + powerline_symbol = '' + background = 'p:yellow' + type = 'root' + style = 'powerline' + + [blocks.segments.properties] + cache_duration = 'none' + + [[blocks.segments]] + leading_diamond = '' + trailing_diamond = '' + template = ' {{ if gt .Code 0 }}{{ else }}{{ end }} ' + foreground = 'p:white' + background = 'p:blue' + type = 'status' + style = 'diamond' + background_templates = ['{{ if gt .Code 0 }}p:red{{ end }}'] + + [blocks.segments.properties] + always_enabled = true + cache_duration = 'none' + +[[blocks]] + type = 'prompt' + alignment = 'left' + newline = true + + [[blocks.segments]] + template = '❯' + background = 'transparent' + type = 'text' + style = 'plain' + foreground_templates = ['{{if gt .Code 0}}red{{end}}', '{{if eq .Code 0}}magenta{{end}}'] + + [blocks.segments.properties] + cache_duration = 'none' + +[[blocks]] + type = 'rprompt' + + [[blocks.segments]] + template = ' ' + foreground = 'p:green' + background = 'transparent' + type = 'node' + style = 'plain' + + [blocks.segments.properties] + cache_duration = 'none' + display_mode = 'files' + fetch_package_manager = false + home_enabled = false + + [[blocks.segments]] + template = ' ' + foreground = 'p:blue' + background = 'transparent' + type = 'go' + style = 'plain' + + [blocks.segments.properties] + cache_duration = 'none' + fetch_version = false + + [[blocks.segments]] + template = ' ' + foreground = 'p:yellow' + background = 'transparent' + type = 'python' + style = 'plain' + + [blocks.segments.properties] + cache_duration = 'none' + display_mode = 'files' + fetch_version = false + fetch_virtual_env = false + + [[blocks.segments]] + template = 'in {{ .Name }} ' + foreground = 'p:white' + background = 'transparent' + type = 'shell' + style = 'plain' + + [blocks.segments.properties] + cache_duration = 'none' + + [[blocks.segments]] + template = 'at {{ .CurrentDate | date "15:04:05" }}' + foreground = 'p:white' + background = 'transparent' + type = 'time' + style = 'plain' + + [blocks.segments.properties] + cache_duration = 'none' + + [[blocks.segments]] + template = ' ({{ .FormattedMs }})' + foreground = 'yellow' + background = 'transparent' + type = 'executiontime' + style = 'plain' + + [blocks.segments.properties] + cache_duration = 'none' + +[[tooltips]] + leading_diamond = '' + trailing_diamond = '' + template = '  {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} ' + foreground = 'p:white' + background = 'p:orange' + type = 'aws' + style = 'diamond' + tips = ['aws'] + + [tooltips.properties] + display_default = true + +[[tooltips]] + leading_diamond = '' + trailing_diamond = '' + template = '  {{ .Name }} ' + foreground = 'p:white' + background = 'p:blue' + type = 'az' + style = 'diamond' + tips = ['az'] + + [tooltips.properties] + display_default = true diff --git a/.zshrc b/.zshrc index 59c0f18..a7bcb8e 100644 --- a/.zshrc +++ b/.zshrc @@ -34,20 +34,39 @@ zinit cdreplay -q # Prompt eval "$(oh-my-posh init zsh --config $HOME/.config/ohmyposh/zen.toml)" -# Keybindings +# --- Keybindings + +# Use emacs keybindings bindkey -e -bindkey '^p' history-search-backward -bindkey '^n' history-search-forward -bindkey "^[[1;5C" forward-word -bindkey "^[[1;5D" backward-word -# Ohne Tmux -bindkey "^[[H" beginning-of-line -bindkey "^[[F" end-of-line -bindkey "^[[2~" delete-char -# Mit Tmux -bindkey "^[[1~" beginning-of-line -bindkey "^[[4~" end-of-line -bindkey "^[[3~" delete-char + +# History search +bindkey '^p' history-search-backward # Ctrl+P for previous history entry +bindkey '^n' history-search-forward # Ctrl+N for next history entry + +# Word navigation +bindkey "^[[1;5C" forward-word # Ctrl+Right Arrow to move forward by word +bindkey "^[[1;5D" backward-word # Ctrl+Left Arrow to move backward by word + +# Non-Tmux bindings (direct terminal) +bindkey "^[[A" up-line-or-history # Up Arrow key +bindkey "^[[B" down-line-or-history # Down Arrow key +bindkey "^[[C" forward-char # Right Arrow key +bindkey "^[[D" backward-char # Left Arrow key +bindkey "^[[H" beginning-of-line # Home key +bindkey "^[[F" end-of-line # End key +bindkey "^[[2~" overwrite-mode # Insert key (toggle overwrite mode) +bindkey "^[[3~" delete-char # Delete key + +# Tmux bindings (if sequences differ under Tmux) +bindkey "^[[1~" beginning-of-line # Home key (Tmux) +bindkey "^[[4~" end-of-line # End key (Tmux) +bindkey "^[[3~" delete-char # Delete key (Tmux) +bindkey "^[[A" up-line-or-history # Up Arrow key (Tmux) +bindkey "^[[B" down-line-or-history # Down Arrow key (Tmux) +bindkey "^[[C" forward-char # Right Arrow key (Tmux) +bindkey "^[[D" backward-char # Left Arrow key (Tmux) + +# --- # History HISTSIZE=10000