-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
executable file
·131 lines (102 loc) · 2.73 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
#!/usr/bin/zsh
export GITHUB_DIR="${HOME}/github/"
if [ -d "${HOME}/.local/bin" ]; then
export CUSTOM_BIN_DIR="${HOME}/.local/bin"
fi
export PATH="${PATH}:${CUSTOM_BIN_DIR}"
# Path to your oh-my-zsh installation
export ZSH=${HOME}/.oh-my-zsh
# Theme settings - ${ZSH}/custom/themes/bullet-train.zsh-theme
export ZSH_THEME="bullet-train"
export BULLETTRAIN_STATUS_EXIT_SHOW=true
export BULLETTRAIN_PROMPT_ORDER=(
time
status
context
dir
screen
git
cmd_exec_time
)
# Base16 color scheme
BASE16_DIR="${GITHUB_DIR}/base16-shell/"
[ -n "${PS1}" ] && [ -s "${BASE16_DIR}/profile_helper.sh" ] && eval "$("${BASE16_DIR}/profile_helper.sh")"
# zsh plugins
plugins=(
npm
sudo
colored-man-pages
colorize
globalias
)
# Startup
source ${ZSH}/oh-my-zsh.sh
source ${ZSH}/custom/manjaro-settings.zsh
# Plugins
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Other settings
export HISTSIZE=1000000
export SAVEHIST=1000000
# Aliases
alias -g ls='ls --color=auto'
alias -g ll='ls -lah'
alias -g df='df -h'
alias -g du='du -h'
alias -g grep='grep --color=auto'
alias -g fname='find -name'
alias -g less='less --tabs=1,5'
alias -g ð='git'
alias -g ðs='ð status'
alias -g ðss='ðs -s'
alias -g ðdd='ð diff'
alias -g ðd='ð diff2'
alias -g ðdn='ð diffnames'
alias -g ða='ð add'
alias -g ðc='ð commit'
alias -g ðcc='ðc -m'
alias -g ðb='ð branch'
alias -g ð↑='ð push'
alias -g ð↑↑='ð↑ -u origin $(git branch | grep -e "^*" | cut -d" " -f 2)'
alias -g ð↓='ð pull'
alias -g ðx='ð checkout'
alias -g ðr='ð reset'
alias -g ðrr='ð reset --hard'
alias -g ≈='| grep'
alias -g ≠='| grep -v'
alias -g ≈≈='find . -type f | xargs grep 2>/dev/null -e'
alias -g :1='| cut -d":" -f1'
alias -g :2='| cut -d":" -f2'
alias -g :3='| cut -d":" -f3'
alias -g :4='| cut -d":" -f4'
alias -g :5='| cut -d":" -f5'
alias -g :6='| cut -d":" -f6'
alias -g :7='| cut -d":" -f7'
alias -g :8='| cut -d":" -f8'
alias -g :9='| cut -d":" -f9'
# Functions
SSH_ENV="${HOME}/.ssh/environment"
function start_ssh_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo "succeeded"
chmod 600 "${SSH_ENV}"
source "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add
}
function start_ssh_agent_if_needed {
if [ -f "${SSH_ENV}" ]; then
source "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_ssh_agent
}
else
start_ssh_agent
fi
}
# Init
start_ssh_agent_if_needed
# Per-machine settings
if [ -f "${HOME}/.zshrc-more" ]; then
source "${HOME}/.zshrc-more"
fi