-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
86 lines (69 loc) · 1.9 KB
/
.zshrc
File metadata and controls
86 lines (69 loc) · 1.9 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
# ADD GIT INFO TO PROMPT
parse_git_branch() {
local branch=""
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
local git_status=$(git status --porcelain 2>/dev/null)
local color=green
if echo "$git_status" | grep -q "^ M"; then
color=#DA70D6
branch="${branch}*"
fi
if echo "$git_status" | grep -qE "^ A|^\?\?"; then
color=cyan
branch="${branch}+"
fi
if echo "$git_status" | grep -q "^ D"; then
color=red
branch="${branch}-"
fi
if [[ -n "$branch" ]]; then
branch=[%F{${color}}${branch}%F{reset}]
fi
echo "$branch"
}
update_prompt() {
PS1="%F{cyan}%~
%F{green}%1~ %F{magenta}❯%{$reset_color%}$(parse_git_branch) "
}
precmd_functions+=(update_prompt)
update_prompt
bindkey "\e[3~" delete-char
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
setopt pushd_minus
setopt share_history
#exports here
export EDITOR=helix
export BAT_THEME=Dracula
export HISTFILE=~/.zsh_history
HISTSIZE=8000
SAVEHIST=8000
#sources here
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/share/zsh/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
#autoload
autoload -Uz compinit && compinit
autoload -U colors && colors
autoload -U promptinit && promptinit
#alias here
alias hx="helix"
alias cat="bat"
alias ls="lsd -a"
alias lz="lazygit"
alias fzf="fzf --preview "bat --color=always --style=numbers --line-range=:500 {}""
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=60'
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
#startups here
if [ -z "$TMUX" ]
then
tmux attach -t TMUX || tmux new -s TMUX \; new-window \ yazi;
fi
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
}