#      __      __     _____
#     /  \    /  \   /  __ \
#    / /\ \  / /\ \  | |__| |    Manuel Prinz (MP)
#   / /  \ \/ /  \ \ |  ___/
#  / /    \__/    \ \| |
# /_/              \_\_|
#
# Beschreibung:     .bashrc
# letzte Änderung:  10.01.2026

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

### Pfade ###
PATH="$HOME/.local/bin/:$PATH"

###### Aliase ######
# ls
#alias ls='ls --color=auto --group-directories-first'
#alias la='ls -lAh'
#alias ll='ls -lh'

#exa
alias ls='exa --color=always --group-directories-first --icons'
alias la='exa -a --color=always --group-directories-first --icons'
alias ll='exa -al --color=always --group-directories-first --icons'

# grep with colors
alias grep='grep --color=auto'

# confirmations
alias mv='mv -i'
alias cp='cp -i'
alias rm='rm -i'
alias ln='ln -i'

# mkdir create parents
alias mkdir='mkdir -pv'

# pacman and yay
alias pacup='sudo pacman -Syu'
alias yayup='yay -Sua'
#alias yayup='yay -Sua --noconfirm'
alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'

# Doom Emacs
alias doomdoc='~/.config/emacs/bin/doom doctor'
alias doomsync='~/.config/emacs/bin/doom sync'
alias doomup='~/.config/emacs/bin/doom upgrade'

# Sonstiges
alias ip='ip -color'
alias nnn='nnn -d -e -H -r'
alias y='yazi'
alias yu='ya pkg upgrade'

###### Exports  ######
export EDITOR=vim
export LC_COLLATE="C"

###### Prompt  ######

#PS1='\w > '
PS1='\[\033[1;34m\]\w\[\033[0m\] \[\033[0;32m\]\[\033[0m\] '
#PS1="\e[1;34m\]\w\e[0m\] \e[0;32m\]\e[0m\] "
#PS1='\e[0;33m\]\u@\h\e[00m\] \e[1;34m\]\w\e[00m\] \e[0;32m\]\e[00m\] '
#PS1='\e[0;33m\]\u@\h\e[00m\] \e[1;34m\]\w\e[00m\] \e[0;32m\]\e[00m\] '
#PS1='\e[0;33m\]\u@\h\e[00m\] \e[1;34m\]\w\e[00m\] \e[0;32m\] \e[00m\] '
#PS1='[\u@\h \w] > '

###### ausführen bei Terminalstart ######

#powerline-daemon -q
#POWERLINE_BASH_CONTINUATION=1
#POWERLINE_BASH_SELECT=1
#. /usr/lib/python3.9/site-packages/powerline/bindings/bash/powerline.sh
#. /usr/share/powerline/bindings/bash/powerline.sh

eval "$(starship init bash)"
eval "$(zoxide init bash)"

# Set up fzf key bindings and fuzzy completion
# CTRL-Y to copy the command into clipboard using pbcopy
export FZF_CTRL_R_OPTS="
  --bind 'ctrl-y:execute-silent(echo -n {2..} | pbcopy)+abort'
  --color header:italic
  --header 'Press CTRL-Y to copy command into clipboard'"
# Preview file content using bat (https://github.com/sharkdp/bat)
export FZF_CTRL_T_OPTS="
  --walker-skip .git,node_modules,target
  --preview 'bat -n --color=always {}'
  --bind 'ctrl-/:change-preview-window(down|hidden|)'"
# Print tree structure in the preview window
export FZF_ALT_C_OPTS="
  --walker-skip .git,node_modules,target
  --preview 'tree -C {}'"

eval "$(fzf --bash)"

source $HOME/.profile

neofetch
