-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.zshrc
More file actions
96 lines (78 loc) · 3.61 KB
/
.zshrc
File metadata and controls
96 lines (78 loc) · 3.61 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
zmodload zsh/complist
# == AUTO COMPLETE ==
autoload -Uz compinit
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' menu select=3 yes
compinit
# eval "$(uv generate-shell-completion zsh)"
# // AUTO COMPLETE //
alias vi='nvim -p'
alias vim='nvim -p'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ls='ls --color=auto'
alias hx=helix
autoload up-line-or-beginning-search
autoload down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey -v
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search
export EDITOR=nvim
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket
export PNPM_HOME="${HOME}/.pnpm"
export PATH="${HOME}/.cargo/bin:${HOME}/.local/bin:${PNPM_HOME}:${KREW_ROOT:-$HOME/.krew}/bin:${PATH}"
limit -s coredumpsize 0
fignore=(.o .old .pro .pyc \~)
umask 0027
# AUTO_CD peform cd if a directory name is given
# AUTO_PUSHD cd push the old directory onto the directory stack
# CD_ABLE_VARS expand text (if not a command nor a directory in PWD) to ~/text
# PUSH_IGNORE_DUPS prohibit duplicate directories in the directory stack
# PUSHD_SILENT do not print directory stack after pushd popd
# PUSHD_TO_HOME 'pushd' acts like 'pushd $HOME'
setopt AUTO_CD AUTO_PUSHD CD_ABLE_VARS PUSHD_IGNORE_DUPS PUSHD_SILENT PUSHD_TO_HOME
# ALWAYS_TO_END moves the cursor to the end of the command
# AUTO_LIST automatcally list choices on ambiguity
# AUTO_PARAM_SLASH
# NO_LIST_BEEP no beeping
# NO_BEEP beep! beep!
setopt ALWAYS_TO_END AUTO_LIST NO_LIST_BEEP NO_BEEP
# EXTENDED_BLOG treat '#' '~' '^' as part of the expression for filename generation
# GLOB_DOTS do not require a initial '.' to match
# NOMATCH if the globbing is unsucessful, leave the string alone
# KSH_GLOB *, +, and ? have the same meaning as with regular expressions, BUT it needs to be right BEFORE a group, ex.: ?(example)
# PROMPT_SUBST allows expansion and substitution in the prompt
# NO_NOMATCH set so that `git log HEAD^` does not try to glob and give the error "zsh: no matches found: HEAD^"
setopt EXTENDED_GLOB GLOB_DOTS NOMATCH KSH_GLOB PROMPT_SUBST
# EXTENDED_HISTORY save commands in history at this format ":begin of the command:time elapsed:command"
# HIST_IGNORE_DUPS insert the new command and remove all older duplications of this
# NO_HIST_BEEP no beeping
# HIST_IGNORE_SPACE if a command start with ' ' it is not inserted in the history file
# HIST_REDUCE_BLANKS remove unnecessary blank spaces
setopt EXTENDED_HISTORY NO_HIST_BEEP HIST_IGNORE_ALL_DUPS HIST_IGNORE_SPACE HIST_REDUCE_BLANKS
HISTSIZE=5000
SAVEHIST=5000
HISTFILE=~/.history
DIRSTACKSIZE=7
# CORRECT_ALL try to correct everythin on the line
# RM_STAR_WAIT ignore keyboard input for 10 sec when 'rm *' or 'rm PATH *'
setopt CORRECT_ALL RM_STAR_WAIT
# LONG_LIST_JOBS use long list as default
# NOTIFY immediate report of the status of bg jobs
# NO_BG_NICE run bg jobs as fg jobs
# NO_HUP continue running bg jobs even of shell is closed
setopt LONG_LIST_JOBS NOTIFY NO_BG_NICE NO_HUP MULTIOS
export PS2="> "
local HOUR="%F{blue}%T%f"
local JOBS="%1(j,%F{yellow}%j%f ,)"
if [[ $UID -eq '0' ]]; then;
export PS1="%F{red}%n%f %1. %(?.%#.%F{red}%#%f) "
else;
export PS1="%1.% ${JOBS}${HOUR} % "
fi;
# show the hostname when we are connected through ssh
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
export PS1="%M $PS1"
fi;