-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathzshrc
133 lines (108 loc) · 3.97 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
# :: Zplug - ZSH plugin manager
export ZPLUG_HOME=$HOME/.zplug
# Check if zplug is installed
if [[ ! -d $ZPLUG_HOME ]]; then
git clone https://github.com/zplug/zplug $ZPLUG_HOME
source $ZPLUG_HOME/init.zsh && zplug update --self
fi
# Essential
source $ZPLUG_HOME/init.zsh
# Zplug plugins
zplug "zplug/zplug", hook-build:"zplug --self-manage"
zplug "modules/tmux", from:prezto
zplug "modules/history", from:prezto
zplug "modules/utility", from:prezto
#zplug "modules/ruby", from:prezto
#zplug "modules/ssh", from:prezto
zplug "modules/terminal", from:prezto
zplug "modules/editor", from:prezto
zplug "modules/directory", from:prezto
zplug "modules/completion", from:prezto
# zsh users
zplug "zsh-users/zsh-completions", defer:0
zplug "zsh-users/zsh-autosuggestions", defer:2, on:"zsh-users/zsh-completions"
zplug "zsh-users/zsh-syntax-highlighting", defer:3, on:"zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search", defer:3, on:"zsh-users/zsh-syntax-highlighting"
# Plugins from oh my zsh
#zplug "lib/clipboard", from:oh-my-zsh, if:"[[ $OSTYPE == *darwin* ]]"
#zplug "plugins/vi-mode", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
#zplug "plugins/brew", from:oh-my-zsh
# Enhanced cd
zplug "b4b4r07/enhancd", use:enhancd.sh
# Bookmarks and jump
zplug "jocelynmallon/zshmarks"
# Enhanced dir list with git features
zplug "supercrabtree/k"
# Tips for aliases
zplug "djui/alias-tips"
# Docker completion
zplug "felixr/docker-zsh-completion"
# Load theme
zplug "bhilburn/powerlevel9k", use:powerlevel9k.zsh-theme
# Theme setup
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_PROMPT_ON_NEWLINE=false
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX="❱ "
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir dir_writable vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time todo background_jobs os_icon)
POWERLEVEL9K_DISABLE_RPROMPT=false
POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=false
POWERLEVEL9K_STATUS_VERBOSE=true
POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE=false
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
POWERLEVEL9K_SHORTEN_DELIMITER=""
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right"
POWERLEVEL9K_OS_ICON_FOREGROUND="black"
POWERLEVEL9K_OS_ICON_BACKGROUND="white"
POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND="black"
POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND="blue"
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND="black"
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND="yellow"
POWERLEVEL9K_STATUS_ERROR_FOREGROUND="black"
POWERLEVEL9K_STATUS_ERROR_BACKGROUND="red"
POWERLEVEL9K_STATUS_OK_FOREGROUND="black"
POWERLEVEL9K_STATUS_OK_BACKGROUND="green"
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="black"
POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND="yellow"
POWERLEVEL9K_CONTEXT_ROOT_FOREGROUND="black"
POWERLEVEL9K_CONTEXT_ROOT_BACKGROUND="red"
POWERLEVEL9K_NODE_VERSION_BACKGROUND="red"
POWERLEVEL9K_NODE_VERSION_FOREGROUND="white"
export ZSH_PLUGINS_ALIAS_TIPS_TEXT=' alias hint: '
# User configuration
export PATH="$HOME/.dotfiles/bin:$HOME/.bin:/usr/local/bin:$PATH"
export LANG=en_US.UTF-8
export EDITOR='vim'
export TERM="xterm-256color"
[[ -n "$SSH_CLIENT" ]] || export DEFAULT_USER="pd"
export KEYTIMEOUT=1
# :: Aliases and functions
alias l="ls"
alias ll="ls -al"
alias kk="k -a"
alias b="bookmark"
alias bd="deletemark"
alias j="jump"
alias c="clear"
alias td="todo.sh"
# Multiline/Singleline
alias multi_line="export POWERLEVEL9K_PROMPT_ON_NEWLINE=true"
alias single_line="export POWERLEVEL9K_PROMPT_ON_NEWLINE=false"
# Findfile and find content
function f() { find . -iname "*$1*" ${@:2} }
function r() { grep "$1" ${@:2} -R . }
# Docker VMs
alias dev=ubuntu-dev
function ubuntu-dev {
id=$(uuidgen | cut -c 1-4)
name=$USER-ubuntu-dev-$id
docker run -ti --rm --name $name --hostname $name --volumes-from dev-volumes -w $PWD -u dev drahosp/ubuntu-dev "$@"
}
# Install plugins if there are plugins that have not been installed
if ! zplug check; then
zplug install
fi
# Load everything
zplug load