1
0
mirror of https://github.com/artizirk/dotfiles.git synced 2024-11-25 17:20:58 +02:00

Add default values to cal command

But clear the default args when calling with custom arguments
This commit is contained in:
Arti Zirk 2021-10-01 15:45:43 +03:00
parent a5340d681f
commit c7a930dac7

12
.zshrc
View File

@ -184,7 +184,6 @@ alias ipy="ipython"
alias htop="htop -d 10" alias htop="htop -d 10"
alias ip="ip -color=auto" alias ip="ip -color=auto"
alias cp="cp --reflink=auto" alias cp="cp --reflink=auto"
alias cal="cal -w3"
alias gitg="LANG=en_US.UTF-8 gitg" alias gitg="LANG=en_US.UTF-8 gitg"
if [[ "$TERM" == "alacritty" ]]; then if [[ "$TERM" == "alacritty" ]]; then
alias ssh='TERM=xterm-256color ssh' alias ssh='TERM=xterm-256color ssh'
@ -222,7 +221,18 @@ SAVEHIST=100000
unsetopt share_history unsetopt share_history
setopt INC_APPEND_HISTORY_TIME setopt INC_APPEND_HISTORY_TIME
# by default show 3 months of calendar with week number
# but also allow to override it
function cal {
local CALENDAR=$(which -p cal)
if [[ $# -eq 0 ]]; then
$CALENDAR -w3
else
$CALENDAR "$@"
fi
}
# this fixes gedit python plugins that otherwise are broken under venv
function gedit { function gedit {
local REAL_PATH=$PATH; local REAL_PATH=$PATH;
if [ -n "$_OLD_VIRTUAL_PATH" ] ; then if [ -n "$_OLD_VIRTUAL_PATH" ] ; then