-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshrc
57 lines (46 loc) · 1.52 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Misc options.
bindkey -v
setopt autocd
# Bits from Oh My ZSH df5b09e20b05a5ba4234599602f7a74934c916db.
ZSH_CACHE_DIR="$HOME/.cache/zsh"
source "$HOME/.zsh/completion.zsh"
source "$HOME/.zsh/history.zsh"
source "$HOME/.zsh/misc.zsh"
source "$HOME/.zsh/vi-mode.plugin.zsh"
source "/usr/share/doc/fzf/examples/key-bindings.zsh"
source "/usr/share/doc/fzf/examples/completion.zsh"
source "$HOME/.zsh/fzf-git.sh"
HISTSIZE=10000
SAVEHIST=$HISTSIZE
eval "$(lesspipe)"
# Autojump.
source "$HOME/.autojump/bin/autojump.zsh"
autoload -U compinit && compinit -u
# Disable r builtin (alias for `fc -e -`)
disable r
# Bind ^Z to fg, allowing to cycle in and out of apps quickly.
function rebind-z() { fg }
zle -N rebind-z
bindkey '^Z' rebind-z
# Awe-inspiring prompt.
autoload -U colors && colors
autoload -Uz vcs_info
local cmdstatus="[%j:%(?.%{$fg[green]%}.%{$fg[red]%})%B%?%b]"
local userat="%{$fg[green]%}%B%(!.%{$fg[red]%}.%{$fg[green]%})%B@%{$fg[green]%}%m%b"
local pwd="%B%{$fg[blue]%}%c%b"
local userchar="%(!.#.$)"
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' check-for-changes true
setopt prompt_subst
precmd() {
vcs_info
print -Pn "\e]0;$(basename "$(pwd)")\a"
}
local branch=" %{$fg[green]%}[%b%c%u%{$fg[green]%}]%{$reset_color%}"
zstyle ':vcs_info:*' formats "$branch"
zstyle ':vcs_info:*' actionformats "$branch (%a)"
zstyle ':vcs_info:*' stagedstr "%{$fg[yellow]%}*"
zstyle ':vcs_info:*' unstagedstr "%{$fg[red]%}*"
PROMPT="$cmdstatus$userat:$pwd\${vcs_info_msg_0_}$userchar "
source "$HOME/.commonshrc"
source "$HOME/.zsh_local"