zshrc: Clean up
This commit is contained in:
parent
2a6679a7fc
commit
db47c4d3cb
|
@ -18,22 +18,23 @@ export PATH="$HOME/bin:$PATH"
|
||||||
# Program aliases/env
|
# Program aliases/env
|
||||||
|
|
||||||
## Aliases for programs
|
## Aliases for programs
|
||||||
if which exa 2>&1 >> /dev/null;then
|
if command -v exa >/dev/null; then
|
||||||
alias exa="exa --git --binary"
|
alias exa="exa --git --binary"
|
||||||
|
alias l="exa -l"
|
||||||
|
alias la="exa -la"
|
||||||
|
alias ll="exa -l"
|
||||||
alias ls="exa"
|
alias ls="exa"
|
||||||
fi
|
fi
|
||||||
alias ipy="ipython3"
|
alias ipy="ipython3"
|
||||||
|
|
||||||
alias vim="nvim"
|
alias vim="nvim"
|
||||||
alias vimdiff="nvim -d"
|
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"
|
command -v fdfind >/dev/null && alias fd="fdfind"
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
export HVSC_BASE="$HOME/Documents/sound/HVSC/"
|
|
||||||
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on" # force antialiasing in java
|
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on" # force antialiasing in java
|
||||||
|
export EDITOR=nvim
|
||||||
|
|
||||||
## include docker functions
|
## include docker functions
|
||||||
source ~/.zshrc.docker
|
source ~/.zshrc.docker
|
||||||
|
@ -104,10 +105,11 @@ alias dynamic-colors="~/.dynamic-colors/bin/dynamic-colors"
|
||||||
## Support for nix-shell
|
## Support for nix-shell
|
||||||
source $HOME/.zsh/zsh-nix-shell/nix-shell.plugin.zsh
|
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)"
|
command -v direnv >/dev/null && eval "$(direnv hook zsh)"
|
||||||
|
|
||||||
nixify() {
|
## Helper to create nix-shell direnv
|
||||||
|
function nixify() {
|
||||||
if [ ! -e ./.envrc ]; then
|
if [ ! -e ./.envrc ]; then
|
||||||
echo "use nix" > .envrc
|
echo "use nix" > .envrc
|
||||||
direnv allow
|
direnv allow
|
||||||
|
@ -152,25 +154,6 @@ function timer() (
|
||||||
fi
|
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() (
|
function currency() (
|
||||||
amount=${1:-1}
|
amount=${1:-1}
|
||||||
fromcurrency=${2:-USD}
|
fromcurrency=${2:-USD}
|
||||||
|
@ -245,6 +228,3 @@ command -v hcloud >/dev/null && source <(hcloud completion zsh)
|
||||||
|
|
||||||
## poetry
|
## poetry
|
||||||
command -v poetry >/dev/null && ([ -e ~/.zfunc/_poetry ] || poetry completions zsh > ~/.zfunc/_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)
|
|
||||||
|
|
Reference in a new issue