add some fish config

main
CTome 2023-12-18 17:00:40 +00:00 committed by GitHub
parent e600bc7e46
commit 4afd4cd7f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 83 additions and 0 deletions

76
abbreviations.fish Normal file
View File

@ -0,0 +1,76 @@
# Fish abbreviations converted from bash aliases
abbr q exit
abbr c clear
# if the system uses the dnf package manager
if type -q $dnf
abbr di 'sudo dnf install'
abbr dug 'sudo dnf upgrade --refresh -y'
abbr ds 'dnf search'
abbr dr 'sudo dnf remove'
abbr dli 'dnf list installed'
abbr dlu 'dnf history userinstalled'
end
# if the system uses the apt package manager
if type -q $apt
abbr ai 'sudo apt install'
abbr aud 'sudo apt update && sudo apt upgrade -y'
abbr as 'apt search'
abbr ar 'sudo apt remove'
abbr aar 'sudo apt autoremove'
# if nala is installed
if type -q $nala
abbr ai 'sudo nala install'
abbr aud 'sudo nala upgrade -y'
abbr as 'nala search'
abbr ar 'sudo nala remove'
abbr aar 'sudo nala autoremove'
end
end
# git abbreviations
abbr gc 'git clone'
abbr gpl 'git pull'
abbr gph 'git push'
abbr gl 'git log'
abbr gs 'git status'
abbr gr 'git remote -v'
abbr gitamendcomment 'git commit --amend'
# TODO: rewrite git pull all in fish
# gh abbreviations
if type -q $gh
abbr ghr 'gh repo'
abbr ghrc 'gh repo create'
abbr ghs 'gh status'
abbr ghpr 'gh pr'
end
# dish space
abbr dfh 'df -h'
# docker abbreviations
abbr dps 'docker ps'
# file management and navigation abbreviations
# finds large dirs based on your current working directory
abbr fld 'sudo du -ahx . | sort -rh |head -5'
alias back 'cd -'
abbr mkdir 'mkdir -pv'
abbr rm 'rm -iv'
abbr rmr 'rm -rv'
abbr cp 'cp -iv'
abbr mv 'mv -iv'
abbr words 'wc -w'
abbr lines 'wc -l'
# misc abbreviations that have not been grouped
# grab externel ip address
abbr ipe 'curl ipinfo.io/ip'
abbr reboot 'sudo reboot now'

7
config.fish Normal file
View File

@ -0,0 +1,7 @@
if status is-interactive
# Commands to run in interactive sessions can go here
end
# launch starship prompt
starship init fish | source