configs/arch-config/.config/fish/config.fish

160 lines
5.5 KiB
Fish
Raw Normal View History

2020-10-27 12:00:15 +01:00
fish_default_key_bindings
2020-10-09 17:15:42 +02:00
2021-02-16 18:19:36 +01:00
# change greeting
set fish_greeting "Good Morning! Nice day for fishing ain't it! Hu ha!"
2020-10-27 17:10:17 +01:00
# Info:
# https://fishshell.com/docs/current/index.html#variables-for-changing-highlighting-colors
set fish_color_normal blue
set fish_color_command blue
set fish_color_quote bryellow
set fish_color_redirection
set fish_color_end brred
set fish_color_error red
set fish_color_param brblue
set fish_color_comment white
set fish_color_selection brcyan
set fish_color_search_match magenta
set fish_color_operator blue
set fish_color_escape green
set fish_color_autosuggestion brwhite
set fish_color_host_remote brwhite
set fish_color_cancel brred
2021-06-11 10:17:42 +02:00
# used in prompt
set fish_color_user --bold red
set fish_color_separator --bold yellow
set fish_color_host cyan
set fish_color_cwd yellow
2020-11-10 14:22:23 +01:00
# environment variables
2021-10-24 13:42:39 +02:00
# SSH Agent
set SSH_AUTH_SOCK "$XDG_RUNTIME_DIR/ssh-agent.socket"
#set SSH_AUTH_SOCK /run/user/1000/ssh-agent.socket
2023-02-01 19:11:36 +01:00
export SSH_AUTH_SOCK
2021-02-23 16:23:02 +01:00
2021-06-11 10:17:42 +02:00
# Defined in /home/marc/.config/fish/functions/fish_prompt.fish @ line 2
# slightly modified from defaults
2021-05-06 13:25:51 +02:00
function fish_prompt
2021-06-11 10:17:42 +02:00
set -l last_pipestatus $pipestatus
set -lx __fish_last_status $status # Export for __fish_print_pipestatus.
set -l normal (set_color normal)
# Color the prompt differently when we're root
set -l color_cwd $fish_color_cwd
set -l suffix '>'
#if functions -q fish_is_root_user; and fish_is_root_user
# if set -q fish_color_cwd_root
# set color_cwd $fish_color_cwd_root
# end
# set suffix '#'
#end
# If we're running via SSH, change the host color.
set -l color_host $fish_color_host
#if set -q SSH_TTY
# set color_host $fish_color_host_remote
#end
# Write pipestatus
# If the status was carried over (e.g. after `set`), don't bold it.
set -l bold_flag --bold
set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation
if test $__fish_prompt_status_generation = $status_generation
set bold_flag
end
set __fish_prompt_status_generation $status_generation
set -l prompt_status (__fish_print_pipestatus "[" "]" "|" (set_color $fish_color_status) (set_color $bold_flag $fish_color_status) $last_pipestatus)
echo -n -s (set_color $fish_color_user) "$USER" $normal (set_color $fish_color_separator) @ $normal (set_color $color_host) (prompt_hostname) $normal ' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " "
#echo -n -s (set_color --bold red) "$USER" $normal (set_color --bold yellow) @ $normal (set_color cyan) (prompt_hostname) $normal ' ' (set_color yellow) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " "
2021-05-06 13:25:51 +02:00
end
2021-02-23 16:23:02 +01:00
# text editor
2021-02-10 11:04:01 +01:00
#set EDITOR "/usr/bin/emacs --no-window-system"
#set VISUAL "/usr/bin/emacs --no-window-system"
2024-06-25 17:41:54 +02:00
set EDITOR /usr/bin/vim
set VISUAL /usr/bin/vim
2020-11-10 14:22:23 +01:00
2020-11-09 20:43:12 +01:00
# add paths
2023-12-17 16:09:57 +01:00
set fish_user_paths /usr/bin/vendor_perl/ $fish_user_paths # global perl tools
2023-11-17 17:41:19 +01:00
set fish_user_paths "$HOME/.config/emacs/bin/" $fish_user_paths # new path
2020-11-26 07:45:16 +01:00
set fish_user_paths "$HOME/scripts/in_path" $fish_user_paths
2021-01-06 21:43:49 +01:00
set fish_user_paths "$HOME/.local/bin" $fish_user_paths
2022-05-22 12:56:52 +02:00
set fish_user_paths "$HOME/node_modules/.bin/" $fish_user_paths
2020-11-09 20:43:12 +01:00
# edit with emacs
alias emacs="/usr/bin/emacs --no-window-system"
2021-01-09 09:38:39 +01:00
# alias cat
alias cat="$HOME/scripts/pieces/cat.sh"
2020-02-29 15:39:23 +01:00
#update config
2021-01-29 17:09:18 +01:00
alias upconf='~/scripts/arch-config.sh'
#notification
alias notify='notify-send "Terminal" "Your command finished!" --icon=dialog-information'
2021-05-17 14:06:10 +02:00
# ssh aliases to never bother with terminfo again
2021-04-29 13:35:17 +02:00
# needs python on the server
2021-05-17 14:06:10 +02:00
alias sshkp='kitty +kitten ssh use-python'
alias sshk='kitty +kitten ssh'
2021-03-09 17:15:12 +01:00
2021-05-06 10:40:18 +02:00
# alias for powershell
alias powershell='pwsh'
#list
alias ls='ls --color=auto'
# kill all wine and proton processes
alias killwine='ls -l /proc/*/exe 2>/dev/null | grep -P \'wine(64)?-preloader|wineserver|proton[^mail|\-bridge]\' | perl -pe \'s;^.*/proc/(\d+)/exe.*$;$1;g;\' | xargs -n 1 kill'
2021-09-15 18:21:19 +02:00
## Colorize the grep command output for ease of use (good for log files)##
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# continue download
alias wget="wget -c"
# Aliases for software managment
alias pacman='pacman --color auto'
2020-11-14 10:56:31 +01:00
2021-03-10 10:34:49 +01:00
# Update pip packages
2021-10-22 17:30:27 +02:00
alias pip-update="$HOME/scripts/pieces/pip-update.py"
2021-03-10 10:34:49 +01:00
#grub update
2021-01-04 08:24:54 +01:00
alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
#check vulnerabilities microcode
alias microcode='grep . /sys/devices/system/cpu/vulnerabilities/*'
#get fastest mirrors in your neighborhood
2021-02-15 15:48:41 +01:00
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
2023-02-01 19:11:21 +01:00
# yt-dlp
alias yta-best="yt-dlp -f bestaudio --extract-audio "
alias ytv-best="yt-dlp -f bestvideo+bestaudio "
2023-02-19 10:51:22 +01:00
alias ytv-metadata="yt-dlp -f bestvideo+bestaudio --add-metadata --parse-metadata \"%(title)s:%(meta_title)s\" --parse-metadata \"%(uploader)s:%(meta_artist)s\" --write-info-json --write-thumbnail --embed-thumbnail --embed-subs --sub-langs \"en.*\" --merge-output-format mkv "
#Cleanup orphaned packages
alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
2020-11-23 09:33:02 +01:00
# Clean cached packages
alias cleancache='paru -Sc'
# activate venv called "venv"
alias activate='source venv/bin/activate.fish'
# lsblk to list more info
2023-05-07 13:10:44 +02:00
alias lsblkf="lsblk -o NAME,LABEL,RM,SIZE,RO,TYPE,FSTYPE,MOUNTPOINTS,MODEL,UUID"
2022-09-01 15:09:18 +02:00
# use color for ip command
alias ip="ip -c"
2024-05-10 14:16:43 +02:00
# rebuild broken packages
alias rebuild="checkrebuild | awk '{print $2}' | paru -S --rebuild=yes -"
# process cpu usage per core instead of overall
alias btm="btm -n"