-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
67 lines (56 loc) · 1.86 KB
/
dot_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
58
59
60
61
62
63
64
65
66
67
export ZSH_DISABLE_COMPFIX="true"
export ZSH="~/.zsh"
# History
HISTSIZE=50000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory # Immediately append to history file.
setopt sharehistory # Share history between all sessions
setopt hist_ignore_space # Dont record an entry starting with a space.
setopt hist_ignore_all_dups # Delete old recorded entry if new entry is a duplicate.
setopt hist_save_no_dups # Dont write duplicate entries in the history file.
setopt hist_ignore_dups # Dont record an entry that was just recorded again.
setopt hist_find_no_dups # Do not display a line previously found.
# Case-insensitive completion
autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
export EDITOR='nvim'
# Random utils
alias ll='ls -al'
alias line='printf '─%.s' {1..$(tput cols)}'
mkcd() {
mkdir -p $1 && cd $1
}
# Git
alias b='git switch'
alias nb='git switch -c'
alias s='git status'
alias a='git add'
alias c='git commit'
alias gpl='git pull'
alias gps='git push'
gcap() {
# git commit all push
git add --all
git commit -m "$1"
git push
}
alias cdr='cd $(git rev-parse --show-toplevel)' # cd to git Root
# Notes
alias n='nvim +Notes' # Opens Vim and calls `:Notes`
# Created by `pipx` on 2023-12-15 22:23:48
export PATH="$PATH:/Users/r-cha/.local/bin"
export CLICOLOR=1
# TODO: Transient prompt
# SHORT_PROMPT='%F{%(?.green.red)}%~ ╶❯%f '
# I hate this, but the init options slightly optimize it (300ms -> ~90ms)
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - --no-rehash zsh)"
autoload -Uz vcs_info
precmd() { vcs_info }
zstyle ':vcs_info:git:*' formats '%b '
setopt PROMPT_SUBST
NEWLINE=$'\n'
PROMPT='%F{%(?.green.red)}┌%f%F{blue}%~%f%F{red} ${vcs_info_msg_0_}%f%F{%(?.green.red)}${NEWLINE}└❯%f '