Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
reihori committed Sep 16, 2024
1 parent bdd1f1f commit 5503ec0
Showing 1 changed file with 52 additions and 34 deletions.
86 changes: 52 additions & 34 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,39 @@ export PATH="$HOME/.local/bin:$PATH"

typeset -U path PATH

setopt AUTO_CD
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS

setopt AUTO_CD

autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'

alias_cmd=alias
if [ -d "${HOME}/.zsh/zsh-abbr" ]; then
source ${HOME}/.zsh/zsh-abbr/zsh-abbr.zsh
alias_cmd=(abbr --session --quiet)
fi

alias ls="ls --color=auto"
$alias_cmd l="ls -1"
$alias_cmd la="ls -A"
$alias_cmd ll="ls -hl"

$alias_cmd c="cd"

$alias_cmd h="history"

$alias_cmd v="vim"

$alias_cmd g="git"
$alias_cmd ga="git add"
$alias_cmd gaa="git add --all"
$alias_cmd gau="git add --update"
$alias_cmd gb="git branch"
$alias_cmd gc="git commit"
$alias_cmd gd="git diff"
$alias_cmd gds="git diff --staged"
$alias_cmd gl="git log"
$alias_cmd glg="git log --oneline --all --graph"
$alias_cmd glo="git log --oneline"
$alias_cmd glp="git log --patch"
$alias_cmd gs="git status"
$alias_cmd gw="git switch"

chpwd() {
ls
}

sync_plugins() {
local -A plugins
plugins=(
pure https://github.com/sindresorhus/pure.git
zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions
zsh-syntax-highlighting https://github.com/zsh-users/zsh-syntax-highlighting.git
zsh-abbr https://github.com/olets/zsh-abbr
)
local dir="$HOME/zsh_tmp"
if [ -d "$dir" ]; then
local cmd="rm -rf $dir"
echo "> $cmd"
eval $cmd
fi
for key in ${(k)plugins}; do
local cmd="git clone --depth 1 $plugins[$key] $dir/$key 2> /dev/null"
echo "> $cmd"
eval $cmd
done
}

if [ -d "${HOME}/.zsh/pure" ]; then
fpath+=(${HOME}/.zsh/pure)
autoload -U promptinit && promptinit
Expand All @@ -75,3 +63,33 @@ if command -v zoxide > /dev/null; then
export _ZO_DATA_DIR="${HOME}/.local/share"
eval "$(zoxide init zsh)"
fi

alias_cmd=alias
if [ -d "${HOME}/.zsh/zsh-abbr" ]; then
source ${HOME}/.zsh/zsh-abbr/zsh-abbr.zsh
alias_cmd=(abbr --session --quiet)
fi

$alias_cmd c="cd"
$alias_cmd h="history"
$alias_cmd v="vim"

alias ls="ls --color=auto"
$alias_cmd l="ls -1"
$alias_cmd la="ls -A"
$alias_cmd ll="ls -hl"

$alias_cmd g="git"
$alias_cmd ga="git add"
$alias_cmd gaa="git add --all"
$alias_cmd gau="git add --update"
$alias_cmd gb="git branch"
$alias_cmd gc="git commit"
$alias_cmd gd="git diff"
$alias_cmd gds="git diff --staged"
$alias_cmd gl="git log"
$alias_cmd glg="git log --oneline --all --graph"
$alias_cmd glo="git log --oneline"
$alias_cmd glp="git log --patch"
$alias_cmd gs="git status"
$alias_cmd gw="git switch"

0 comments on commit 5503ec0

Please sign in to comment.