Files
.config/fish/config.fish

132 lines
3.2 KiB
Fish

# vim: filetype=sh
# OMF plugins: bass, fisher, foreign-env, omf, fish-spec, nvm
# Variables
set -g -x fish_greeting ""
set -U os (uname)
set -U TERMINAL "st"
# Keybinds
## Unbind control + V keybind
bind -e \cv
# Exports
## zoxide
export FZF_DEFAULT_OPTS='--height 40%'
zoxide init fish --cmd z | source
# Atuin (expanded history search)
atuin init fish | source
## dwmblocks
fish_add_path /home/(whoami)/.local/bin
fish_add_path /home/(whoami)/.local/bin/statusbar
## DOTNET
fish_add_path $DOTNET_ROOT
fish_add_path $DOTNET_ROOT/tools
export DOTNET_ROOT=$HOME/.dotnet
## Node Version Manager
export NVM_DIR=$HOME/.nvm
## Unison
export UNISON=$HOME/.config/unison
## Spicetify
fish_add_path $HOME/.spicetify
## JOZ tools
export JOZ_PATH=$HOME/Documents/devel
export BTG_IP="192.168.201.128"
export BTG_PASSWORD="btg"
fish_add_path /home/(whoami)/.local/bin/joz
# Internet
## Automatically set a default User-Agent header
alias curl="curl -H \"User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0\" "
alias wget="wget --header=\"User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0\" "
## wget/curl tests
alias ct="curl \"https://httpbin.org/get\" >> curl.json"
alias wt="wget \"https://httpbin.org/get\" -d -O wget.json -o wget.log"
# Aliases / shortcuts
## Exiting / Package management
alias ka="killall"
alias cya="shutdown now"
alias pacman="sudo pacman"
alias upc="sudo pacman -Syu; pkill -RTMIN+8 dwmblocks"
alias lsp="pacman -Qett | less" #--color=always
## Git update for dotfiles
alias update="git -C ~/.config pull && git -C ~/.local pull"
## Shortcut creation
alias ref="shortcuts >/dev/null; source ~/.config/shortcutrc"
## Lazy / Filebrowsing
alias d="lazydocker"
alias g="lazygit"
alias r="ranger"
alias f="fzf"
alias fn="nvim (fzf)"
## eza, a fork of exa, a coloured ls alternative
alias ls="eza "
alias la="eza -la"
alias ols="/usr/bin/ls"
alias olsc="/usr/bin/ls -hN --color=auto --group-directories-first"
## Set colours default for commands
alias diff="diff --color=auto"
alias grep="grep --color=auto"
alias ccat="highlight --out-format=ansi"
## Show system information
alias show="inxi -vvG && fastfetch"
## Development
### Use neovim for vim if present
command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d"
alias v="vim"
alias vi="vim"
alias py="python"
### GHCup (Haskell)
set -q GHCUP_INSTALL_BASE_PREFIX[1]; or set GHCUP_INSTALL_BASE_PREFIX $HOME ; set -gx PATH $HOME/.cabal/bin /home/wessel/.ghcup/bin $PATH # ghcup-env
## Video downloading
alias yt="yt-dlp --add-metadata -i -o '%(upload_date)s-%(title)s.%(ext)s'"
alias yta="yt -x -f bestaudio/best"
# Run zoxide, onefetch and env detector on CD
function cd -w='cd'
z $argv || return
check_directory_for_new_repository
check_and_source_activate
end
check_git_status $HOME/.config
check_git_status $HOME/.local
# Set custom prompt
function fish_prompt -d "Write out the prompt"
set_color "c0241e"; printf "["
set_color "d69923"; printf $USER
set_color "99AAB5"; printf "@"
set_color "679D69"; printf $hostname
set_color "c0241e"; printf "]"
set_color grey; printf '%s' (prompt_pwd);
set_color "99AAB5"; printf "\$ "
end
# Start tmux by default
# if status is-interactive
# and not set -q TMUX
# exec tmux
# end