Skip to content

Commit

Permalink
add bash aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Chen committed May 27, 2024
1 parent 3de89bc commit 9f85c14
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
13 changes: 13 additions & 0 deletions config/.bash_aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# tmux or screen ?
(bin-exist tmux) && alias s=tmux || alias s=screen

alias find='noglob find' # noglob for find
alias grep='grep -I --color=auto'
alias egrep='egrep -I --color=auto'
alias df='df -Th'
alias du='du -h'

alias gc="git clean -f -e '!*.orig'"

14 changes: 5 additions & 9 deletions config/custom_kai.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,13 @@ fi

# }}}

# tmux or screen ?
(bin-exist tmux) && alias s=tmux || alias s=screen

alias find='noglob find' # noglob for find
alias grep='grep -I --color=auto'
alias egrep='egrep -I --color=auto'
alias df='df -Th'
alias du='du -h'
# Aliases
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

# Shut up Zsh
unsetopt beep

# no need to use this when NTP is up running
# For WSL, no need to use this when NTP is up running
# sudo hwclock -s
7 changes: 7 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ if [ -f "$HOME/.zshrc" ]; then
cp "$HOME/.zshrc" "$HOME/.zshrc.bak"
fi

# Backup .bash_aliases if it exists
if [ -f "$HOME/.bash_aliases" ]; then
echo "Backing up .bash_aliases to .bash_aliases.bak"
cp "$HOME/.bash_aliases" "$HOME/.bash_aliases.bak"
fi

# Create symbolic links for .vimrc and .tmux.conf
ln -sf "$REPO_DIR/config/.vimrc" "$HOME/.vimrc"
ln -sf "$REPO_DIR/config/.tmux.conf" "$HOME/.tmux.conf"
ln -sf "$REPO_DIR/config/.bash_aliases" "$HOME/.bash_aliases"

# Install zsh-history-substring-search plugin
if [ ! -d "$ZSH_CUSTOM/plugins/zsh-history-substring-search" ]; then
Expand Down

0 comments on commit 9f85c14

Please sign in to comment.