From 74453461f979967d2b0c0cb92792befc22b73aea Mon Sep 17 00:00:00 2001 From: sebastian Date: Thu, 10 Apr 2025 12:54:48 +0200 Subject: [PATCH] initial --- dot_zshrc | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 dot_zshrc diff --git a/dot_zshrc b/dot_zshrc new file mode 100644 index 0000000..e209ce1 --- /dev/null +++ b/dot_zshrc @@ -0,0 +1,98 @@ +# Set up the prompt + +autoload -Uz promptinit +promptinit +prompt adam1 + +setopt histignorealldups sharehistory + +# Use emacs keybindings even if our EDITOR is set to vi +bindkey -e + +# Keep 1000 lines of history within the shell and save it to ~/.zsh_history: +HISTSIZE=1000 +SAVEHIST=1000 +HISTFILE=~/.zsh_history + +HISTSIZE=10000 +HISTFILESIZE=50000 +HISTTIMEFORMAT="[%Y-%m-%d %H:%m] " +HISTIGNORE="?:??:??:bash:zsh:clear:exit" + +PROMPT_COMMAND="history -a; history -n" + + + +# Use modern completion system +autoload -Uz compinit +compinit + +zstyle ':completion:*' auto-description 'specify: %d' +zstyle ':completion:*' completer _expand _complete _correct _approximate +zstyle ':completion:*' format 'Completing %d' +zstyle ':completion:*' group-name '' +zstyle ':completion:*' menu select=2 +eval "$(dircolors -b)" +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' list-colors '' +zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s +zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' +zstyle ':completion:*' menu select=long +zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s +zstyle ':completion:*' use-compctl false +zstyle ':completion:*' verbose true + +zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' +zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' + + +## Oh my posh +# https://ohmyposh.dev/docs/installation/prompt +eval "$(oh-my-posh init zsh --config /home/sebastian/.zsh/rudolfs-dark.omp.json)" + + +export FZF_TMUX_OPTS="-r 30%" +export FZF_TMUX=1 +source /usr/share/doc/fzf/examples/key-bindings.zsh + + + +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + + + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + + + +if [ -z "$TMUX" ] && [ ${UID} != 0 ] +then + #tmux new-session -A -s main + tmux attach || tmux new +fi + + +#### for pip3 --user installed applications +export PATH=$HOME/.local/bin:$PATH +export PATH="$PATH:/home/sebastian/go/bin:/home/sebastian/.cargo/bin" + + + + +function tmux_pane(){ + tmux rename-window "$(basename $PWD)" +} + + +PROMPT_COMMAND="$PROMPT_COMMAND; tmux_pane"