1
0
Fork 0

Make osx functions autoloadable

pull/554/head
Sorin Ionescu 11 years ago
parent b8bb51d7b5
commit bccfca8c10

@ -9,8 +9,7 @@ Aliases
- `cdf` changes the current working director to the current _Finder_ - `cdf` changes the current working director to the current _Finder_
directory. directory.
- `pushdf` pushes the current working directory onto the directory queue and - `pushdf` pushes the current working directory onto the directory queue and
- `ql` quick looks at files. changes the current working director to the current _Finder_ directory.
- `rm-osx-cruft` deletes .DS\_Store, \_\_MACOSX cruft.
Functions Functions
--------- ---------
@ -20,6 +19,8 @@ Functions
- `pfd` prints the current _Finder_ directory. - `pfd` prints the current _Finder_ directory.
- `pfs` prints the current _Finder_ selection. - `pfs` prints the current _Finder_ selection.
- `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]). - `tab` creates a new tab (works in both _Terminal_ and [_iTerm_][3]).
- `ql` previews files in Quick Look.
- `rm-osx-cruft` deletes .DS\_Store, \_\_MACOSX cruft.
Authors Authors
------- -------

@ -0,0 +1,10 @@
#
# Previews files in Quick Look.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
if (( $# > 0 )); then
qlmanage -p "$@" &> /dev/null
fi

@ -0,0 +1,11 @@
#
# Deletes .DS_Store and __MACOSX directories.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
find "${@:-$PWD}" \( \
-type f -name '.DS_Store' -o \
-type d -name '__MACOSX' \
\) -print0 | xargs -0 rm -rf

@ -19,21 +19,3 @@ alias cdf='cd "$(pfd)"'
# Push directory to the current Finder directory. # Push directory to the current Finder directory.
alias pushdf='pushd "$(pfd)"' alias pushdf='pushd "$(pfd)"'
#
# Functions
#
# Open files in Quick Look.
function ql {
(( $# > 0 )) && qlmanage -p "$@" &> /dev/null
}
# Delete .DS_Store and __MACOSX directories.
function rm-osx-cruft {
find "${@:-$PWD}" \( \
-type f -name '.DS_Store' -o \
-type d -name '__MACOSX' \
\) -print0 | xargs -0 rm -rf
}

Loading…
Cancel
Save