🫥 initial commit - fish-config

This commit is contained in:
pika 2024-05-12 21:11:56 +02:00
commit 1da4a614e0
10 changed files with 3140 additions and 0 deletions

View file

@ -0,0 +1,275 @@
if status is-interactive
# Commands to run in interactive sessions can go here
end
# __ _ __ _ _
# / _(_) / _(_) | |
# ___ ___ _ __ | |_ _ __ _ | |_ _ ___| |__
# / __/ _ \| '_ \| _| |/ _` | | _| / __| '_ \
# | (_| (_) | | | | | | | (_| |_| | | \__ \ | | |
# \___\___/|_| |_|_| |_|\__, (_)_| |_|___/_| |_|
# __/ |
# |___/
# _ ___ _ _
# | | / _ \| | |
# | |__ _ _ / /_\ \ | | ___ _____ ____ __
# | '_ \| | | | | _ | | |/ _ \/ _ \ \/ /\ \/ /
# | |_) | |_| | | | | | | | __/ __/> < > <
# |_.__/ \__, | \_| |_/_|_|\___|\___/_/\_\/_/\_\
# __/ |
# |___/
#
# Environment-Variables
set fish_greeting
set toolbox "The following tools are active:
"
set warnings "The following packages are NOT active:
"
set -p EDITOR (which nvim)
## Set Distro-Packagemanager-Aliases
# DNF - Fedora
if command -v dnf
alias install='sudo dnf install'
alias update='sudo dnf update && sudo dnf upgrade'
alias search='sudo dnf search'
alias remove='sudo dnf remove'
set -a ALIASSES "-- You're using DNF aliases!! --"
end
# APT/NALA - Debian
if command -v nala
alias install='sudo nala update && sudo nala install'
alias update='sudo nala update && sudo nala upgrade'
alias search='nala search'
alias remove='sudo nala remove'
set ALIASSES "-- You're using NALA aliases!! --"
else
if command -v apt
alias install='sudo apt update && sudo apt install'
alias update='sudo apt update && sudo apt upgrade'
alias search='apt search'
alias remove='sudo apt remove'
set ALIASSES "-- You're using APT aliases!! --"
end
end
# Pacman - Arch
if command -v yay
alias install='yay -S'
alias update='yay -Syu'
alias search='yay -Ss'
alias remove='yay -R'
set ALIASSES "-- You're using Arch!! - installed helper: yay --"
else
if command -v paru
alias install='paru -S'
alias update='paru -Syu'
alias search='paru -Ss'
alias remove='paru -R'
set ALIASSES "-- You're using Arch!! - installed helper: paru --"
else
if command -v pacman
alias install='sudo pacman -S'
alias update='sudo pacman -Syu'
alias remove='sudo pacman -R'
set ALIASSES "-- by the PACMAN - You're using Arch!! --"
end
end
end
# Zypper - OpenSuse
if command -v zypper
alias install='sudo zypper in'
alias update='sudo zypper dup'
alias search='sudo zypper se'
alias lock='sudo zypper al'
alias remove='sudo zypper rm'
set ALIASSES "-- I see.. you're using OpenSUSE. i like <3 --
ZYPPER "
end
# APK - Alpine
if command -v apk
alias install='sudo apk add'
alias update='sudo apk update'
alias search='sudo apk search'
set ALIASSES "-- Alpine.. right, this fast os is evolving.. --"
end
## END Distro-Packagemanager-Aliases
# OMF - Oh-My-Fish
#if test -d "$HOME/.config/omf/"
# omf update
# alias rl='omf reload'
# set -a fish_greed "Oh-my-FiSh installed and activated"
#end
#colorized ls
if command -v lsd
alias ls='lsd -l'
alias ll='pwd && lsd -lA && pwd'
alias tree='lsd --tree'
set -a toolbox "  using $(which lsd) for ls
"
else
if command -v exa
alias ls='exa --icons -l'
alias ll='exa --icons -laa'
alias tree='exa --icons -l -tree'
set -a toolbox "  using $(which exa) for ls
"
else
if command -v eza
alias ls='eza --icons -l'
alias ll='eza --icons -laa'
alias tree='eza --icons -l -tree'
set -a toolbox "  using $(which eza) for ls
"
else
alias ls='ls --color=always -lph'
alias ll='ls --color=always -lAph'
set -a toolbox "  using plain old ls, but with colors!!
"
set -a warnings " no ls helper is installed [lsd, eza, exa..]
"
end
end
end
#colored everything
alias ip="ip -c"
alias grep="grep --color=always"
#weather
alias www='curl wttr.in/Ulm'
#bat alias
if command -v batcat
alias cat='batcat -p --paging=never'
set -a toolbox " cat is using $(which batcat)
"
else
if command -v bat
alias cat='bat -p'
set -a toolbox " cat is using $(which bat)
"
else
set -a warnings " bat
"
end
end
if command -v tmux
alias ts="tmux source $HOME/.tmux.conf"
alias t="tmux"
set -a toolbox " t is using $(which tmux)
"
else
set -a warnings " tmux
"
end
if command -v docker
alias up='docker compose up'
alias down='docker compose down'
alias pull='docker compose pull'
alias d='docker'
alias dr='docker run --rm -it'
alias ds='docker ps -a'
alias dc='docker compose'
alias appudpate='docker pull && docker compose up -d --force-recreate'
set -a toolbox " d is using $(which docker) [docker]
"
else
set -a warnings " docker
"
end
# z stands for Zoxide
if command -v zoxide
zoxide init fish | source
set -a toolbox " z is using $(which zoxide) [cd]
"
else
set -a warnings " zoxide
"
end
# g stands for git
if command -v git
alias g='git'
alias gc='git clone'
alias gs='git status'
alias ga='git add'
alias gcm='git commit'
alias gp='git pull'
set -a toolbox " g is using $(which git)
"
else
set -a warnings " git
"
end
#the *fetch's
if command -v pfetch
alias clearl='command clear & pfetch && ls'
alias p='pfetch'
set -a toolbox " p is using $(which pfetch)
"
else
set -a warnings " pfetch
--> run 'git clone https://github.com/dylanaraps/pfetch.git && sudo cp pfetch/pfetch /bin/ && sudo rm -r pfetch/' to fix this
"
end
if command -v neofetch
alias nf='neofetch'
alias clearnf='command clear & neofetch'
set -a toolbox " nf is using $(which neofetch)
"
end
#set nmap-alias
if command -v nmap
alias scanvuln='sudo nmap --script vuln -vvv'
alias sv='scanvuln'
alias portscan='sudo nmap -sT'
alias ps='portscan'
set -a toolbox " nmap is using $(which nmap) [needs sudo]
sv | 'nmap --script vuln' | vulnerabilityscan
ps | 'nmap -sT' | portscanner
"
end
#set colorscheme for bobthefish
if test -d $HOME/.config/fish/functions/
set -g theme_nerd_fonts yes
set -g defaults_user ($USER)
# available options: dark, light, solarized(-dark/-light), base16(-dark/-light), zenburn, gruvbox(-light), dracula, nord, catppuccin-(latte/frappe/macchiato/mocha)
set -g theme_color_scheme catppuccin-mocha
end
set -a fish_greed "
$toolbox"
alias code='codium'
clear & pfetch
alias clear='clear & pfetch && echo $toolbox'
echo "-------------------------------------------------------------"
echo $fish_greed
echo "-------------------------------------------------------------"
echo $ALIASSES
echo "-------------------------------------------------------------"
echo $warnings

View file

@ -0,0 +1,76 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:3400
SETUVAR fish_color_autosuggestion:555\x1ebrblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:005fd7
SETUVAR fish_color_comment:990000
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:009900
SETUVAR fish_color_error:ff0000
SETUVAR fish_color_escape:00a6b2
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:00a6b2
SETUVAR fish_color_param:00afff
SETUVAR fish_color_quote:999900
SETUVAR fish_color_redirection:00afff
SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_completion:\x1d
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr
SETUVAR pure_begin_prompt_with_current_directory:true
SETUVAR pure_check_for_new_release:false
SETUVAR pure_color_at_sign:pure_color_mute
SETUVAR pure_color_command_duration:pure_color_warning
SETUVAR pure_color_current_directory:pure_color_primary
SETUVAR pure_color_danger:red
SETUVAR pure_color_dark:black
SETUVAR pure_color_git_branch:pure_color_mute
SETUVAR pure_color_git_dirty:pure_color_mute
SETUVAR pure_color_git_stash:pure_color_info
SETUVAR pure_color_git_unpulled_commits:pure_color_info
SETUVAR pure_color_git_unpushed_commits:pure_color_info
SETUVAR pure_color_hostname:pure_color_mute
SETUVAR pure_color_info:cyan
SETUVAR pure_color_jobs:pure_color_normal
SETUVAR pure_color_light:white
SETUVAR pure_color_mute:brblack
SETUVAR pure_color_normal:normal
SETUVAR pure_color_prefix_root_prompt:pure_color_danger
SETUVAR pure_color_primary:blue
SETUVAR pure_color_prompt_on_error:pure_color_danger
SETUVAR pure_color_prompt_on_success:pure_color_success
SETUVAR pure_color_success:magenta
SETUVAR pure_color_system_time:pure_color_mute
SETUVAR pure_color_username_normal:pure_color_mute
SETUVAR pure_color_username_root:pure_color_light
SETUVAR pure_color_virtualenv:pure_color_mute
SETUVAR pure_color_warning:yellow
SETUVAR pure_enable_git:true
SETUVAR pure_enable_single_line_prompt:false
SETUVAR pure_reverse_prompt_symbol_in_vimode:true
SETUVAR pure_separate_prompt_on_error:false
SETUVAR pure_show_jobs:false
SETUVAR pure_show_prefix_root_prompt:false
SETUVAR pure_show_subsecond_command_duration:false
SETUVAR pure_show_system_time:false
SETUVAR pure_symbol_git_dirty:\x2a
SETUVAR pure_symbol_git_stash:\u2261
SETUVAR pure_symbol_git_unpulled_commits:\u21e3
SETUVAR pure_symbol_git_unpushed_commits:\u21e1
SETUVAR pure_symbol_prefix_root_prompt:\x23
SETUVAR pure_symbol_prompt:\u276f
SETUVAR pure_symbol_reverse_prompt:\u276e
SETUVAR pure_symbol_title_bar_separator:\x2d
SETUVAR pure_threshold_command_duration:5

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
function __bobthefish_display_colors -d 'Print example prompts using the current color scheme'
bobthefish_display_colors
end

View file

@ -0,0 +1,99 @@
function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish'
# Powerline glyphs
set -x branch_glyph \uE0A0
set -x right_black_arrow_glyph \uE0B0
set -x right_arrow_glyph \uE0B1
set -x left_black_arrow_glyph \uE0B2
set -x left_arrow_glyph \uE0B3
# Additional glyphs
set -x detached_glyph \u27A6
set -x tag_glyph \u2302
set -x nonzero_exit_glyph '! '
set -x private_glyph \uE0A2 ' '
set -x superuser_glyph '$ '
set -x bg_job_glyph '% '
set -x hg_glyph \u263F
# Python glyphs
set -x superscript_glyph \u00B9 \u00B2 \u00B3
set -x virtualenv_glyph \u25F0
set -x pypy_glyph \u1D56
set -x ruby_glyph ''
set -x go_glyph ''
set -x nix_glyph ''
# Desk glyphs
set -x desk_glyph \u25F2
# Kubernetes glyphs
set -x k8s_glyph \u2388 # '⎈'
# Vagrant glyphs
set -x vagrant_running_glyph \u2191 # ↑ 'running'
set -x vagrant_poweroff_glyph \u2193 # ↓ 'poweroff'
set -x vagrant_aborted_glyph \u2715 # ✕ 'aborted'
set -x vagrant_saved_glyph \u21E1 # ⇡ 'saved'
set -x vagrant_stopping_glyph \u21E3 # ⇣ 'stopping'
set -x vagrant_unknown_glyph '!' # strange cases
# Git glyphs
set -x git_dirty_glyph '*'
set -x git_staged_glyph '~'
set -x git_stashed_glyph '$'
set -x git_untracked_glyph '…'
set -x git_ahead_glyph \u2191 # '↑'
set -x git_behind_glyph \u2193 # '↓'
set -x git_plus_glyph '+'
set -x git_minus_glyph '-'
set -x git_plus_minus_glyph '±'
# Disable Powerline fonts (unless we're using nerd fonts instead)
if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ]
set private_glyph \u29B8 ' '
set branch_glyph \u2387
set right_black_arrow_glyph ''
set right_arrow_glyph ''
set left_black_arrow_glyph ''
set left_arrow_glyph ''
end
# Use prettier Nerd Fonts glyphs
if [ "$theme_nerd_fonts" = "yes" ]
set private_glyph \uF023 ' ' # nf-fa-lock
set branch_glyph \uF418
set detached_glyph \uF417
set tag_glyph \uF412
set nix_glyph \uF313 ' ' # nf-linux-nixos
set virtualenv_glyph \uE73C ' '
set ruby_glyph \uE791 ' '
set go_glyph \uE626 ' '
set node_glyph \uE718 ' '
set vagrant_running_glyph \uF431 # ↑ 'running'
set vagrant_poweroff_glyph \uF433 # ↓ 'poweroff'
set vagrant_aborted_glyph \uF468 # ✕ 'aborted'
set vagrant_unknown_glyph \uF421 # strange cases
set git_dirty_glyph \uF448 '' # nf-oct-pencil
set git_staged_glyph \uF0C7 '' # nf-fa-save
set git_stashed_glyph \uF0C6 '' # nf-fa-paperclip
set git_untracked_glyph \uF128 '' # nf-fa-question
# set git_untracked_glyph \uF141 '' # nf-fa-ellipsis_h
set git_ahead_glyph \uF47B # nf-oct-chevron_up
set git_behind_glyph \uF47C # nf-oct-chevron_down
set git_plus_glyph \uF0DE # fa-sort-asc
set git_minus_glyph \uF0DD # fa-sort-desc
set git_plus_minus_glyph \uF0DC # fa-sort
end
# Avoid ambiguous glyphs
if [ "$theme_avoid_ambiguous_glyphs" = "yes" ]
set git_untracked_glyph '...'
end
end

View file

@ -0,0 +1,170 @@
function bobthefish_display_colors -a color_scheme -d 'Print example prompt color schemes'
set -l color_schemes default light \
solarized solarized-light \
base16 base16-light \
gruvbox gruvbox-light zenburn \
dracula nord \
catppuccin-latte catppuccin-frappe \
catppuccin-macchiato catppuccin-mocha \
jellybeans \
terminal terminal-dark-white \
terminal-light terminal-light-black \
terminal2 terminal2-dark-white \
terminal2-light terminal2-light-black
switch "$color_scheme"
case '--all'
for scheme in $color_schemes
echo
echo "$scheme:"
bobthefish_display_colors $scheme
end
return
case $color_schemes
__bobthefish_colors $color_scheme
case ''
if type -q bobthefish_colors
if [ -n "$theme_color_scheme" ]
echo "$theme_color_scheme (with bobthefish_colors overrides):"
else
echo 'custom (via bobthefish_colors):'
end
else if [ -n "$theme_color_scheme" ]
echo "$theme_color_scheme:"
end
__bobthefish_colors $theme_color_scheme
type -q bobthefish_colors
and bobthefish_colors
case '*'
echo 'usage: bobthefish_display_colors [--all] [color_scheme]'
return
end
__bobthefish_glyphs
echo
set_color normal
__bobthefish_start_segment $color_initial_segment_exit
echo -n exit $nonzero_exit_glyph
set_color -b $color_initial_segment_private
echo -n private $private_glyph
set_color -b $color_initial_segment_su
echo -n su $superuser_glyph
set_color -b $color_initial_segment_jobs
echo -n jobs $bg_job_glyph
__bobthefish_finish_segments
set_color normal
echo -n "(<- initial_segment)"
echo
__bobthefish_start_segment $color_path
echo -n /color/path/
set_color -b $color_path_basename
echo -ns basename ' '
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_path_nowrite
echo -n /color/path/nowrite/
set_color -b $color_path_nowrite_basename
echo -ns basename ' '
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_path
echo -n /color/path/
set_color -b $color_path_basename
echo -ns basename ' '
__bobthefish_start_segment $color_repo
echo -n "$branch_glyph repo $git_stashed_glyph "
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_path
echo -n /color/path/
set_color -b $color_path_basename
echo -ns basename ' '
__bobthefish_start_segment $color_repo_dirty
echo -n "$tag_glyph repo_dirty $git_dirty_glyph "
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_path
echo -n /color/path/
set_color -b $color_path_basename
echo -ns basename ' '
__bobthefish_start_segment $color_repo_staged
echo -n "$detached_glyph repo_staged $git_staged_glyph "
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_vi_mode_default
echo -ns vi_mode_default ' '
__bobthefish_finish_segments
__bobthefish_start_segment $color_vi_mode_insert
echo -ns vi_mode_insert ' '
__bobthefish_finish_segments
__bobthefish_start_segment $color_vi_mode_visual
echo -ns vi_mode_visual ' '
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_vagrant
echo -ns $vagrant_running_glyph ' ' vagrant ' '
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_username
echo -n username
set_color normal
set_color -b $color_hostname[1] $color_hostname[2..-1]
echo -ns @hostname ' '
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_screen
echo -ns 'screen '
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_rvm
echo -ns $ruby_glyph rvm ' '
__bobthefish_finish_segments
__bobthefish_start_segment $color_nvm
echo -ns $ruby_glyph nvm ' '
__bobthefish_finish_segments
__bobthefish_start_segment $color_virtualfish
echo -ns $virtualenv_glyph virtualfish ' '
__bobthefish_finish_segments
__bobthefish_start_segment $color_virtualgo
echo -ns $go_glyph virtualgo ' '
__bobthefish_finish_segments
__bobthefish_start_segment $color_desk
echo -ns $desk_glyph desk ' '
__bobthefish_finish_segments
echo
__bobthefish_start_segment $color_aws_vault
echo -ns aws-vault ' (' active ') '
__bobthefish_finish_segments
__bobthefish_start_segment $color_aws_vault_expired
echo -ns aws-vault ' (' expired ') '
__bobthefish_finish_segments
__bobthefish_start_segment $color_k8s
echo -ns $k8s_glyph ' k8s-context'
__bobthefish_finish_segments
echo -e "\n"
end

View file

@ -0,0 +1,42 @@
# Display the current binding mode... if it's vi or vi-like.
#
# To always show the binding mode (regardless of current bindings):
# set -g theme_display_vi yes
#
# To never show:
# set -g theme_display_vi no
function fish_mode_prompt -d 'bobthefish-optimized fish mode indicator'
[ "$theme_display_vi" != 'no' ]
or return
[ "$fish_key_bindings" = 'fish_vi_key_bindings' \
-o "$fish_key_bindings" = 'hybrid_bindings' \
-o "$fish_key_bindings" = 'fish_hybrid_key_bindings' \
-o "$theme_display_vi" = 'yes' ]
or return
__bobthefish_colors $theme_color_scheme
type -q bobthefish_colors
and bobthefish_colors
set_color normal # clear out anything bold or underline...
switch $fish_bind_mode
case default
set_color -b $color_vi_mode_default
echo -n ' N '
case insert
set_color -b $color_vi_mode_insert
echo -n ' I '
case replace_one replace-one
set_color -b $color_vi_mode_insert
echo -n ' R '
case visual
set_color -b $color_vi_mode_visual
echo -n ' V '
end
set_color normal
end

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,80 @@
# See "Right prompt options" in README.md for configuration options
function __bobthefish_cmd_duration -S -d 'Show command duration'
[ "$theme_display_cmd_duration" = "no" ]
and return
[ -z "$CMD_DURATION" -o "$CMD_DURATION" -lt 100 ]
and return
if [ "$CMD_DURATION" -lt 5000 ]
echo -ns $CMD_DURATION 'ms'
else if [ "$CMD_DURATION" -lt 60000 ]
__bobthefish_pretty_ms $CMD_DURATION s
else if [ "$CMD_DURATION" -lt 3600000 ]
set_color $fish_color_error
__bobthefish_pretty_ms $CMD_DURATION m
else
set_color $fish_color_error
__bobthefish_pretty_ms $CMD_DURATION h
end
set_color $fish_color_normal
set_color $fish_color_autosuggestion
[ "$theme_display_date" = "no" ]
or echo -ns ' ' $__bobthefish_left_arrow_glyph
end
function __bobthefish_pretty_ms -S -a ms -a interval -d 'Millisecond formatting for humans'
set -l interval_ms
set -l scale 1
switch $interval
case s
set interval_ms 1000
case m
set interval_ms 60000
case h
set interval_ms 3600000
set scale 2
end
switch $FISH_VERSION
case 2.0.\* 2.1.\* 2.2.\* 2.3.\*
# Fish 2.3 and lower doesn't know about the -s argument to math.
math "scale=$scale;$ms/$interval_ms" | string replace -r '\\.?0*$' $interval
case 2.\*
# Fish 2.x always returned a float when given the -s argument.
math -s$scale "$ms/$interval_ms" | string replace -r '\\.?0*$' $interval
case \*
math -s$scale "$ms/$interval_ms"
echo -ns $interval
end
end
function __bobthefish_timestamp -S -d 'Show the current timestamp'
[ "$theme_display_date" = "no" ]
and return
set -q theme_date_format
or set -l theme_date_format "+%T"
echo -n ' '
set -q theme_date_timezone
and env TZ="$theme_date_timezone" date $theme_date_format
or date $theme_date_format
end
function fish_right_prompt -d 'bobthefish is all about the right prompt'
set -l __bobthefish_left_arrow_glyph \uE0B3
if [ "$theme_powerline_fonts" = "no" -a "$theme_nerd_fonts" != "yes" ]
set __bobthefish_left_arrow_glyph '<'
end
set_color $fish_color_autosuggestion
__bobthefish_cmd_duration
__bobthefish_timestamp
set_color normal
end

View file

@ -0,0 +1,30 @@
# See "Title options" in README.md for configuration options
function __bobthefish_title_user -S -d 'Display actual user if different from $default_user'
if [ "$theme_title_display_user" = 'yes' ]
if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ]
set -l IFS .
uname -n | read -l host __
echo -ns (whoami) '@' $host ' '
end
end
end
function fish_title
__bobthefish_title_user
if [ "$theme_title_display_process" = 'yes' ]
status current-command
[ "$theme_title_display_path" != 'no' ]
and echo ' '
end
if [ "$theme_title_display_path" != 'no' ]
if [ "$theme_title_use_abbreviated_path" = 'no' ]
echo $PWD
else
prompt_pwd
end
end
end