-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
163 lines (151 loc) · 6.36 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
source $HOME/.antigen/antigen.zsh
POWERLEVEL9K_INSTALLATION_PATH=$ANTIGEN_BUNDLES/bhilburn/powerlevel9k
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
antigen bundle command-not-found
antigen bundle vi-mode
# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle bhilburn/powerlevel9k
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-history-substring-search
# Load the theme.
antigen theme bhilburn/powerlevel9k powerlevel9k
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status vi_mode)
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
#POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{red} "
#POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR="\uE0b4"
#POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR="\uE0B6"
#POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
# Tell Antigen that you're done.
antigen apply
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
## Aliases
alias man='w3mman'
alias a-upd='sudo apt update'
alias a-list='apt list --upgradable'
alias a-inst='sudo apt install'
alias a-dist='sudo apt dist-upgrade'
alias a-r='sudo apt autoremove'
alias a-s='apt search'
# Editor
export EDITOR=nvim
export VISUAL=nvim
export PATH="$PATH:$HOME/.local/bin"
## Manjaro theme
##PROMPT="%B%{$fg[cyan]%}%(4~|%-1~/.../%2~|%~)%u%b >%{$fg[cyan]%}>%B%(?.%{$fg[cyan]%}.%{$fg[red]%})>%{$reset_color%}%b " # Print some system information when the shell is first started
##GIT_PROMPT_SYMBOL="%{$fg[blue]%}±" # plus/minus - clean repo
##GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$reset_color%}"
##GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}"
##GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}" # A"NUM" - ahead by "NUM" commits
##GIT_PROMPT_BEHIND="%{$fg[cyan]%}BNUM%{$reset_color%}" # B"NUM" - behind by "NUM" commits
##GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}⚡︎%{$reset_color%}" # lightning bolt - merge conflict
##GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}" # red circle - untracked files
##GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}●%{$reset_color%}" # yellow circle - tracked files modified
##GIT_PROMPT_STAGED="%{$fg_bold[green]%}●%{$reset_color%}" # green circle - staged changes present = ready for "git push"
##
##parse_git_branch() {
## # Show Git branch/tag, or name-rev if on detached head
## ( git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD ) 2> /dev/null
##}
##
##parse_git_state() {
## # Show different symbols as appropriate for various Git repository states
## # Compose this value via multiple conditional appends.
## local GIT_STATE=""
## local NUM_AHEAD="$(git log --oneline @{u}.. 2> /dev/null | wc -l | tr -d ' ')"
## if [ "$NUM_AHEAD" -gt 0 ]; then
## GIT_STATE=$GIT_STATE${GIT_PROMPT_AHEAD//NUM/$NUM_AHEAD}
## fi
## local NUM_BEHIND="$(git log --oneline ..@{u} 2> /dev/null | wc -l | tr -d ' ')"
## if [ "$NUM_BEHIND" -gt 0 ]; then
## GIT_STATE=$GIT_STATE${GIT_PROMPT_BEHIND//NUM/$NUM_BEHIND}
## fi
## local GIT_DIR="$(git rev-parse --git-dir 2> /dev/null)"
## if [ -n $GIT_DIR ] && test -r $GIT_DIR/MERGE_HEAD; then
## GIT_STATE=$GIT_STATE$GIT_PROMPT_MERGING
## fi
## if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
## GIT_STATE=$GIT_STATE$GIT_PROMPT_UNTRACKED
## fi
## if ! git diff --quiet 2> /dev/null; then
## GIT_STATE=$GIT_STATE$GIT_PROMPT_MODIFIED
## fi
## if ! git diff --cached --quiet 2> /dev/null; then
## GIT_STATE=$GIT_STATE$GIT_PROMPT_STAGED
## fi
## if [[ -n $GIT_STATE ]]; then
## echo "$GIT_PROMPT_PREFIX$GIT_STATE$GIT_PROMPT_SUFFIX"
## fi
##}
##
##git_prompt_string() {
## local git_where="$(parse_git_branch)"
##
## # If inside a Git repository, print its branch and state
## [ -n "$git_where" ] && echo "$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX"
##
## # If not inside the Git repo, print exit codes of last command (only if it failed)
## [ ! -n "$git_where" ] && echo "%{$fg[red]%} %(?..[%?])"
##}
##
### Right prompt with exit status of previous command if not successful
## #RPROMPT="%{$fg[red]%} %(?..[%?])"
### Right prompt with exit status of previous command marked with ✓ or ✗
## #RPROMPT="%(?.%{$fg[green]%}✓ %{$reset_color%}.%{$fg[red]%}✗ %{$reset_color%})"
##
##case $(basename "$(cat "/proc/$PPID/comm")") in
## login)
## RPROMPT="%{$fg[red]%} %(?..[%?])"
## alias x='startx ~/.xinitrc' # Type name of desired desktop after x, xinitrc is configured for it
## ;;
## urxvt)
## RPROMPT='$(git_prompt_string)'
## # Use autosuggestion
## source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
## ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
## ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
## ;;
## konsole|qterminal)
## RPROMPT='$(git_prompt_string)'
## ;;
## 'tmux: server')
## if $(ps -p$PPID| grep -q -e konsole -e qterminal); then
## RPROMPT='$(git_prompt_string)'
## else
## RPROMPT='$(git_prompt_string)'
## ## Base16 Shell color themes.
## #possible themes: 3024, apathy, ashes, atelierdune, atelierforest, atelierhearth,
## #atelierseaside, bespin, brewer, chalk, codeschool, colors, default, eighties,
## #embers, flat, google, grayscale, greenscreen, harmonic16, isotope, londontube,
## #marrakesh, mocha, monokai, ocean, paraiso, pop (dark only), railscasts, shapesifter,
## #solarized, summerfruit, tomorrow, twilight
## theme="eighties"
## #Possible variants: dark and light
## shade="dark"
## BASE16_SHELL="/usr/share/zsh/scripts/base16-shell/base16-$theme.$shade.sh"
## [[ -s $BASE16_SHELL ]] && source $BASE16_SHELL
## # Use autosuggestion
## source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
## ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
## ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
## fi
## ;;
## *)
## if $(ps -p$PPID| grep -q -e konsole -e qterminal); then
## RPROMPT='$(git_prompt_string)'
## else
## RPROMPT='$(git_prompt_string)'
## # Use autosuggestion
## source ~/.antigen/bundles/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh
## ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
## ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
## fi
## ;;
##esac
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh