Skip to content

Commit d42671f

Browse files
committed
Remove whitespace from function definitions, add netwhat alias function, and remove OS-specific netwhat implementation
1 parent 6132de6 commit d42671f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

.zshrc

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ alias ghs='git stash save'
191191
alias ghsp='git stash save --patch'
192192
alias ghw='git stash show -p'
193193
alias gist='gist -p -c'
194-
alias gitignoregen='_gitignoregen () { curl -sL "https://www.toptal.com/developers/gitignore/api/$1" }; _gitignoregen'
194+
alias gitignoregen='_gitignoregen() { curl -sL "https://www.toptal.com/developers/gitignore/api/$1" }; _gitignoregen'
195195
alias gk='gitk &>/dev/null'
196196
alias gl1='git log -n 1'
197197
alias gl='git quicklog -n 10'
@@ -237,14 +237,15 @@ alias i4='sed "s/^/ /"'
237237
alias icat='imgcat'
238238
alias ils='imgls'
239239
alias iurl='xcrun simctl openurl booted'
240-
alias jqi='_jqi () { echo "" | fzf --print-query --preview "cat $@ | jq {q}" }; _jqi'
240+
alias jqi='_jqi() { echo "" | fzf --print-query --preview "cat $@ | jq {q}" }; _jqi'
241241
alias k='tree -h'
242242
alias l="ls -lh"
243243
alias lg='l --git'
244244
alias ll="l -a"
245245
alias lt='ls -lt'
246246
alias ltr='ls -ltr'
247247
alias nerdcrap='cat /dev/urandom | xxd | grep --color=never --line-buffered -E "00 00[0-2]"'
248+
alias netwhat='_netwhat() { lsof -P -i:$* }; _netwhat'
248249
alias nohist='HISTFILE='
249250
alias notifydone='terminal-notifier -message Done.'
250251
alias o=ollama
@@ -258,7 +259,7 @@ alias pkgls='ls /var/db/receipts/'
258259
alias pt='pstree -pul'
259260
alias rake='noglob rake'
260261
alias randnum='python -S -c "import random; print(random.SystemRandom().randrange(10**7,10**8))"'
261-
alias rgg='_rgg () { rg --color always --heading $@ | $PAGER }; _rgg'
262+
alias rgg='_rgg() { rg --color always --heading $@ | $PAGER }; _rgg'
262263
alias ri='ri -f ansi'
263264
alias rls='screen -ls'
264265
alias rrg='rgg'
@@ -368,13 +369,6 @@ if ! _has tac && _has gtac ; then
368369
alias tac=gtac
369370
fi
370371

371-
# What's using that TCP port?
372-
if [ "$(uname -s)" = "Darwin" ]; then
373-
alias netwhat='sudo lsof -Pni tcp'
374-
else
375-
alias netwhat='lsof -i +c 40'
376-
fi
377-
378372
# Let me know when commands are done by prepending `;b` to things.
379373
if _has terminal-notifier ; then
380374
alias b='terminal-notifier -sound Glass -message "Done - $?"'

0 commit comments

Comments
 (0)