aboutsummaryrefslogtreecommitdiffstats
path: root/zsh/.config
diff options
context:
space:
mode:
Diffstat (limited to 'zsh/.config')
-rw-r--r--zsh/.config/starship.toml18
-rw-r--r--zsh/.config/zsh/.zshrc46
2 files changed, 42 insertions, 22 deletions
diff --git a/zsh/.config/starship.toml b/zsh/.config/starship.toml
new file mode 100644
index 0000000..2e9eb81
--- /dev/null
+++ b/zsh/.config/starship.toml
@@ -0,0 +1,18 @@
+add_newline = true
+
+[cmd_duration]
+show_milliseconds = true
+
+[directory]
+truncate_to_repo = true
+
+[git_status]
+all_status = '$conflicted$stashed$deleted$renamed$staged$modified$untracked'
+staged = '[+$count](green)'
+modified = '[!$count](yellow)'
+untracked = '[?$count](red)'
+format = '([\[$conflicted$stashed$deleted$renamed$staged$modified$untracked$ahead_behind\]]($style) )'
+
+[status]
+format = '[$symbol$maybe_int]($style)'
+disabled = false
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc
index d2806f0..7e8c92a 100644
--- a/zsh/.config/zsh/.zshrc
+++ b/zsh/.config/zsh/.zshrc
@@ -97,26 +97,26 @@ bindkey '\C-x\C-e' edit-command-line
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git hg
zstyle ':vcs_info:*' check-for-changes true
-case $TERM in
- termite|*xterm*|rxvt|rxvt-unicode|rxvt-256color|rxvt-unicode-256color|(dt|k|E)term)
- precmd () {
- vcs_info
- print -Pn "\e]0;[%n@%M][%~]%#\a"
- }
- preexec () { print -Pn "\e]0;[%n@%M][%~]%# ($1)\a" }
- ;;
- screen|screen-256color)
- precmd () {
- vcs_info
- print -Pn "\e]83;title \"$1\"\a"
- print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~]\a"
- }
- preexec () {
- print -Pn "\e]83;title \"$1\"\a"
- print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~] ($1)\a"
- }
- ;;
-esac
+autoload -Uz add-zsh-hook
+
+function xterm_title_precmd() {
+ vcs_info
+ print -Pn "\e]0;[%n@%M][%~]%#\a"
+ [[ "$TERM" == 'screen'* ]] &&
+ print -Pn "\e]83;title " && print -n -- "\"${(q)1}\"\a" &&
+ print -Pn "\e]0;$TERM - (%L) [%n@%M]%#[%~]\a"
+}
+
+function xterm_title_preexec() {
+ print -Pn -- '\e]2;[%n@%M][%~]%# ' && print -n -- "(${(q)1})\a"
+ [[ "$TERM" == 'screen'* ]] &&
+ print -Pn "\e]83;title " && print -n -- "\"${(q)1}\"\a" &&
+ print -Pn "\e]0;$TERM - (%L) [%n@%M]%#[%~] " && print -n -- "(${(q)1})\a"
+}
+if [[ "$TERM" == (alacritty*|gnome*|konsole*|putty*|rxvt*|screen*|tmux*|xterm*|(dt|k|E)term*) ]]; then
+ add-zsh-hook -Uz precmd xterm_title_precmd
+ add-zsh-hook -Uz preexec xterm_title_preexec
+fi
if type "kitty" > /dev/null; then
alias kdiff="kitty +kitten diff"
@@ -176,6 +176,7 @@ source /usr/share/fzf/key-bindings.zsh
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
[[ -e /usr/bin/virtualenvwrapper_lazy.sh ]] && \
source /usr/bin/virtualenvwrapper_lazy.sh
+export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && \
source /usr/share/doc/pkgfile/command-not-found.zsh
@@ -221,8 +222,9 @@ case "$TERM" in
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
return;;
*)
- source <(antibody bundle romkatv/powerlevel10k)
- [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
+ #source <(antibody bundle romkatv/powerlevel10k)
+ #[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
+ eval "$(starship init zsh)"
esac
# finish and output profile