You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
4.9 KiB
186 lines
4.9 KiB
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
|
## Source .profile to apply its values
|
|
# source .profile
|
|
|
|
# .profile (for fish)
|
|
|
|
if not set -q EDITOR
|
|
set -gx EDITOR 'nvim'
|
|
end
|
|
if not set -q VISUAL
|
|
set -gx VISUAL 'nvim'
|
|
end
|
|
if not set -q PAGER
|
|
set -gx PAGER 'less'
|
|
end
|
|
if not set -q BAT_PAGER
|
|
set -gx BAT_PAGER 'less -RF'
|
|
end
|
|
|
|
if not set -q LANG
|
|
set -gx LANG 'de_AT.UTF-8'
|
|
end
|
|
|
|
if test -d $HOME/go
|
|
set -gx -p PATH $HOME/go/bin
|
|
set -gx GOPATH $HOME/go
|
|
end
|
|
|
|
if not set -q LESS
|
|
# -X to disable mouse-scroling
|
|
set -gx LESS '-g -i -M -R -S -w -z-4'
|
|
end
|
|
|
|
# ## Add john git dir "/run" to PATH
|
|
# if test -d ~/git/john/run
|
|
# if not contains -- ~/git/john/run $PATH
|
|
# set -p PATH ~/git/john/run
|
|
# end
|
|
# end
|
|
|
|
## Add ~/.local/bin to PATH
|
|
if test -d ~/.local/bin
|
|
if not contains -- ~/.local/bin $PATH
|
|
set -p PATH ~/.local/bin
|
|
end
|
|
end
|
|
|
|
## add ~/bin to PATH
|
|
if test -d ~/bin
|
|
if not contains -- ~/bin $PATH
|
|
set -p PATH ~/bin
|
|
end
|
|
end
|
|
|
|
## Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
|
|
function __history_previous_command
|
|
switch (commandline -t)
|
|
case "!"
|
|
commandline -t $history[1]; commandline -f repaint
|
|
case "*"
|
|
commandline -i !
|
|
end
|
|
end
|
|
|
|
function __history_previous_command_arguments
|
|
switch (commandline -t)
|
|
case "!"
|
|
commandline -t ""
|
|
commandline -f history-token-search-backward
|
|
case "*"
|
|
commandline -i '$'
|
|
end
|
|
end
|
|
|
|
if [ "$fish_key_bindings" = fish_vi_key_bindings ];
|
|
bind -Minsert ! __history_previous_command
|
|
bind -Minsert '$' __history_previous_command_arguments
|
|
else
|
|
bind ! __history_previous_command
|
|
bind '$' __history_previous_command_arguments
|
|
end
|
|
|
|
## Fish command history
|
|
function history
|
|
builtin history --show-time='%F %T '
|
|
end
|
|
|
|
#function backup --argument filename
|
|
# cp $filename $filename.bak
|
|
#end
|
|
|
|
## Useful aliases
|
|
# Replace ls with exa
|
|
# alias ls='exa -al --color=always --group-directories-first' # preferred listing
|
|
# alias la='exa -a --color=always --group-directories-first' # all files and dirs
|
|
# alias ll='exa -l --color=always --group-directories-first' # long format
|
|
# alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
|
# alias l.="exa -a | egrep '^\.'"
|
|
|
|
# Replace some more things with better alternatives
|
|
#[ ! -x /usr/bin/bat ] && [ -x /usr/bin/cat ] && alias cat='bat'
|
|
|
|
# Common use
|
|
alias aup="pamac upgrade --aur"
|
|
#alias grubup="sudo update-grub"
|
|
alias fixpacman="sudo rm /var/lib/pacman/db.lck"
|
|
#alias tarnow='tar -acf '
|
|
#alias untar='tar -zxvf '
|
|
alias wget='wget -c '
|
|
alias psmem='ps auxf | sort -nr -k 4'
|
|
alias psmem10='ps auxf | sort -nr -k 4 | head -10'
|
|
alias upd='sudo reflector --latest 5 --age 2 --fastest 5 --protocol https --sort rate --save /etc/pacman.d/mirrorlist && cat /etc/pacman.d/mirrorlist && sudo pacman -Syu && fish_update_completions && sudo updatedb'
|
|
alias ..='cd ..'
|
|
alias ...='cd ../..'
|
|
alias ....='cd ../../..'
|
|
alias .....='cd ../../../..'
|
|
alias ......='cd ../../../../..'
|
|
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'
|
|
alias hw='hwinfo --short' # Hardware Info
|
|
alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB (expac must be installed)
|
|
alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
|
|
#
|
|
## Get fastest mirrors
|
|
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
|
|
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
|
|
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
|
|
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
|
|
|
|
#Cleanup orphaned packages
|
|
alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
|
|
|
|
#get the error messages from journalctl
|
|
alias jctl="journalctl -p 3 -xb"
|
|
|
|
#Recent Installed Packages
|
|
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
|
|
|
|
alias nvmi=nvim
|
|
|
|
# Run paleofetch if session is interactive
|
|
if status --is-interactive
|
|
# if command -vq fastfetch
|
|
# fastfetch
|
|
# end
|
|
if command -vq randomquote.pl
|
|
randomquote.pl
|
|
echo
|
|
end
|
|
end
|
|
|
|
if type -q "zeit"
|
|
set -x ZEIT_DB ~/.config/zeit.db
|
|
end
|
|
|
|
if type -q "geld"
|
|
set -x GELD_DB ~/.config/geld.db
|
|
end
|
|
|
|
if type -q "ncmpcpp"
|
|
set -x MPD_HOST ~/.config/mpd/socket
|
|
end
|
|
|
|
# Ensure that GPG Agent is used as the SSH agent
|
|
set -e SSH_AUTH_SOCK
|
|
#set -U -x SSH_AUTH_SOCK ~/.gnupg/S.gpg-agent.ssh
|
|
set -U -x SSH_AUTH_SOCK /run/user/(id -u)/gnupg/S.gpg-agent.ssh
|
|
|
|
set -x GPG_TTY (tty)
|
|
|
|
gpg-connect-agent updatestartuptty /bye >/dev/null
|
|
|
|
# Start or re-use a gpg-agent.
|
|
#gpgconf --launch gpg-agent
|
|
|
|
## Hide welcome message
|
|
set fish_greeting
|
|
set VIRTUAL_ENV_DISABLE_PROMPT "1"
|
|
|
|
## Starship prompt
|
|
#source ("/usr/bin/starship" init fish --print-full-init | psub)
|
|
starship init fish | source
|