Added cd to active Xcode project to osx plugin
This commit is contained in:
parent
d2725d44fc
commit
1f56eabbee
@ -24,6 +24,7 @@ Original author: [Sorin Ionescu](https://github.com/sorin-ionescu)
|
||||
| `pfd` | Return the path of the frontmost Finder window |
|
||||
| `pfs` | Return the current Finder selection |
|
||||
| `cdf` | `cd` to the current Finder directory |
|
||||
| `cdx` | `cd` to the current Xcode project directory |
|
||||
| `pushdf` | `pushd` to the current Finder directory |
|
||||
| `quick-look` | Quick-Look a specified file |
|
||||
| `man-preview` | Open a specified man page in Preview app |
|
||||
|
@ -160,6 +160,15 @@ function pfs() {
|
||||
EOF
|
||||
}
|
||||
|
||||
function xcodeprojdir() {
|
||||
dirname $(osascript 2>/dev/null <<EOF
|
||||
tell application "Xcode"
|
||||
return path of active workspace document
|
||||
end tell
|
||||
EOF
|
||||
) 2>/dev/null
|
||||
}
|
||||
|
||||
function cdf() {
|
||||
cd "$(pfd)"
|
||||
}
|
||||
@ -168,6 +177,10 @@ function pushdf() {
|
||||
pushd "$(pfd)"
|
||||
}
|
||||
|
||||
function cdx() {
|
||||
cd "$(xcodeprojdir)"
|
||||
}
|
||||
|
||||
function quick-look() {
|
||||
(( $# > 0 )) && qlmanage -p $* &>/dev/null &
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user