mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 12:48:01 +00:00
Make osx functions autoloadable
This commit is contained in:
parent
b8bb51d7b5
commit
bccfca8c10
@ -9,8 +9,7 @@ Aliases
|
||||
- `cdf` changes the current working director to the current _Finder_
|
||||
directory.
|
||||
- `pushdf` pushes the current working directory onto the directory queue and
|
||||
- `ql` quick looks at files.
|
||||
- `rm-osx-cruft` deletes .DS\_Store, \_\_MACOSX cruft.
|
||||
changes the current working director to the current _Finder_ directory.
|
||||
|
||||
Functions
|
||||
---------
|
||||
@ -20,6 +19,8 @@ Functions
|
||||
- `pfd` prints the current _Finder_ directory.
|
||||
- `pfs` prints the current _Finder_ selection.
|
||||
- `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
|
||||
-------
|
||||
|
10
modules/osx/functions/ql
Normal file
10
modules/osx/functions/ql
Normal file
@ -0,0 +1,10 @@
|
||||
#
|
||||
# Previews files in Quick Look.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
if (( $# > 0 )); then
|
||||
qlmanage -p "$@" &> /dev/null
|
||||
fi
|
11
modules/osx/functions/rm-osx-cruft
Normal file
11
modules/osx/functions/rm-osx-cruft
Normal file
@ -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.
|
||||
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…
Reference in New Issue
Block a user