Skip to content

Commit bfab3b9

Browse files
authored
Merge pull request #116 from jfmcdowell/fixup
Added `function` keyword
2 parents 2f03dd9 + 7bce594 commit bfab3b9

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

zsh/.zsh_functions

+22-22
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,50 @@
1111
# your own fork of the quickstart kit
1212

1313
# Add some quickstart toggle functions
14-
zsh-quickstart-select-bullet-train() {
14+
function zsh-quickstart-select-bullet-train() {
1515
touch ~/.zsh-quickstart-use-bullet-train
1616
rm -f ~/.zgen/init.zsh
1717
}
1818

19-
zsh-quickstart-select-powerlevel10k() {
19+
function zsh-quickstart-select-powerlevel10k() {
2020
rm -f ~/.zsh-quickstart-use-bullet-train
2121
rm -f ~/.zgen/init.zsh
2222
}
2323

24-
zsh-quickstart-disable-omz-plugins() {
24+
function zsh-quickstart-disable-omz-plugins() {
2525
touch ~/.zsh-quickstart-no-omz
2626
rm -f ~/.zgen/init.zsh
2727
}
2828

29-
zsh-quickstart-enable-omz-plugins() {
29+
function zsh-quickstart-enable-omz-plugins() {
3030
rm -f ~/.zsh-quickstart-no-omz
3131
rm -f ~/.zgen/init.zsh
3232
}
3333

34-
exists() {
34+
function exists() {
3535
if (( $+commands[$1] )); then return 0; else return 1; fi
3636
}
3737

3838
39-
ff() {
39+
function ff() {
4040
find . -type f -iname '*'$@'*' -ls
4141
}
4242

43-
hgrep_full() {
43+
function hgrep_full() {
4444
history | egrep --color -i "$@"
4545
}
4646

4747
# easier to type, leaving hgrep_full for backwards compatibility
48-
hgrep-full() {
48+
function hgrep-full() {
4949
hgrep_full "$@"
5050
}
5151

52-
envgrep() {
52+
function envgrep() {
5353
printenv | grep -i "$@"
5454
}
5555

5656
# From Dan Ryan's blog - http://danryan.co/using-antigen-for-zsh.html
57-
man() {
57+
function man() {
5858
env \
5959
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
6060
LESS_TERMCAP_md=$(printf "\e[1;31m") \
@@ -67,31 +67,31 @@ man() {
6767
}
6868

6969
# From commandlinefu.com
70-
watch() { t=$1; shift; while test :; do clear; date=$(date); echo -e "Every $ts: $@ \t\t\t\t $date"; $@; sleep $t; done }
70+
function watch() { t=$1; shift; while test :; do clear; date=$(date); echo -e "Every $ts: $@ \t\t\t\t $date"; $@; sleep $t; done }
7171

7272
# scp file to machine you're sshing into this machine from
73-
mecp() {
73+
function mecp() {
7474
scp "$@" ${SSH_CLIENT%% *}:~/Downloads/;
7575
}
7676

77-
calc() {
77+
function calc() {
7878
awk "BEGIN{ print $* }" ;
7979
}
8080

81-
get_nr_jobs() {
81+
function get_nr_jobs() {
8282
jobs | wc -l
8383
}
8484

85-
get_load() {
85+
function get_load() {
8686
uptime | awk '{print $11}' | tr ',' ' '
8787
}
8888

89-
mtr_url() {
89+
function mtr_url() {
9090
host=$(ruby -ruri -e "puts (URI.parse('$1').host or '$1')")
9191
sudo mtr -t $host
9292
}
9393

94-
fix_tmux_ssh_agent() {
94+
function fix_tmux_ssh_agent() {
9595
for key in SSH_AUTH_SOCK SSH_CONNECTION SSH_CLIENT; do
9696
if (tmux show-environment | grep "^${key}" > /dev/null); then
9797
value=$(tmux show-environment | grep "^${key}" | sed -e "s/^[A-Z_]*=//")
@@ -101,28 +101,28 @@ fix_tmux_ssh_agent() {
101101
}
102102

103103
# Probe a /24 for hosts
104-
scan24() {
104+
function scan24() {
105105
nmap -sP ${1}/24
106106
}
107107

108108
# Netjoin - Block until a network connection is obtained.
109109
# Originally from https://github.com/bamos/dotfiles/blob/master/.funcs
110-
nj() {
110+
function nj() {
111111
while true; do
112112
ping -c 1 8.8.8.8 &> /dev/null && break
113113
sleep 1
114114
done
115115
}
116116

117117
# lists zombie processes
118-
zombie() {
118+
function zombie() {
119119
ps aux | awk '{if ($8=="Z") { print $2 }}'
120120
}
121121
alias zombies=zombie
122122

123123
# get the content type of an http resource
124124
# from https://github.com/jleclanche/dotfiles/blob/master/.zshrc
125-
htmime() {
125+
function htmime() {
126126
if [[ -z $1 ]]; then
127127
print "USAGE: htmime <URL>"
128128
return 1
@@ -132,7 +132,7 @@ htmime() {
132132
}
133133

134134
# Start an HTTP server from a directory, optionally specifying the port
135-
httpserver() {
135+
function httpserver() {
136136
local port="${1:-8000}";
137137
sleep 1 && open "http://localhost:${port}/" &
138138
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`

0 commit comments

Comments
 (0)