1
0
Fork 0
mirror of https://github.com/kou029w/dotfiles.git synced 2025-01-17 23:55:07 +00:00

add .zshrc

This commit is contained in:
Nebel 2023-08-08 21:51:52 +09:00
parent b82f68a44b
commit adb3537c6e
Signed by: nebel
GPG key ID: 79807D08C6EF6460
3 changed files with 21 additions and 2 deletions

View file

@ -5,8 +5,7 @@ HISTCONTROL=ignoreboth:erasedups
HISTFILESIZE=$((0x7fffffff))
HISTSIZE=$((0x7fffffff))
PROMPT_COMMAND='[[ $_PWD == $PWD ]] || { _PWD=$PWD; ls; }'
PS1=$PS1'\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1=${PS1%'\$ '}'$(__git_ps1 " \[\033[32m\](%s)\[\033[00m\]")\n\$ '
PS1=$PS1'\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] $(__git_ps1 "\[\033[32m\](%s)\[\033[00m\]")\n\$ '
alias ..='cd ..'
alias cp='cp --reflink=auto'
alias diff='diff --color=auto'

1
.zsh/functions/_git Symbolic link
View file

@ -0,0 +1 @@
/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.zsh

19
.zshrc Normal file
View file

@ -0,0 +1,19 @@
. /Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh
zstyle ':completion:*:*:git:*' script /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash
fpath=(~/.zsh/functions $fpath)
autoload -Uz compinit && compinit
alias ..='cd ..'
alias cp='cp --reflink=auto'
alias diff='diff --color=auto'
alias grep='grep --color=auto'
alias ll='ls -alF'
alias ls='ls --color=auto'
precmd() {
[[ "$TERM" == xterm-256color ]] && print -Pn -- '\e]2;%n@%m %~\a'
[[ "$_PWD" == "$PWD" ]] && return
_PWD="$PWD"
ls
}
setopt PROMPT_SUBST
PROMPT='%B%F{green}%n@%m%f%b:%B%F{blue}%~%f%b $(__git_ps1 "%%F{green}(%s)%%f")
%# '