home/dot_config/fish/executable_config.fish
2022-12-05 13:54:25 +01:00

105 lines
2.7 KiB
Fish

# Convenience function for only setting PATH if the specified directory exists
function setpath
test -e $argv[1]; and fish_add_path $argv[1]
end
# Custom greeting
function fish_greeting
echo "Welcome to $(hostname -s)!"
end
if test -z "$XDG_RUNTIME_DIR"
set -x XDG_RUNTIME_DIR "/tmp/$USER-runtime-dir"
if test ! -e "$XDG_RUNTIME_DIR"
mkdir "$XDG_RUNTIME_DIR"
chmod 0700 "$XDG_RUNTIME_DIR"
end
end
# PATH adjustment
setpath /opt/local/bin
setpath /opt/homebrew/bin
setpath ~/.rbenv/shims
setpath ~/.rbenv/bin
setpath ~/.pyenv/shims
setpath ~/.cargo/bin
setpath ~/.nimble/bin
setpath ~/.local/bin
setpath ~/.local/bin/elixir-ls
setpath ~/.bin
setpath ~/.cask/bin
setpath ~/.npm-packages/bin
setpath ~/.n/bin
setpath /snap/bin
setpath ~/.emacs.d/bin
setpath ~/.fly/bin
setpath ~/.nimble/bin
setpath ~/Projects/go/bin
setpath ~/.bun/bin
setpath ~/go/bin
# zoxide setup
zoxide init fish | source
# Source private stuff
source ~/.config/fish/private.fish
# Environment variables
set -x EDITOR "hx"
set -x USER "lu"
set -x SHELL (which fish)
set -x TERM xterm-256color
set -x GTK_IM_MODULE ibus
set -x XMODIFIERS @im=ibus
set -x QT_IM_MODULE ibus
set -x GLFW_IM_MODULE ibus
set -x LANG en_US.UTF-8
set -x LC_ALL en_US.UTF-8
set -x LC_CTYPE en_US.UTF-8
set -x LANGUAGE en_US.UTF-8
set -x RUST_SRC_PATH (rustc --print sysroot)/lib/rustlib/src/rust/src
set -x XDG_CURRENT_DESKTOP Unity
set -x LANG "en_US.UTF-8"
set -x TZ_LIST "Europe/Berlin;Berlin,America/New_York;US East,America/Los_Angeles;US West,Europe/London;London"
# General Aliases
alias editconfig "chezmoi edit ~/.config/fish/config.fish; and chezmoi apply; and source ~/.config/fish/config.fish"
alias printsshkey "cat ~/.ssh/id_ed25519.pub -p --color never"
alias doco "docker-compose"
alias j "z"
alias c "cargo"
alias cr "cargo run"
alias cb "cargo build"
alias cwr "cargo watch -x run"
alias rp "rustup"
alias be "bundle exec"
alias mkt "cd (mktemp -d)"
alias czm "chezmoi"
alias lsh "ls -lah"
# Git Aliases
alias g "git"
alias gs "g status --short"
alias gl "g log --color --graph --abbrev-commit --oneline"
alias gqp "g add --all; and g commit; and g push"
alias gqc "g add --all; and g commit"
alias gpl "g pull"
alias gps "g push"
alias gc "g commit"
alias gb "g branch"
alias gaa "g add --all"
alias gco "g checkout"
alias gse "g send-email"
alias wip "g add --all; and g commit -m WIP"
alias squish "gs; and g commit -a --amend -C HEAD"
alias editorigin "git remote set-url origin"
# Alias vim to helix if it exists because vim is way easier to type
if command --search hx > /dev/null
alias vim "hx"
end
# Load nix profile if nix is installed
if test -e /nix
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish
set -x NIX_PATH "$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels"
end