diff --git a/dotfiles/.zfunc/run_pg b/dotfiles/.zfunc/run_pg new file mode 100755 index 0000000000000000000000000000000000000000..4b3a12f514fc0c1995dd572d66660bb539ba62bc --- /dev/null +++ b/dotfiles/.zfunc/run_pg @@ -0,0 +1,14 @@ +#!/bin/zsh +zparseopts -E -A opts -user:: -db:: -password:: -port:: + +db_name="${opts[--db]:-db}" + +docker run \ + --rm \ + -d \ + -p "${opts[--port]:-5432}:5432" \ + --name="${db_name}-pg" \ + -e POSTGRES_PASSWORD="${opts[--password]:-password}" \ + -e POSTGRES_USER="${opts[--user]:-user}" \ + -e POSTGRES_DB="${db_name}" \ + postgres \ No newline at end of file diff --git a/dotfiles/.zfunc/run_redis b/dotfiles/.zfunc/run_redis new file mode 100755 index 0000000000000000000000000000000000000000..f01a0a0b234d6954806f7559847697e705c3b7ad --- /dev/null +++ b/dotfiles/.zfunc/run_redis @@ -0,0 +1,14 @@ +#!/bin/zsh +zparseopts -E -A opts -port:: -name:: + +dargs=( + "--rm" + "-d" + "-p="${opts[--port]:-6379}:6379"" +) + +if [[ -v opts[--name] ]]; then + dargs+="--name=${opts[--name]}" +fi + +docker run ${dargs[*]} redis \ No newline at end of file diff --git a/dotfiles/.zshenv b/dotfiles/.zshenv index 73b6e5f776ccaa0a5f45178a9247781a6462245b..491715b3c9e0ca4a25bb43ebb5ee091bb10eceb8 100644 --- a/dotfiles/.zshenv +++ b/dotfiles/.zshenv @@ -3,3 +3,4 @@ PYENV_ROOT=~/.pyenv/ EDITOR=/bin/vim LC_ALL="$LANG" path=($path[@] ~/.poetry/bin/ ~/.local/bin/ ~/.pyenv/bin ~/.cargo/bin/) +fpath=($fpath[@] ~/.zfunc) diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc index df64dc9834fad5c324e1f09e893b2774040a96f5..d23a72ca50ea5df9070fb3d7527a81c4e868f0f3 100644 --- a/dotfiles/.zshrc +++ b/dotfiles/.zshrc @@ -131,7 +131,9 @@ unset __conda_setup compinit autoload -U +X bashcompinit && bashcompinit +autoload -U ~/.zfunc/* complete -o nospace -C /usr/bin/terraform terraform + eval "$(pyenv init -)" source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh diff --git a/install.sh b/install.sh index 7b1567a974510708d1cf7afb4f611fe986be847c..37a364a008483f187ed2343e3f57dfc1efcaa851 100644 --- a/install.sh +++ b/install.sh @@ -40,6 +40,7 @@ function copy_dotfiles(){ mkdir -p "$HOME/.local/bin/" sed "s#{{dwm_dir}}#$(pwd)/dwm#g" ./update_desktop.sh > "$HOME/.local/bin/update_desktop" chmod 777 "$HOME/.local/bin/update_desktop" + cp -vr ./dotfiles/.zfunc "$HOME" cp -v ./dotfiles/.zshrc "$HOME" cp -v ./dotfiles/.zshenv "$HOME" cp -v ./dotfiles/.zshenv "$HOME"