| name | cli-productivity-1-complete-shell-configuration |
| description | Sub-skill of cli-productivity: 1. Complete Shell Configuration (+1). |
| version | 1.0.0 |
| category | operations |
| type | reference |
| scripts_exempt | true |
1. Complete Shell Configuration (+1)
1. Complete Shell Configuration
~/.bashrc or ~/.zshrc:
export EDITOR="vim"
export VISUAL="$EDITOR"
export PAGER="bat"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
HISTSIZE=50000
HISTFILESIZE=50000
HISTCONTROL=ignoreboth:erasedups
shopt -s histappend
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_DEFAULT_OPTS='
--height 40%
--layout=reverse
--border
--preview-window=right:50%:wrap
'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'
export FZF_ALT_C_OPTS='--preview "exa --tree --level=2 --color=always {}"'
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
eval "$(zoxide init bash)"
eval "$(starship init bash)"
alias ls='exa --group-directories-first'
alias ll='exa -l --group-directories-first --git'
alias la='exa -la --group-directories-first --git'
alias lt='exa --tree --level=2'
alias cat='bat --paging=never'
alias grep='rg'
alias find='fd'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias g='git'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gp='git push'
alias gl='git log --oneline -20'
alias gd='git diff'
alias d='docker'
alias dc='docker compose'
alias dps='docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"'
fe() {
local file
file=$(fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}')
[[ -n "$file" ]] && ${EDITOR:-vim} "$file"
}
fcd() {
local dir
dir=$(fd --type d | fzf --preview 'exa --tree --level=2 --color=always {}')
[[ -n "$dir" ]] && cd "$dir"
}
rge() {
local selection
selection=$(rg --color=always --line-number "$1" | fzf --ansi)
if [[ -n "$selection" ]]; then
local file=$(echo "$selection" | cut -d: -f1)
local line=$(echo "$selection" | cut -d: -f2)
${EDITOR:-vim} "+$line" "$file"
fi
}
mkcd() {
mkdir -p "$1" && cd "$1"
}
2. Data Processing Pipeline
curl -s 'https://api.github.com/users/torvalds/repos?per_page=100' \
| jq '.[] | {name: .name, stars: .stargazers_count}' \
| jq -s 'sort_by(.stars) | reverse | .[0:10]'
fd -e log -S +10M \
| fzf --preview 'tail -100 {}' \
| xargs -I{} bat --line-range=:50 {}
rg --color=always -l "TODO" \
| fzf --preview 'rg --color=always -C 3 "TODO" {}' \
| xargs -o ${EDITOR:-vim}
git log --oneline --color=always \
| fzf --ansi --preview 'git show --color=always {1}' \
| awk '{print $1}' \
| xargs git show