From 35a80def92f95d575d9706cd7d5dd2f067890e47 Mon Sep 17 00:00:00 2001 From: Yax <1949284+kianby@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:59:22 +0200 Subject: [PATCH] Add useful aliases --- dot_zshrc.tmpl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index 4b852aa..757de3d 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -40,6 +40,11 @@ export FAVORITE_COMMAND4="{{ .tmux_favorite4 }}" alias cdd='cd {{ .deploydir }}' export cdd={{ .deploydir }} +alias rm='rm --interactive --verbose' +alias mv='mv --interactive --verbose' +alias cp='cp --verbose --interactive' +alias dmesg='dmesg -T' +alias grep='grep --color' # --------------------------------------------------------------------------- # History @@ -82,6 +87,15 @@ alias vi=$EDITOR # Tmux # --------------------------------------------------------------------------- +if command -v tmux &>/dev/null; then + alias ta='tmux attach' + + alias tkill="for s in \$(tmux list-sessions | awk -F ':' '{print \$1}' | fzf); do + tmux kill-session -t \$s; + done" +fi + + # Function to set tmux window title function set_tmux_title { if [[ -n "$TMUX" ]]; then @@ -172,3 +186,15 @@ if command -v mvn &>/dev/null; then # copy maven artifact alias d="python3 ~/.local/bin/deploy.py '$cdd'" fi + +# --------------------------------------------------------------------------- +# Nix +# --------------------------------------------------------------------------- + +if command nix-env &>/dev/null; then + alias nix-update='nix-channel --update && nix-env -u' + + nix-search() { + nix-env -qa --description ".*$1.*" + } +fi \ No newline at end of file