zshrc: Clean up

This commit is contained in:
Simon Bruder 2020-08-20 00:20:17 +02:00
parent 2a6679a7fc
commit db47c4d3cb
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -18,22 +18,23 @@ export PATH="$HOME/bin:$PATH"
# Program aliases/env
## Aliases for programs
if which exa 2>&1 >> /dev/null;then
if command -v exa >/dev/null; then
alias exa="exa --git --binary"
alias l="exa -l"
alias la="exa -la"
alias ll="exa -l"
alias ls="exa"
fi
alias ipy="ipython3"
alias vim="nvim"
alias vimdiff="nvim -d"
export EDITOR=nvim
# Debian packages fd as fdfind
## Debian packages fd as fdfind
command -v fdfind >/dev/null && alias fd="fdfind"
## Environment variables
export HVSC_BASE="$HOME/Documents/sound/HVSC/"
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on" # force antialiasing in java
export EDITOR=nvim
## include docker functions
source ~/.zshrc.docker
@ -104,10 +105,11 @@ alias dynamic-colors="~/.dynamic-colors/bin/dynamic-colors"
## Support for nix-shell
source $HOME/.zsh/zsh-nix-shell/nix-shell.plugin.zsh
# Per-directory environment
## Per-directory environment
command -v direnv >/dev/null && eval "$(direnv hook zsh)"
nixify() {
## Helper to create nix-shell direnv
function nixify() {
if [ ! -e ./.envrc ]; then
echo "use nix" > .envrc
direnv allow
@ -152,25 +154,6 @@ function timer() (
fi
)
## Wallpaper switcher
function wp() (
if [ -z "$1" ] || ([ "$1" = "rand" ] && [ -z "$2" ]); then
echo "USAGE: $0 rand|restore|default [path]"
return 1
fi
if [ "$1" = "default" ];then
feh --bg-fill /usr/share/wallpapers/wallpaper.jpg
fi
if [ "$1" = "rand" ]; then
base="$HOME/Pictures/wallpaper"
rand=$(shuf -n1 -e $base/$2/*)
[ -z "$rand" ] || feh --bg-fill "$rand"
fi
if [ "$1" = "restore" ]; then
~/.fehbg
fi
)
function currency() (
amount=${1:-1}
fromcurrency=${2:-USD}
@ -245,6 +228,3 @@ command -v hcloud >/dev/null && source <(hcloud completion zsh)
## poetry
command -v poetry >/dev/null && ([ -e ~/.zfunc/_poetry ] || poetry completions zsh > ~/.zfunc/_poetry)
## rustup/cargo
command -v rustup >/dev/null && ([ -e ~/.zfunc/_cargo ] || rustup completions zsh cargo > ~/.zfunc/_cargo) && ([ -e ~/.zfunc/_rustup ] || rustup completions zsh rustup> ~/.zfunc/_rustup)