Closed1
初めてのzsh。gitを快適に使いこなしたい
書き殴りメモ
brew install coreutils
brew install anyenv
brew install zsh-completions
~/.gitconfig
[user]
name = hanetsuki
email = example@example.com
[push]
default = current
[pull]
ff = only
rebase = false
[init]
defaultBranch = main
[core]
ignorecase = false
quotepath = false
[color]
ui = true
[alias]
ck = checkout
pl = pull
ps = push
br = branch
co = commit
df = diff
st = status
graph = log --pretty=format:'%Cgreen[%cd] %Cblue%h %Cred<%cn> %Creset%s' --date=short --decorate --graph --branches --tags --remotes
~/.zshrc
# node_modules
export PATH="$PATH:./node_modules/.bin"
# anyenv
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init -)"
# zsh-completions
if type brew &>/dev/null; then
FPATH="$(brew --prefix)/share/zsh-completions:$FPATH"
autoload -Uz compinit && compinit
fi
# zsh settings
autoload -Uz colors && colors
# git
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' unstagedstr '*'
zstyle ':vcs_info:git:*' stagedstr '+'
zstyle ':vcs_info:*' formats '%F{green}%c%u[%b]%f'
zstyle ':vcs_info:*' actionformats '[%b|%a]'
PROMPT='%n:%~'\$vcs_info_msg_0_'%# '
## Aliasの設定
# core
alias ls='gls --color=auto'
alias l='ls'
alias ll='ls -l'
alias rm='rm -i'
# git
alias gs='git status'
alias ga='git add'
alias gc='git commit -m'
alias gp='git p'
alias gl='git graph'
このスクラップは2022/01/12にクローズされました