-
Notifications
You must be signed in to change notification settings - Fork 2
/
gpspake.plugin.zsh
50 lines (42 loc) · 1.05 KB
/
gpspake.plugin.zsh
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
# ---------------------
# Environment Variables
# ---------------------
export HOSTS_PATH="/etc/hosts"
export CODE_DIRECTORY="${HOME}/code"
export DOTFILES_DIRECTORY="${CODE_DIRECTORY}/dotfiles"
# -------
# Aliases
# -------
# ll to detailed direct list
alias ll='ls -la'
# edit zsh
alias zshedit='vim ${DOTFILES_DIRECTORY}/zsh/gpspake/gpspake.plugin.zsh'
# source zsh after editing
alias zshsource='source ${DOTFILES_DIRECTORY}/zsh/gpspake/gpspake.plugin.zsh'
# go to dotfiles
alias dotfiles='cd ${DOTFILES_DIRECTORY}'
# edit hosts
alias hosts='sudo vim ${HOSTS_PATH}'
# ---------
# Functions
# ---------
# ll after cd - @speakingcode
cd() {
new_directory="$*";
if [ $# -eq 0 ]; then
new_directory=${HOME};
fi;
builtin cd "${new_directory}" && ll
}
# mkdir and cd
mkcd() { mkdir -p "$@" && cd "$_"; }
# c to cd to ~/code - @vongrippen
c() { cd ${CODE_DIRECTORY}/$1; }
# tab complete c against code
_c() { _files -W ${CODE_DIRECTORY} -/; }
compdef _c c
# h to cd to home
h() { cd ~/$1; }
# tab complete h against home
_h() { _files -W ~/ -/; }
compdef _h h