From 0aa0b98f1793f1ffc1759d21f11ad04f4944653f Mon Sep 17 00:00:00 2001 From: Michel Date: Wed, 19 Apr 2023 14:34:57 +0200 Subject: [PATCH] feat(zsh): aliases & completion --- .zshrc | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/.zshrc b/.zshrc index b799ec6..ad1fa43 100644 --- a/.zshrc +++ b/.zshrc @@ -155,33 +155,32 @@ source ${ZIM_HOME}/init.zsh ### -### Aliases +### Aliases / Functions ### # -# See https://www.thorsten-hans.com/5-types-of-zsh-aliases - -alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' -alias hg="kitty +kitten hyperlinked_grep" -alias ls='exa --icons --no-permissions --no-user' -alias make='colormake-short' - -# Neovim — nvim +# https://www.thorsten-hans.com/5-types-of-zsh-aliases # -# To choose an existing instance for nvr, use: -# `export NVIM=$(nvr --serverlist | fzf --exit-0 --select-1) && echo $NVIM` -alias vi='nvim' - - -# Debian Specific: -# sudo dpkg-divert --divert /usr/bin/fd --rename /usr/bin/fdfind +# https://unix.stackexchange.com/questions/250314/whats-the-intended-use-case-for-complete-aliases-in-zsh +# See also the Completion section below alias cp='cp --interactive' +alias ls='exa --icons --no-permissions --no-user' alias mv='mv --interactive' alias rm='rm -I' autoload -U zmv alias mmv='noglob zmv -W' +# Dev +# +alias make='colormake-short' +compdef colormake=make +compdef colormake-short=make + +# Git +# +alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME' + lg() { export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir @@ -192,6 +191,21 @@ lg() fi } +# Kitty +# +hg () { kitty +kitten hyperlinked_grep "$@" } +compdef hg=rg + +# Neovim — nvim +# +# To choose an existing instance for nvr, use: +# `export NVIM=$(nvr --serverlist | fzf --exit-0 --select-1) && echo $NVIM` +alias vi='nvim' + + +# Debian Specific: +# sudo dpkg-divert --divert /usr/bin/fd --rename /usr/bin/fdfind + ### ### Aliases -- Global & automatic expansion @@ -314,8 +328,5 @@ typeset -U path fpath ### Completion Late Definitions ### -compdef colormake=make -compdef colormake-short=make - # Hide "parameters" (i.e. environment variables) when looking for a "command" zstyle ':completion:*:-command-:*' tag-order '!parameters'