diff options
| author | Paul Ossenbruggen <possen@quintescent.net> | 2018-06-05 06:37:20 -0700 | 
|---|---|---|
| committer | Robby Russell <robby@planetargon.com> | 2018-06-05 06:37:20 -0700 | 
| commit | 6ace3cd18dd3cbc0e2631fa98051194b703fe4d7 (patch) | |
| tree | acf3d1669cd3b94e41815c9d6fff9338b3ad27a0 /plugins/xcode | |
| parent | ebda8af870acc295388ed187f0139a8bffa83196 (diff) | |
| download | zsh-6ace3cd18dd3cbc0e2631fa98051194b703fe4d7.tar.gz zsh-6ace3cd18dd3cbc0e2631fa98051194b703fe4d7.tar.bz2 zsh-6ace3cd18dd3cbc0e2631fa98051194b703fe4d7.zip | |
add xx command to Xcode plugin. Allows quick opening of files in Xcode. (#6812)
Diffstat (limited to 'plugins/xcode')
| -rw-r--r-- | plugins/xcode/README.md | 6 | ||||
| -rw-r--r-- | plugins/xcode/xcode.plugin.zsh | 13 | 
2 files changed, 17 insertions, 2 deletions
| diff --git a/plugins/xcode/README.md b/plugins/xcode/README.md index c12ce047f..37f882638 100644 --- a/plugins/xcode/README.md +++ b/plugins/xcode/README.md @@ -19,7 +19,7 @@ plugins=(... xcode)  | xcdd  | Purge all temporary build information    | rm -rf ~/Library/Developer/Xcode/DerivedData/* |  | xcp   | Show currently selected Xcode directory  | xcode-select --print-path                      |  | xcsel | Select different Xcode directory by path | sudo xcode-select --switch                     | - +| xx    | Opens the files listed in Xcode          | open -a "Xcode.app"                            |  ## Functions @@ -29,6 +29,10 @@ plugins=(... xcode)  Opens the current directory in Xcode as an Xcode project. This will open one of the `.xcworkspace` and `.xcodeproj` files that it can find in the current working directory. You can also specify a directory to look in for the Xcode files.  Returns 1 if it didn't find any relevant files. +###  `xx` + +Opens the files listed in Xcode, multiple files are opened in a multi-file browser. +  ###  `simulator`  Opens the iOS Simulator from your command line, dependent on whichever is the active developer directory for Xcode. (That is, it respects the `xcsel` setting.) diff --git a/plugins/xcode/xcode.plugin.zsh b/plugins/xcode/xcode.plugin.zsh index f711c39fb..b46e05f2f 100644 --- a/plugins/xcode/xcode.plugin.zsh +++ b/plugins/xcode/xcode.plugin.zsh @@ -27,6 +27,17 @@ function xc {    fi  } +# Opens a file or files in the Xcode IDE. Multiple files are opened in multi-file browser +# original author: @possen +function xx { +  if [[ $# == 0 ]]; then +    echo "Specify file(s) to open in xcode." +    return 1 +  fi +  echo "${xcode_files}" +  open -a "Xcode.app" "$@" +} +  # "XCode-SELect by Version" - select Xcode by just version number  # Uses naming convention:  #  - different versions of Xcode are named Xcode-<version>.app or stored @@ -70,7 +81,7 @@ function xcselv {  function _omz_xcode_print_xcselv_usage {    cat << EOF >&2 -Usage:  +Usage:    xcselv <version>    xcselv [options] | 
